|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
javax.ide.Service
javax.ide.editor.EditorManager
public abstract class EditorManager
The EditorManager
manages the life cycle of Editor
s. 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 Document
. When clients request to open an editor on a specific document, the editor manager performs the following tasks:
Editor.open(javax.ide.command.Context)
method passing the appropriate context.Editor.restore(java.util.prefs.Preferences)
method to restore any previously saved editor state.View.setVisible(boolean)
method to display the editor.EditorListener.opened(javax.ide.editor.EditorEvent)
event.Similarly, the editor manager closeEditor(javax.ide.editor.Editor)
method should be called by clients to request closing an editor. When closing an editor the editor manager performs the following tasks:
Editor.save(java.util.prefs.Preferences)
method to save the editor current state.Editor.close()
method.EditorListener.closed(javax.ide.editor.EditorEvent)
event.Extensions that need to know when editors are opened, closed, activated, and/or deactivated can add EditorListener
s to the editor manager. Listener implementations are declared in the editor-listener section of the extension manifest.
IDE service providers must provide a concrete implementation of this class.
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. |
abstract java.util.Set |
getAllOpenEditors() Returns all currently open editors. |
static EditorManager |
getEditorManager() Get the editor manager implementation for this IDE. |
java.util.Set |
getOpenEditors(Document document) Get all open editors on a specific document. |
boolean |
isOpen(Document document) Get whether the specified document is open. |
abstract Editor |
openEditor(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, resetAllServices |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EditorManager()
Method Detail |
---|
public abstract Editor getActiveEditor()
public abstract java.util.Set getAllOpenEditors()
public boolean isOpen(Document document)
document
- a document. Must not be null.public java.util.Set getOpenEditors(Document document)
document
- a document instance. Must not be null.public abstract Editor openEditor(Context context, java.lang.String typeID)
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.
context
- the context to open an editor for. Must not be null.typeID
- the id of an editor type to open the context document in. If null, the IDE will open the document with the default editor.java.lang.UnsupportedOperationException
- when the document cannot be opened by any editor.public abstract void closeEditor(Editor editor)
Editor
.editor
- The editor to be closed. Must not be null.public final void addEditorListener(EditorListener listener, java.lang.String editorClass)
EditorListener
.listener
- the EditorListener
to add. Must not be null.editorClass
- Only events for this class of editor will be dispatched to the specified listener. May be null, indicating that all editor events will be dispatched.public final void removeEditorListener(EditorListener l, java.lang.String editorClass)
EditorListener
.l
- The EditorListener
to remove.editorClass
- The class of editors from which listener should be removed. May be null, indicating that all editor events will be dispatched.protected final void fireEditorOpened(Editor editor)
editor
- the editor which was opened.protected final void fireEditorClosed(Editor editor)
editor
- the editor which was closed.protected final void fireEditorActivated(Editor editor)
editor
- the editor which was activated.protected final void fireEditorDeactivated(Editor editor)
editor
- the editor which was deactivated.public static EditorManager getEditorManager()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |