How to open editor in another window
I have 3 open files, and I drag 1 file (using the editor tab) to another screen display. It now lives in its own window.
My plugin navigates open files, but when I want to navigate to this other file, its window does not receive focus.
So my question is, how do I achieve this?
Currently I have this code:
final VirtualFile file = getListManager().getSelectedFile();
if (file != null && file.isValid()) {
//new OpenFileDescriptor(mProject, file, 1, 0).navigateInEditor(mProject, false);
FileEditorManager.getInstance(mProject).openFile(file, true, true);
}
So, how to also give the proper window focus, when I open a file editor?
Please sign in to leave a comment.
If you're passing true to focusEditor and the editor window isn't focused, then it's a bug. I don't think there's much that you can do as a plugin developer, other than sending us a pull request with a fix.
I've looked at (and copied) code for the original Switcher.java in the method navigate(boolean).
My current code looks like this:
It works.. sometimes...
Should I take this to youtrack then?
It seems to work, now that I close the popup window before I call the.
So that's good :)