O'Reilly logo

Eclipse IDE Pocket Guide by Ed Burnette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Tips and Tricks

The Eclipse IDE has an incredibly rich set of features, but many of them are hidden from view. With a little digging, you can discover its secrets and get the most out of the environment. This part of the book gets you started with several useful but less visible features.

Code Assist

The Java editor is always paying attention to what you type, ready to offer helpful suggestions through a feature called code assist (also called content assist). To use it, go to the Java editor in the Hello example and start a new statement in the main() method. Begin typing the following:

System.

Pause after the period. A code assist window (similar to that shown in Figure 23) will appear. The window shows you all the valid possibilities at this point. Type the letter o and the choices will narrow down to out. Press Enter to accept this choice. Given the long names most Java programs use, this can be a real time-saver.

Besides reducing typing, code assist is especially handy when you are exploring unfamiliar territory—for example, making calls to a library you haven’t used before. Code assist is activated automatically by certain keystrokes—like the period in the previous example—but you can also invoke it at any time by pressing Ctrl+Space (Edit Content Assist). This feature is fully configurable in the Java editor preferences (Window Preferences Java Editor).

Code assist tells you what comes next and displays any Javadoc (if the source is available).
Figure 6-1. Code ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required