public class TextEditorProvider extends java.lang.Object implements DefaultPlatformFileEditorProvider, DumbAware
| Modifier and Type | Class and Description |
|---|---|
protected class |
TextEditorProvider.EditorWrapper |
| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
LOG |
EP_FILE_EDITOR_PROVIDER, KEY| Constructor and Description |
|---|
TextEditorProvider() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Project project,
VirtualFile file)
Method is expected to run fast.
|
FileEditor |
createEditor(Project project,
VirtualFile file)
Creates editor for the specified file.
|
protected TextEditorProvider.EditorWrapper |
createWrapperForEditor(Editor editor) |
static Document [] |
getDocuments(FileEditor editor) |
java.lang.String |
getEditorTypeId() |
static TextEditorProvider |
getInstance() |
FileEditorPolicy |
getPolicy() |
protected TextEditorState |
getStateImpl(Project project,
Editor editor,
FileEditorStateLevel level) |
TextEditor |
getTextEditor(Editor editor) |
static boolean |
isTextFile(VirtualFile file) |
FileEditorState |
readState(Element element,
Project project,
VirtualFile file)
Deserialize state from the specified
sourceElement. |
protected void |
setStateImpl(Project project,
Editor editor,
TextEditorState state,
boolean exactState) |
void |
writeState(FileEditorState _state,
Project project,
Element element)
Serializes state into the specified
targetElement. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisposeEditorprotected static final Logger LOG
public static TextEditorProvider getInstance()
public boolean accept(Project project, VirtualFile file)
FileEditorProvideraccept in interface FileEditorProviderfile - file to be tested for acceptance.true if provider can create valid editor for the specified file.public FileEditor createEditor(Project project, VirtualFile file)
FileEditorProvider
This method is called only if the provider has accepted this file (i.e. method FileEditorProvider.accept(Project, VirtualFile) returned
true).
The provider should return only valid editor.
createEditor in interface FileEditorProviderpublic FileEditorState readState(Element element, Project project, VirtualFile file)
FileEditorProvidersourceElement.readState in interface FileEditorProviderpublic void writeState(FileEditorState _state, Project project, Element element)
FileEditorProvidertargetElement.writeState in interface FileEditorProviderpublic java.lang.String getEditorTypeId()
getEditorTypeId in interface FileEditorProviderpublic FileEditorPolicy getPolicy()
getPolicy in interface FileEditorProviderFileEditorPolicy.NONE,
FileEditorPolicy.HIDE_DEFAULT_EDITOR,
FileEditorPolicy.PLACE_BEFORE_DEFAULT_EDITORpublic TextEditor getTextEditor(Editor editor)
protected TextEditorProvider.EditorWrapper createWrapperForEditor(Editor editor)
public static Document [] getDocuments(FileEditor editor)
protected TextEditorState getStateImpl(Project project, Editor editor, FileEditorStateLevel level)
public static boolean isTextFile(VirtualFile file)
protected void setStateImpl(Project project, Editor editor, TextEditorState state, boolean exactState)