Java code completion
Forte for Java, Community Edition also has a dynamic code completion feature, where you can type a few characters and then bring up a list of possible classes, methods, variables, and so on that can be used to complete the expression.
To use Java code completion:
- Type the first few characters of the expression (for example, import javax. or someFile.getP).
- Press CTRL+SPACE (or pause after entering a period). The code completion box will then appear.
![]()
- Then use the most convenient combination of the following steps:
- keep typing to narrow 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
- press ENTER to enter the selected method into your file and close the code completion box
- press TAB to select the longest common substring matching the text you have typed (Bash-style context-sensitive completion) and keep the list box open
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, it's 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.When the code completion box is open, three other keyboard shortcuts are available:
- 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.
For these shortcuts to work, the source file must be in a directory mounted in Filesystems, and the parser database must be updated for that source. See "Adding your own classes to the parser database". In addition, for ALT+F1 to work, the Javadoc documentation for that source must be mounted under the Javadoc tab in the Explorer.
See Customizing Java code completion for information on further options.
Contents | Prev | Next | Index |