public abstract class Editor extends View
Editor
interface defines the methods to open and
close editors, along with methods to save and restore editor specific
settings.Extensions that introduce new editor types need to implement this interface. A new editor is introduced by declaring it in the extension deployment descriptor (EDD) file. There, the editor implementation class is associated with a unique string identifying the editor type.
PROP_ICON_PATH, PROP_LABEL, PROP_VISIBLE
Constructor and Description |
---|
Editor() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
This method is called when the editor is closed by the user.
|
Context |
getContext()
Get the context for this editor.
|
java.lang.String |
getLabel()
Get a short descriptive label that can be shown to the user.
|
void |
open(Context context)
This method is called to open the editor.
|
abstract void |
restore(java.util.prefs.Preferences preference)
Restore the last known state of the editor.
|
abstract void |
save(java.util.prefs.Preferences preference)
Save the current state of the editor so that it can be restored when the
editor is re-opened on the same document.
|
activate, deactivate, getController, getGUI, isVisible, parent, setVisible
addPropertyChangeListener, firePropertyChange, getIcon, getToolTip, removePropertyChangeListener, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getID
public void open(Context context)
Document
specified by the context
.
This method should only be called by the EditorManager
. The
editor manager needs to keep track of all editors opened.
This implementation stores the context for later retrieval via getContext().
context
- The current context. The editor will be opened on
the document specified in the context.public abstract void close()
This method should only be called by the EditorManager
. The
editor manager needs to keep track of all editors opened.
public abstract void restore(java.util.prefs.Preferences preference)
EditorManager
just before the editor is opened.
This method should only be called by the EditorManager
.
preference
- Preferences saved when this editor was last closed.
These preferences are used for restoring the last know state of the
editor. Extensions are responsible for identifying the preference
sub-node associated with this editor.public abstract void save(java.util.prefs.Preferences preference)
EditorManager
when an editor is about to be closed, or when
the EditorManager
is shutting down.
This method should only be called by the EditorManager
.
preference
- Preferences saved when this editor was last closed.
These preferences are used for restoring the last know state of the
editor. Extensions are responsible for identifying the preference
sub-node associated with this editor.public java.lang.String getLabel()
DefaultViewable
getLabel
in interface Viewable
getLabel
in class DefaultViewable
public Context getContext()
getContext
in class View