Although the implementation of a workbench editor will be specific to your plug-in and the resources that you want to edit, the workbench provides a general structure for building an editor. The following concepts apply to all workbench editors.
An editor must implement IEditorPart and is often built by extending the EditorPart class. An editor implements its user interface in the createPartControl method. This method is used to assemble the SWT widgets or JFace viewers that present the editor contents.
An editor input is a description of something to be edited. You can think of an editor input as a file name, though it is more general. IEditorInput defines the protocol for an editor input, including the name of the input and the image that should be used to represent it in the labels at the top of the editor.
Two generic editor inputs are provided in the platform. IFileEditorInput represents an input that is a file in the file system. IStorageEditorInput represents an input that is a stream of bytes. These bytes may come from sources other than the file system.
The rest of your editor's implementation depends on the content that you are trying to present. We'll look next at the most common type of editor - the text editor.