VII    Advanced Editor features

This chapter will explain the following advanced features that are part of KenyaEclipse:

 

Occurrence Highlighting

The occurrence highlighter can be enabled by using its button in the toolbar:

Toggle Mark Occurrences Button

The highlighter is capable of highlighting various things:

Variable references:

Variable reference highlighting

References to methods:

Method reference highlighting

Type (class) references:

Type reference highlighting

Method exit points:

Method exit point highlighting

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.

Example Code completion

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:

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: