Code completion
Dynamic code completion allows you to type a few characters and then
bring up a list of context-sensitive possibilities to complete
the text that you are typing.
Code completion in Java is represented by popuped listbox that contains all available classes, interfaces, methods, variables and initializers with
their appropriate icons, return types, parameters and throwing exceptions. In addition, icons are different for each access level, such as private,
package-private, protected and public. For details, you can look at the full list of available code completion icons
and detailed code completion usage situations.
Code completion uses JMI (Java Metadata Interface) for code completion. It is no longer necessary to update code completion
database manually, since 4.0 this is handeled automatically. All source codes in opened project
are scanned including the JDK. To add aditional libraries to code completion you can use
the library manager.
The following keystrokes control the code completion:
- CTRL+SPACE - popup the code completion box. Code completion is automatically invoked after typing special characters as period ("."),
comma (",") inside method argument and keywords as new and import .
- ESCAPE - abandon code completion box.
- TAB - selects the longest common substring matching the text you have typed (Bash-style context-sensitive completion) and keep the list box open.
- ENTER - enter the selected item into your file and close the code completion box.
- keeping typing if code completion is visible narrows down the selection of items in the list.
- use the navigation keys (UP arrow, DOWN arrow, PAGE-UP, PAGE-DOWN, HOME, and END) or the mouse to scroll through the list and select an expression
If you press ENTER for a method with parameters, replaceable text is given for the first parameter which you can then fill in. If the method takes multiple parameters, you can bring the list box back by typing a comma after you fill in the parameter.
If the IDE recognizes what type of parameter is required, its type is shown in the header of the completion window. If not, a question mark (?) is displayed.
If you enter a parameter that does not match any of the recognized parameter combinations for the method name, all the recognized methods of the given name and their parameter lists are displayed and an asterisk (*) appears instead of the parameter list in the header of the completion window.
Goto Source, Declaration or Documentation
The following features are built over the java code completion:
- ALT+o - open the source file that the insertion point is on (or immediately before or after).
- ALT+g - go to the variable declaration for the identifier that the insertion point is on (or immediately before or after).
- ALT+F1 - open the web browser on the Javadoc file pertaining to the item that the insertion point is on.
If the completion pane is poped the above shortcuts work according to the currently selected item
instead of the insertion point.
Code completion database is update automatically so no updates are
neccessary. Javadoc documentation is added through library manager (for libraries)
or platform manager (for JDK).
See Customizing Java code completion for information on further options.