
10 ways to be more productive with Eclipse for Java developers
- Tutorial

Many of you know how to increase productivity by using hot keys , code templates and the very cool search bar (Quick Access), but I would like to talk about ten possibilities that not everyone knows.
1. Code Recommenders
Code Recommenders is a delightful smart plugin that helps you write code. Previously, when we pressed Ctrl + Space, we saw all the methods, variables and templates, many of which could be completely useless; the Code Recommenders plugin selects useful methods that are applicable in this case and arranges them according to relevance - by the probability with which we use the method in this context. And SnipMatch from Code Recommenders even allows you to insert whole blocks of boilerplate code. For details and installation here .


2. Type Filters
Type Filters remove recommendations of selected types from anywhere. Just from everywhere. Eclipse PDE developers, for example, are constantly interrupted by Label, Button, and other AWT classes, because they write in SWT, and even more so it makes no sense to meet List from AWT if you write a library. So go to Preferences ... no, not that. Press Ctrl + 3 and start typing “Type Filters”, go to the appropriate settings page and if necessary add java.awt * and javax.swing *.

3. Favorites
There is another case - when you want to always see some kind of native static methods. For example, I often use the preconditions from the Guava library - Preconditions.checkArgument (boolean) and Preconditions.checkNotNull (T), which are so basic that when setting up Eclipse, I go to Favorites right away and add com.google.common.base there. Preconditions.

4. Organize imports on save
Perhaps someone has already developed a reflex to press Ctrl + Shift + O to clear unnecessary imports when they see yellow bars at the top of the editor’s vertical scroll bar, or maybe someone presses this key combination unconditionally before saving. But don’t worry so, you don’t have to do this - go to “Save Actions”, select “Perform the selected actions on save” and make sure that “Organize imports” is selected - now unnecessary imports themselves will be deleted when saved. By the way, there are many more useful actions there, such as arranging missing Override annotations, deleting unnecessary type conversions, deleting dead code, or formatting only edited lines, and there are even “fun” features like converting regular for to foreach or unnamed classes to lambdas .

5. Display
Display is a view that gives you the power to use a debugger like a real ninja. Code from the Display view runs in the context of the current debugging. We write a line of code, select it, press Ctrl + U, and the code starts, and press Ctrl + Shift + V - the code not only starts, but the result of its call is printed next to our code in Display. In addition, selected text can be sent to Watch Expressions. All these actions are also available on the view toolbar.

Remarks
- Any highlighted text can be sent to Watch Expressions using the “Watch” command. There is no default hotkey for this command, but you know that in Eclipse any team can be assigned a cat.
- The Ctrl + U and Ctrl + Shift + V keys work even if you select text directly in the code editor; if you press Ctrl + Shift + V, the result will be shown in the pop-up window.
6. Show Logical Structure
One of the most annoying things when debugging is tinkering with the contents of a TreeMap or LinkedList, because in the Variables view they are presented in an inconvenient way, which corresponds to their real structure, but does not correspond to the logical structure. The button “Show Logical Structure” on the toolbar of the Variables view just makes it so that we see the contents of such collections (and not only) in a form convenient for us. At the same time, this button changes the appearance of the display of objects when you mouse over. This button looks like an image of a tree, next to which on the left is a yellow arrow.

7. Bookmarks
Bookmarks - actually, a view for working with bookmarks. It is useful when you need to parse a whole ton of some code, because it allows you to go to the “selected places” of the code and take notes on them - bookmarks are added by clicking on the area to the left of the editor, “Add Bookmark ...”, but better, of course, assign a hotkey (for example, Ctrl + B - it’s useless anyway, because it is assigned to “Build All” by default).

8. Split Editors
After 12 years, 200 votes, and 181 comments , the separation of editors was implemented in Eclipse. The horizontal split is Ctrl + _ (Ctrl + Shift + -), and the vertical split is Ctrl + {(Ctrl + Shift + [). Hurrah! We can edit two parts of the file at the same time! By the way, these two parts are perceived as different editors when switching between editors (when pressing Ctrl + F6 or Ctrl + Shift + E, but not when pressing Ctrl + E).

9. FindBugs, Checkstyle, PMD Eclipse
Various code analyzers help to find copy paste, deviations from programming standards and other potential problems in the code even before these problems leaked into the bugtracker (and, as a result, worsened the opinion of customers about your company), moreover, such analyzers inevitably help better understand the Java library and use the language more efficiently. Naturally, for many such useful tools there is integration with Eclipse.

I note that FindBugs, Checkstyle and PMD Eclipse are all in the Eclipse Marketplace, so their installation is extremely simple via Help → Eclipse Marketplace ... without googling and visiting any sites.
10. Plugins
The power of Eclipse in general is the ability to use any plugins that you may need, this applies not only to code verification plugins. Need a Java disassembler? There is a JD-Eclipse. Need integration with Maven or Apache Ivy? There are m2e and Apache IvyDE. Can't understand the 5000 lines of your Ant build code? There is Ant Visualizer. Worried about dead code? There is an Unnecessary Code Detector. Want to “draw” SWT windows with the WYSIWYG editor? There is WindowBuilder.

11. Secret opportunity
To be interested in productivity - to be interested in how to use those tools that you use correctly and what innovations are introduced in them.
And what features increase your productivity in Eclipse?
Related Materials
- Eclipse for Java Developers. Navigation and editing - an article on Habr about hot keys in Eclipse IDE for Java Develipers. By the way, Ctrl + Shift + L is a hotkey for all hotkeys.
- My Top 10 Tips on how to be more productive with the Eclipse IDE - Jordi Böhme López
suggests 10 useful Eclipse features. - The Tips and Tricks (JDT) from the Eclipse documentation is a lot of simple tips covering quite a lot of the JDT functionality.
- Eclipse Luna - New And Noteworthy - Some new features of Eclipse Luna, in particular features for Java developers .