com.intellij.openapi.fileEditor
Interface FileEditor

All Superinterfaces:
UserDataHolder
All Known Subinterfaces:
DocumentsEditor, TextEditor

public interface FileEditor
extends UserDataHolder


Field Summary
static java.lang.String PROP_MODIFIED
           
static java.lang.String PROP_VALID
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes specified listener
 void deselectNotify()
          This method is invoked each time when the editor is deselected.
 BackgroundEditorHighlighter getBackgroundHighlighter()
           
 javax.swing.JComponent getComponent()
           
 FileEditorLocation getCurrentLocation()
          The method is optional.
 java.lang.String getName()
           
 javax.swing.JComponent getPreferredFocusedComponent()
          Returns component to be focused when editor is opened.
 FileEditorState getState(FileEditorStateLevel level)
           
 StructureViewBuilder getStructureViewBuilder()
           
 boolean isModified()
           
 boolean isValid()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds specified listener
 void selectNotify()
          This method is invoked each time when the editor is selected.
 void setState(FileEditorState state)
          Applies given state to the editor.
 
Methods inherited from interface com.intellij.openapi.util.UserDataHolder
getUserData, putUserData
 

Field Detail

PROP_MODIFIED

static final java.lang.String PROP_MODIFIED
See Also:
isModified(), Constant Field Values

PROP_VALID

static final java.lang.String PROP_VALID
See Also:
isValid(), Constant Field Values
Method Detail

getComponent

javax.swing.JComponent getComponent()
Returns:
component which represents editor in the UI. The method should never return null.

getPreferredFocusedComponent

javax.swing.JComponent getPreferredFocusedComponent()
Returns component to be focused when editor is opened. Method should never return null.


getName

java.lang.String getName()
Returns:
editor's name, a string that identifies editor among other editors. For example, UI form might have two editor: "GUI Designer" and "Text". So "GUI Designer" can be a name of one editor and "Text" can be a name of other editor. The method should never return null.

getState

FileEditorState getState(FileEditorStateLevel level)
Returns:
editor's internal state. Method should never return null.

setState

void setState(FileEditorState state)
Applies given state to the editor.

Parameters:
state - cannot be null

isModified

boolean isModified()
Returns:
whether the editor's content is modified in comparision with its file.

isValid

boolean isValid()
Returns:
whether the editor is valid or not. For some reasons editor can become invalid. For example, text editor becomes invalid when its file is deleted.

selectNotify

void selectNotify()
This method is invoked each time when the editor is selected. This can happen in two cases: editor is selected because the selected file has been changed or editor for the selected file has been changed.


deselectNotify

void deselectNotify()
This method is invoked each time when the editor is deselected.


addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes specified listener

Parameters:
listener - to be added

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds specified listener

Parameters:
listener - to be removed

getBackgroundHighlighter

BackgroundEditorHighlighter getBackgroundHighlighter()
Returns:
highlighter object to perform background analysis and highlighting activities. Return null if no background highlighting activity necessary for this file editor.

getCurrentLocation

FileEditorLocation getCurrentLocation()
The method is optional. Currently is used only by find usages subsystem

Returns:
the location of user focus. Typically it's a caret or any other form of selection start.

getStructureViewBuilder

StructureViewBuilder getStructureViewBuilder()