com.intellij.openapi.editor
Class EditorFactory

java.lang.Object
  extended by com.intellij.openapi.editor.EditorFactory
All Implemented Interfaces:
ApplicationComponent, BaseComponent

public abstract class EditorFactory
extends java.lang.Object
implements ApplicationComponent

Provides services for creating document and editor instances.


Constructor Summary
EditorFactory()
           
 
Method Summary
abstract  void addEditorFactoryListener(EditorFactoryListener listener)
          Registers a listener for receiving notifications when editor instances are created and released.
abstract  Document createDocument(char[] text)
          Creates a document from the specified text specified as an array of characters.
abstract  Document createDocument(java.lang.CharSequence text)
          Creates a document from the specified text specified as a character sequence.
abstract  Editor createEditor(Document document)
          Creates an editor for the specified document.
abstract  Editor createEditor(Document document, Project project)
          Creates an editor for the specified document associated with the specified project.
abstract  Editor createViewer(Document document)
          Creates a read-only editor for the specified document.
abstract  Editor createViewer(Document document, Project project)
          Creates a read-only editor for the specified document associated with the specified project.
abstract  Editor[] getAllEditors()
          Returns the list of all currently open editors.
abstract  Editor[] getEditors(Document document)
          Returns the list of all editors for the specified document.
abstract  Editor[] getEditors(Document document, Project project)
          Returns the list of editors for the specified document associated with the specified project.
abstract  EditorEventMulticaster getEventMulticaster()
          Returns the service for attaching event listeners to all editor instances.
static EditorFactory getInstance()
          Returns the editor factory instance.
abstract  void refreshAllEditors()
          Reloads the editor settings and refrehes all currently open editors.
abstract  void releaseEditor(Editor editor)
          Disposes of the specified editor instance.
abstract  void removeEditorFactoryListener(EditorFactoryListener listener)
          Unregisters a listener for receiving notifications when editor instances are created and released.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.intellij.openapi.components.BaseComponent
disposeComponent, getComponentName, initComponent
 

Constructor Detail

EditorFactory

public EditorFactory()
Method Detail

getInstance

public static EditorFactory getInstance()
Returns the editor factory instance.

Returns:
the editor factory instance.

createDocument

@NotNull
public abstract Document createDocument(java.lang.CharSequence text)
Creates a document from the specified text specified as a character sequence.

Parameters:
text - the text to create the document from.
Returns:
the document instance.

createDocument

@NotNull
public abstract Document createDocument(char[] text)
Creates a document from the specified text specified as an array of characters.

Parameters:
text - the text to create the document from.
Returns:
the document instance.

createEditor

public abstract Editor createEditor(Document document)
Creates an editor for the specified document.

Parameters:
document - the document to create the editor for.
Returns:
the editor instance.
See Also:
releaseEditor(Editor)

createViewer

public abstract Editor createViewer(Document document)
Creates a read-only editor for the specified document.

Parameters:
document - the document to create the editor for.
Returns:
the editor instance.
See Also:
releaseEditor(Editor)

createEditor

public abstract Editor createEditor(Document document,
                                    @Nullable
                                    Project project)
Creates an editor for the specified document associated with the specified project.

Parameters:
document - the document to create the editor for.
project - the project with which the editor is associated.
Returns:
the editor instance.
See Also:
Editor.getProject(), releaseEditor(Editor)

createViewer

public abstract Editor createViewer(Document document,
                                    @Nullable
                                    Project project)
Creates a read-only editor for the specified document associated with the specified project.

Parameters:
document - the document to create the editor for.
project - the project with which the editor is associated.
Returns:
the editor instance.
See Also:
Editor.getProject(), releaseEditor(Editor)

releaseEditor

public abstract void releaseEditor(Editor editor)
Disposes of the specified editor instance.

Parameters:
editor - the editor instance to release.

getEditors

public abstract Editor[] getEditors(Document document,
                                    @Nullable
                                    Project project)
Returns the list of editors for the specified document associated with the specified project.

Parameters:
document - the document for which editors are requested.
project - the project with which editors should be associated, or null if any editors for this document should be returned.
Returns:
the list of editors.

getEditors

public abstract Editor[] getEditors(Document document)
Returns the list of all editors for the specified document.

Parameters:
document - the document for which editors are requested.
Returns:
the list of editors.

getAllEditors

public abstract Editor[] getAllEditors()
Returns the list of all currently open editors.

Returns:
the list of editors.

addEditorFactoryListener

public abstract void addEditorFactoryListener(EditorFactoryListener listener)
Registers a listener for receiving notifications when editor instances are created and released.

Parameters:
listener - the listener instance.

removeEditorFactoryListener

public abstract void removeEditorFactoryListener(EditorFactoryListener listener)
Unregisters a listener for receiving notifications when editor instances are created and released.

Parameters:
listener - the listener instance.

getEventMulticaster

@NotNull
public abstract EditorEventMulticaster getEventMulticaster()
Returns the service for attaching event listeners to all editor instances.

Returns:
the event multicaster instance.

refreshAllEditors

public abstract void refreshAllEditors()
Reloads the editor settings and refrehes all currently open editors.