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. When the editor is moved (for example, to another split or to a different tab group), I need to transfer the state from old editor to the new one. An editor state is preserved in IntelliJ only if either of the following conditions are met (Please see: intellij-community/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorHistoryManager.kt at 6e43b3144cc2a4b244c0bfcc5e7bdfa3c9a131e2 · JetBrains/intellij-community · GitHub):
-
The
VirtualFileused to render the WebView is an instance of theOptionallyIncludedinterface, or -
The
VirtualFilephysically exists in the file system.
The problem I am facing is that, IntelliJ marked OptionallyIncluded interface as internal. So, I cannot use that. And since I am loading a JCEF component inside the editor by attaching it to a VirtualFile, it does not physically exists in the FileSystem.
Is there any work around for this?