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).

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

Get Eclipse IDE Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.