Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.ide.editor
Class EditorManager  view EditorManager download EditorManager.java

java.lang.Object
  extended byjavax.ide.Service
      extended byjavax.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:

Similarly, the editor manager 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:

Extensions that need to know when editors are opened, closed, activated, and/or deactivated can add EditorListeners 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.


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.