Customizing Java editors

The JDT tools implement a fully-functioning Java editor.  They also define API so you can assign Java text editing features to your own editors or enhance the Java editor with your plug-in specific features.

Java text editing

JavaSourceViewerConfiguration describes the configuration for a viewer that displays Java code.  Given a source code viewer, this class provides access to the instances of the utility classes that add Java specific behavior to the viewer, such as coloring, scanning of tokens, content assist, etc.  The viewer configuration depends on JavaTextTools to provide this information.   JavaTextTools is a utility class that provides the scanners and managers for Java text and ensures that these classes are configured appropriately when the Java editor preferences change.

Java text hovers

When you implement a plug-in that provides additional capabilities associated with Java code, you may want to implement new hover behavior in the editor, so that information about your model elements will be shown as the user hovers over Java code.  For example, the debugger uses a customized hover to show variable values when the user hovers over variable names in the editor.

The extension point org.eclipse.jdt.ui.javaEditorTextHovers allows you to register your own hover implementation.  You are responsible for implementing the IJavaEditorTextHover and registering your implementation class in the extension definition.  You also provide a label for your hover type so that the user can enable and disable the different types of hovers from the editor preferences page.

Legal notices