Some of the Things You'll Love About Eclipse JDT
It's true, Eclipse does look very complex with all its plug-ins but taking time to get to know it is worth the effort. I've been saving a lot of time since I began using Eclipse and here are a few of the things I appreciate more:
- Code Assist: Just press ctrl + space anywhere in the editor or start typing and then press ctrl + space. This is great for generics and not only.

- Refactoring, just a right-click away. You can change the return type, the name and the access modifier of the
method, you can add, edit and remove method parameters and exceptions
and the best part is that the rest of your code that uses this method
will be adapted to the modifications.
Refactor/Rename works directly by selecting any member and then pressing Alt+Shift+R
Refactor/Move easily moves methods, references, classes with little risk of damaging the rest of your code.


- Quick Fix. You'll get a quick fix for almost anything. You'll also never have to type an import again.


- Another cool thing is that you can drag and drop the Java variables and methods in the Outline view and that will also affect the actual code.

- Call Hierarchy opens a view with all the places where the method or variableis called. Clicking on any of the results in this view will take you to the location of the result. I found this to be really useful.

- Externalize Strings. This is just wonderful and really time saving. You can choose to externalize the strings in the whole project or just in one class. Eclipse will create a new properties file containing the strings and a Messages class with references to it. You can choose not to externalize all the strings in the window that opens after choosing Source/Externalize Strings


These are just a few of the features that I use more often and I hope you'll find them useful.
- Login or register to post comments
- 4406 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










Comments
Tracy Nelson replied on Fri, 2009/07/17 - 1:38pm
Alexandra N replied on Fri, 2009/07/17 - 5:29pm
in response to: tnelson
Miguel C. replied on Fri, 2009/07/17 - 10:36pm
Alexandra N replied on Sat, 2009/07/18 - 2:56am
in response to: thundercat
:)
Yes, that is cool. ctrl + shift + F is also cool. It will do source formatting. Of course you can set the formatting to be done each time you save the file(Window/Preferences/Java/Editor/Save actions/Format source code).
stumbav replied on Sat, 2009/07/18 - 3:41am
some more bits
Ctrl + Shift + G when standing on a type, method, variable - shows all the references to the type, method, variable, similar to call hierarchy, but without hierarchy :-)
Ctrl + Shift +T - open type - You can write just starting letters of every word if you want - e.g. AgreementManagerEJB (you write AMEJB and have it)
Ctrl + shift + R open resource you're lookinge.g. for 2009_07_15_vs.sql and you have it in a second :-)
F3 - go to variable, method, type declaration (must be standing on it)
Ctrl +1 - quickfix works even from the problems view list
Vasek
Alexandra N replied on Sat, 2009/07/18 - 4:15am
in response to: stumbav
Franklin Nwankwo replied on Sat, 2009/07/18 - 8:48am
in response to: Alexandra N
Andrew Perepelytsya replied on Sun, 2009/07/19 - 10:16pm
Alexandra N replied on Mon, 2009/07/20 - 4:13am
in response to: aperepel
:)
Yes, you do have the right to say what you think.
bogdan.mocanu replied on Mon, 2009/07/20 - 2:10pm
Nice article, although it does contain basic information and shortcuts, most of them being the baseline of each programming day in Eclipse.
What I would like to point out is that Eclipse has a nice preferences page for setting shortcut keys for almost any action in the IDE. Here are some of the shortcuts that I have set:
Ctrl+Alt+S - Synchronize the selected resource (takes me directly to SVN Synch perspective and does a synchronization of the resource)
Ctrl+Alt+R - Run test (you could run the JUnit test with Alt+Shift+X, R, but it takes multiple keys to press, and it also doesn't work all the time... not sure why)
Ctrl+Alt+X - Run the selected resource as a Java application (just like for the shortcut above, it is easier to invoke the shortcut this way)
Tip: if you find yourself clicking the same actions or going through 3-4 menus just to perform an action, and you do this multiple times a day, do yourself a favor and set a shortcut key. It will save you multiple minutes and brain cycles :).
Alexandra N replied on Tue, 2009/07/21 - 2:59am
in response to: bogdan.mocanu
Thank you, Bogdan. And you're right, this is about how to make our lives easier each day. Not everyone has programmed in Eclipse before. I used to be a Netbeans user, actually, until recently. So I find this stuff in Eclipse really good.