Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (687)
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 1628 times)
0 Members and 1 Guest are viewing this topic.
Offline kpars
« 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.
Offline Riven

« JGO Overlord »

Medals: 1068
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.
Offline kpars
« 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.

Dwinin (72 views)
2015-11-07 13:29:08

Rems19 (81 views)
2015-10-31 01:36:56

Rems19 (77 views)
2015-10-31 01:32:37

williamwoles (107 views)
2015-10-23 10:42:59

williamwoles (93 views)
2015-10-23 10:42:45

Jervac_ (110 views)
2015-10-18 23:29:12

DarkCart (135 views)
2015-10-16 00:58:11

KaiHH (117 views)
2015-10-11 14:10:14

KaiHH (156 views)
2015-10-11 13:26:18

BurntPizza (172 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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‑
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!