Ian writing a inspection Plugin for IntelliJ. For this Plugin I need access from ToolWindowFactory based class to current source code (cursor position etc.). Theres a way across the PSIManager, but only in AnAction derived classes, not for ToolWindowFactory derived classes. There are any Ideas?
Perhaps a com.intellij.openapi.editor.event.CaretListener would work? You can register it as follows to receive events for all open editors.
com.intellij.openapi.editor.EditorFactory.getInstance().getEventMulticaster().addCaretListener(myCaretListener);