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