mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-27 16:57:49 +08:00
1.6 KiB
1.6 KiB
Editors
The Editors section overview.
This section covers working with text in the IntelliJ Platform editor:
Editors FAQ
How do I get the active editor instance?
Current select editor(s) can be queried from FileEditorManager
.
From an Action's DataContext
, use CommonDataKeys.EDITOR
.
For a given PSI Element, use PsiEditorUtil.findEditor()
How can I be notified about editor events?
Use project-level listener FileEditorManagerListener
or FileEditorManagerListener$Before
to be notified about all file open/closed/selection changed events.
How do I open an text editor for a "fake" file?
Create a LightVirtualFile
with the contents
and open it via FileEditorManager.openFile()
.