Text editors and platform text

The platform text facility is used to implement the default text editor for the workbench.  The interface for text editing is defined in ITextEditor as a text specific extension of IEditorPart.  

The implementation of ITextEditor in the platform is structured in layers.  AbstractTextEditor is the core class of the framework for extending the editor to support source code style editing of text.  This framework is defined in org.eclipse.ui.texteditor.

The concrete implementation class TextEditor defines the behavior for the standard platform text editor.  It is defined in the package org.eclipse.ui.editors.text.

The text editor framework provides a model-independent editor that supports the following features:

We will explore how these features can be implemented in an editor by studying the org.eclipse.ui.examples.javaeditor example.  This example shows how complex features like text coloring, hover help, and automatic indenting can be implemented. 

In discussing these features we will be moving between the abstract framework, the platform editor TextEditor, and the example's subclass, JavaEditor.

 

As an an alternative implementation of a text editor, you can also decide to rely on the Extensible and Generic Editor, which is a faster and simpler approach tp implement textual language support, but with less control and some limitations compared to defining a full new editor.