We are developing a custom FileEditor that embeds a JCEF-based webview. The editor is linked to a VirtualFile and supports drag-and-drop (split) operations.
As part of proper lifecycle management, the webview is disposed to prevent memory leaks. While this resolves the memory concerns, it results in loss of editor state and breaks the split (drag-and-drop) functionality. We expect the split operation to retain the existing state.
I would like to understand:
-
What is the recommended lifecycle pattern for custom
FileEditorimplementations during split operations? -
Are editors expected to be recreated or reused when moved between splits?
-
How do JetBrains’ built-in editors (e.g., for
.javaor.xml) preserve their state in such cases? -
What is the recommended approach for handling heavy UI components like embedded browsers?
Any guidance, documentation references, or example implementations would be greatly appreciated.