Restoring Non-Text Editors after a restart, What am I missing ?

I'm developing a embedded browser for Intelij using JxBrowser. I've made quite a bit of progress, I'm looking into restoring browser editors now. 

This is what I am trying.

* I open the browsers using a dummy VirtualFile containing the Url.

* The Browser Editor extends from FileEditor and has the getState and setState methods defined. getState returns the current url.

* The FileEditorProvider has read and write state methods. 

I have verified that the state persistence methods are being called, but upon reopening the IDE they aren't touched. I've tried to walk through the code to find out the semantics but I can't find the right code paths.

The code is available here (branch WIP). It's prototype quality :D. You need a JxBrowser license to run it (can get it from their website), I will apply for an open source license license soon.

What am I missing ? I am hoping it is something simple.

1 comment
Comment actions Permalink

I'm not sure what the problem is, but you can try to find it out by debugging. The code that is reopening files on IDE startup is in com.intellij.openapi.fileEditor.impl.EditorsSplitters.UIBuilder class. Leave just your editor opened before shutdown for simplicity, and then try to debug UIBuilder's processFiles method on startup.


Please sign in to leave a comment.