I am listening on changes in EditorRegistry where I can get which JTextComponent is currently selected. Anyone knows how can I get an EditorCookie or a DataObject for it?
JTextComponent jTextComponent = EditorRegistry.focusedComponent();
Document document = jTextComponent.getDocument();
And how can I get to which project does it belong?