Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  What are some neat features of Eclipse you think more people should know about?  (Read 929 times)
0 Members and 1 Guest are viewing this topic.
Online kpars

JGO Wizard


Medals: 79
Projects: 4
Exp: 3 years


Extreme Typist.


« Posted 2013-10-10 08:38:47 »

I have 3 things I feel like more people should know about in Eclipse:

CTRL+SHIFT+O - Organizes imports for you.
CTRL+SHIFT+F - Formats your code for you.

Plus you can drag panels outside of the Eclipse window! Screenshot.

What are yours?

- Jev.

Online Riven
« League of Dukes »

JGO Overlord


Medals: 798
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2013-10-10 08:43:44 »

Configuring Eclipse so that organizing imports and code formatting happens at each Save, so that you never need those key combos in the first place.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline SHC
« Reply #2 - Posted 2013-10-10 09:02:50 »

CTRL+SHIFT+I - Fixes the indentation of the selected text.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Troncoso

JGO Coder


Medals: 20



« Reply #3 - Posted 2013-10-10 11:27:47 »

CTRL+SHIFT+I - Fixes the indentation of the selected text.

Awww. That was my big one.
Generally any IDE has this, but if you refactor a class, field, method, variable, etc. name, rather than simply renaming it, the IDE will update all references to that specific class/field/method/variable. In Eclipse, I'm pretty sure it's ALT + SHIFT + R.

While you are typing CTRL + SPACE will bring up the context menu. Normally it doesn't pop up until you use the dot operator.

Also, I'm a huge fan of Eclipse's debugger. From what I can tell, people in general don't use debuggers a lot, but they are definitely a saving grace.
Offline StrideColossus
« Reply #4 - Posted 2013-10-10 11:39:54 »

Some more handy key combos:

+1 on CTRL+SPACE, am always horrified when I see people fully typing class and variable names!

If you want to find a class, CTRL+SHIFT+T brings up the dialog, you can use camel-case to find the class, e.g. type something like VerBF or VBF finds my VertexBufferFactory class.

CTRL+SHIFT+R does a similar thing for resources (config files, XML, properties, etc)

SHIFT+ALT+S brings up the source contextual menu, handy for auto-generating (for example) constructors, getter/setters, etc.

To rename/refactor a variable, class member or class-name, highlight it and do SHIFT+ALT+R.

Go to Preferences > Java > Code Style to fiddle with the re-format and import ordering options when saving (mentioned above).  You can also edit the default comments and JavaDoc when creating a new class, method, etc.

Preferences > Java > Editor > Content Assist > Favorites and add packages that commonly have static imports, the CTRL+SPACE contextual menu does not include static imports by default.  Handy for stuff like org.junit.Assert and org.mockito.Mockito for unit-tests, and the various OpenGL APIs.
Online kpars

JGO Wizard


Medals: 79
Projects: 4
Exp: 3 years


Extreme Typist.


« Reply #5 - Posted 2013-10-10 16:50:03 »

I can't use the ALT+SHIFT combos because that changes my keyboard layout  Sad

Offline SHC
« Reply #6 - Posted 2013-10-10 16:52:04 »

CTRL+1 moves the cursor to the nearby error and opens the Quick Fix.

Offline Troncoso

JGO Coder


Medals: 20



« Reply #7 - Posted 2013-10-10 16:57:56 »

You can likely reassign those functions to different keystrokes. I wouldn't know how, but just mess around the Preferences.
Offline SHC
« Reply #8 - Posted 2013-10-10 17:10:09 »

You can likely reassign those functions to different keystrokes. I wouldn't know how, but just mess around the Preferences.

It's in Preferences -> General -> Keys


Offline zngga
« Reply #9 - Posted 2013-10-10 17:24:16 »

Awesome! I had no idea that you could set Eclipse to auto format and organize on save! I was just thinking how great it would be to have that as an option. See, I knew I joined this Forum for a reason!  Cool

My code never has bugs... it just develops unexpected features!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (23 views)
2014-09-12 09:08:26

Norakomi (56 views)
2014-09-10 13:57:51

TehJavaDev (69 views)
2014-09-10 06:39:09

Tekkerue (34 views)
2014-09-09 02:24:56

mitcheeb (56 views)
2014-09-08 06:06:29

BurntPizza (40 views)
2014-09-07 01:13:42

Longarmx (26 views)
2014-09-07 01:12:14

Longarmx (32 views)
2014-09-07 01:11:22

Longarmx (31 views)
2014-09-07 01:10:19

mitcheeb (39 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!