|
|||||||||
Home >> All >> javax >> ide >> [ editor overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
javax.ide.editor
Class EditorManager

java.lang.Objectjavax.ide.Service
javax.ide.editor.EditorManager
- public abstract class EditorManager
- extends javax.ide.Service
The EditorManager
manages the life cycle of Editors.
It is also the registry of information about what editors can be used with
particular documents.
Clients use this class to open an editor on a javax.ide.model.Document. When clients request to open an editor on a specific document, the editor manager performs the following tasks:
- 1. Create an instance of the requested editor type. If no type is specified, create an instance of the preferred editor associated with the target document.
- 2. Call the
Editor.open(javax.ide.command.Context)
55 method passing the appropriate context. - 3. Call the
Editor.restore(java.util.prefs.Preferences)
55 method to restore any previously saved editor state. - 5. Call the View.setVisible(boolean)>
View.setVisible(boolean)
55 method to display the editor. - 4. Fire the
EditorListener.opened(javax.ide.editor.EditorEvent)
55 event.
closeEditor(javax.ide.editor.Editor)
55 method should be called
by clients to request closing an editor. When closing an editor the
editor manager performs the following tasks:
- 3. Call the
Editor.save(java.util.prefs.Preferences)
55 method to save the editor current state. - 1. Call the
Editor.close()
55 method. - 4. Fire the
EditorListener.closed(javax.ide.editor.EditorEvent)
55 event.
IDE service providers must provide a concrete implementation of this class.
Field Summary | |
private boolean |
_initializedHookListeners
|
private java.util.Map |
_listenerMap
Map of String:List. |
Fields inherited from class javax.ide.Service |
|
Constructor Summary | |
EditorManager()
|
Method Summary | |
void |
addEditorListener(EditorListener listener,
java.lang.String editorClass)
Add an EditorListener. |
abstract void |
closeEditor(Editor editor)
Close the specified Editor. |
protected void |
fireEditorActivated(Editor editor)
Notifies all editor listeners that the specified editor was activated. |
protected void |
fireEditorClosed(Editor editor)
Notifies all editor listeners that the specified editor was closed. |
protected void |
fireEditorDeactivated(Editor editor)
Notifies all editor listeners that the specified editor was deactivated. |
protected void |
fireEditorOpened(Editor editor)
Notifies all editor listeners that the specified editor was opened. |
abstract Editor |
getActiveEditor()
Returns the Editor that is currently active. |
static EditorManager |
getEditorManager()
Get the editor manager implementation for this IDE. |
private java.util.Collection |
getListeners(Editor editor)
|
private void |
initializeHookListeners()
|
abstract Editor |
openEditor(javax.ide.command.Context context,
java.lang.String typeID)
Opens a document in the editor identified by the given editor type identifier. |
void |
removeEditorListener(EditorListener l,
java.lang.String editorClass)
Remove an EditorListener. |
Methods inherited from class javax.ide.Service |
getService, initialize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
_listenerMap
private final java.util.Map _listenerMap
- Map of String:List. Keys are ids of editor types, values are lists of
EditorListener.
_initializedHookListeners
private boolean _initializedHookListeners
Constructor Detail |
EditorManager
public EditorManager()
Method Detail |
getActiveEditor
public abstract Editor getActiveEditor()
- Returns the Editor that is currently active.
openEditor
public abstract Editor openEditor(javax.ide.command.Context context, java.lang.String typeID)
- Opens a document in the editor identified by the given editor
type identifier. If
type
is null, the IDE will open the document with the most appropriate editor.If the document is already open using that editor, the editor will be made active.
closeEditor
public abstract void closeEditor(Editor editor)
- Close the specified Editor.
addEditorListener
public final void addEditorListener(EditorListener listener, java.lang.String editorClass)
- Add an EditorListener.
removeEditorListener
public final void removeEditorListener(EditorListener l, java.lang.String editorClass)
- Remove an EditorListener.
getListeners
private final java.util.Collection getListeners(Editor editor)
fireEditorOpened
protected final void fireEditorOpened(Editor editor)
- Notifies all editor listeners that the specified editor was
opened.
fireEditorClosed
protected final void fireEditorClosed(Editor editor)
- Notifies all editor listeners that the specified editor was
closed.
fireEditorActivated
protected final void fireEditorActivated(Editor editor)
- Notifies all editor listeners that the specified editor was
activated.
fireEditorDeactivated
protected final void fireEditorDeactivated(Editor editor)
- Notifies all editor listeners that the specified editor was
deactivated.
initializeHookListeners
private void initializeHookListeners()
getEditorManager
public static EditorManager getEditorManager()
- Get the editor manager implementation for this IDE.
|
|||||||||
Home >> All >> javax >> ide >> [ editor overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |