Everyone I have ever seen use Eclipse has package explorer open and they are constantly scrolling up and down, left and right, to open classes in different packages and projects. I hate package explorer. I don’t think a tree is the right way to represent classes, there is too much scrolling up and down and the indentation causes left and right scrolling. Also, I don’t want my IDE to try to replace my filesystem. There is a better way!
Years ago I found three views that can replace package explorer: projects, packages, and types. With these three views I can open any class in the same package in one click, and class in the same project in two clicks, and any class in any other project in three clicks. It is godly! Go ahead, try it out, it rocks!
In the projects view, I use the filter settings (click the little arrow) to filter out resource directories and JARs. This way the view only contains projects and source folders.
The three views don’t need as much horizontal space. The package view can, but to fix that click the little arrow in the view and make sure it is set to “package presentation -> flat”. Also, go to Window -> Preferences -> Java -> Appearance and set the “compression pattern” to “5…” without the quotes. You can change 5 higher or lower. This shortens all package names except the last one to 5 characters.
I usually keep a fourth view, members, in a tab in the same group as types, for the rare occasion I want to browse a class’ methods (usually to get an overview of the public API).
Another tip for navigation is a plugin called Easy Explore. This lets you right click anywhere in Eclipse and open the operating system’s filesystem browser at that resource location. This lets me use the filesystem as I wish and I don’t have to try to do inside the IDE. The plugin is here:
http://osdn.dl.sourceforge.net/sourceforge/easystruts/org.easyexplore_1.0.1.zip
Just put it in the Eclipse/plugins directory and restart Eclipse.
I like to put my 3 views on the right. This way I can hit ctrl+m to see more code and the position of the code doesn’t shift. For a while now I have been using a 24", 1920x1200 monitor rotated 90 degrees. The 1920 pixels high gives me 126 lines of code visible at once! The 1200 pixels across is enough for 130 columns and the 3 views stacked on top of each other. I usually have the debug and problems view under those. Across the bottom I have the console, with tabs for seldom used views.
If you are using a single, not so large monitor, you can drag the console view to the toolbar at the bottom left of the Eclipse window. Right click its icon and check orientation -> horizontal. Now your console will pop over your code when stuff is written to it. Hit escape or click away to make the console go back to the toolbar. This maximizes the code you can see on screen, and also gives you a larger console window when you need to look at the console. Be careful though, if you close the console view by clicking its X button you have to go to Window -> Show View to get it back.
Another tip, word completion. I highly recommend binding ctrl+shift+space to “Word Completion”. When pressed, it looks backwards from your caret and inserts the first word it finds with the same prefix as what you have typed. Hit it again to get the next match, etc. When it hits the beginning of the file, it looks in the bottom of the file. Then it looks in every other file you have open. The reason it is so amazing is because it just does the insert, no popup. The first or second match is almost always the right match. People watching me program are amazed that the words just pop into view without me typing them!
To see all keyboard shortcuts, hit ctrl+shift+L in Eclipse.