How to open document in the editor?



I would like my plugin to be able to open a file in the editor and make it the current document, if it's not already open. If it's already open, then just make it the current document (if it's not).

In other words, I need to execute the following actions:

1. Check if a file is already open in the editor.

2. Make a file the current document in the editor.

I searched the documentation, but I couldn't find information about open documents in the editor and how to execute the above actions. Any help would be greatly appreciated.

1 comment
Comment actions Permalink


Please see: com.intellij.openapi.fileEditor.OpenFileDescriptor


Please sign in to leave a comment.