public interface FileEditorProvider
EP_FILE_EDITOR_PROVIDER
.DumbAware
Modifier and Type | Field and Description |
---|---|
static ExtensionPointName<FileEditorProvider> |
EP_FILE_EDITOR_PROVIDER |
static Key<FileEditorProvider> |
KEY |
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.
|
default void |
disposeEditor(FileEditor editor)
Disposes the specified
editor . |
java.lang.String |
getEditorTypeId() |
FileEditorPolicy |
getPolicy() |
default FileEditorState |
readState(Element sourceElement,
Project project,
VirtualFile file)
Deserialize state from the specified
sourceElement . |
default void |
writeState(FileEditorState state,
Project project,
Element targetElement)
Serializes state into the specified
targetElement . |
static final ExtensionPointName<FileEditorProvider> EP_FILE_EDITOR_PROVIDER
static final Key<FileEditorProvider> KEY
boolean accept(Project project, VirtualFile file)
file
- file to be tested for acceptance.true
if provider can create valid editor for the specified file
.FileEditor createEditor(Project project, VirtualFile file)
This method is called only if the provider has accepted this file (i.e. method accept(Project, VirtualFile)
returned
true
).
The provider should return only valid editor.
default void disposeEditor(FileEditor editor)
editor
. It is guaranteed that this method is invoked only for editors
created with this provider.editor
- editor to be disposed.default FileEditorState readState(Element sourceElement, Project project, VirtualFile file)
sourceElement
.default void writeState(FileEditorState state, Project project, Element targetElement)
targetElement
.java.lang.String getEditorTypeId()
FileEditorPolicy getPolicy()
FileEditorPolicy.NONE
,
FileEditorPolicy.HIDE_DEFAULT_EDITOR
,
FileEditorPolicy.PLACE_BEFORE_DEFAULT_EDITOR