I’m working on a JetBrains plugin where I open a custom editor tab that renders a web page using JCEF. This is done by attaching a VirtualFile to the editor, which then loads the JCEF browser component inside the editor tab.
The problem I’m encountering is related to editor tab movement. When the editor is moved (for example, to another split or to a different tab group), it appears that the original editor is disposed and a new instance of the editor is created. As a result, the state associated with the JCEF component is lost.
I need a way to persist the state of the old editor and restore it in the new editor instance that replaces it.
-
How can I persist custom state from the outgoing editor and pass it to the new editor instance?
-
Are there any examples or patterns that demonstrate state handover for editor components?
Any guidance, suggestions, or code snippets would be greatly appreciated!