VII Advanced Editor features
This chapter will explain the following advanced features that are part of KenyaEclipse:
- Variable and type occurrence highlighting
- Code assistance (auto completion)
- Parameter hints for method calls
- Source editing, including
- Comment toggling
- Block comment toggling
- Indentation correction
- Refactoring, including
- Variable renaming
- Type (class) renaming
Occurrence Highlighting
The occurrence highlighter can be enabled by using its button in the toolbar:

The highlighter is capable of highlighting various things:
Variable references: ![]() |
References to methods: ![]() |
Type (class) references: ![]() |
Method exit points: ![]() |
Note that Java 1.5 enumerated types will either not be highlighted or that some occurrences may be missed out.
Code assistance (auto completion)
Code assistance helps you write code faster by letting you complete variable or method names automatically. This function is automatically triggered if you use a qualified name to access fields inside a class, once you type the '.' (dot). You can also bring up the completion dialog yourself by using Content Assist in the Edit menu (Ctrl+Space on most platforms).
The completion dialog gives choices of all variables and methods that you can use at the current position in your code. While you type more characters, it will narrow down the choices to match.

Hitting enter or double clicking the desired completion will insert the completion into the code.
Note that this feature does not support Java 1.5 enumerated types and does not show type parameters for Java 1.5 parameterised methods.
Parameter Hints
Whether it is a predefined method or one that you wrote yourself, you may not be able to remember the exact order in which you need to enter its arguments. Parameter hints solve this problem by showing you the order, names and types of a method's arguments. This feature can be triggered by selecting Parameter Hints in the Edit menu.
Source editing
To speed up common tasks such as commenting (or uncommenting), the source menu, which is available through the right click menu in the editor contains a few very powerful tools for source editing. The following methods currently exist:
- Toggle comment – adds or removes single line commenting ('//') for current selection or cursor position
- Add block comment – requires multiple characters to be selected, encloses them in a block comment (/* */)
- Remove block comment – removes surrounding block comment from current selection or cursor position
- Correct indentation – corrects the indentation of the selection according to bracketing rules
Refactoring
Refactoring is defined to be source tranformation without changing the semantics of the code. There are many useful refactorings for Java. These refactorings are available through the right click menu in the editor. The following refactorings currently exist:
- Rename – Renames all occurrences of the currently selected (or at cursor position) variable, method or class. You will be asked to specify a new name. This can be useful for changing the name of a variable to something more meaningful (rather than a single-character name for instance).