How can I find the currently open document in the selected editor?
JTextComponent ed = org.netbeans.api.editor.EditorRegistry.lastFocusedComponent();
Document doc = ed.getDocument();
JTextComponent ed = org.netbeans.api.editor.EditorRegistry.lastFocusedComponent();
Document doc = ed.getDocument();