Embedding PsiAwareTextEditorImpl in a tool window.

Hi,


I'm trying to embed an instance of PsiAwareTextEditorImpl into a tool window! It works and all features of the editor look fine. However, breakpoints cannot be set. The reason seems to be that BreakpointManager.isFromMyProject(...) retrurns false to this editor. And it returns false because FileEditorManager.getInstance(myProject).getAllEditors() does not include my editor. And that's beacause my editor in not in the main splitter or in a dockable splitter. Is there a way out of this? How can I get my editor to be considered part of my project?
All suggestions are appreaciate!


Thanks,
Dumitru.

Here's how I embed the editor.

public class TesterFactory implements ToolWindowFactory {
  public void createToolWindowContent(Project project, ToolWindow toolWindow) {
    LightVirtualFile virtualFile = new LightVirtualFile("Foo.gs", GosuClassFileType.instance(), "");
    FileEditor editor = PsiAwareTextEditorProvider.getInstance().createEditor(project, virtualFile);
    JComponent component = editor.getComponent();
    toolWindow.getComponent().add(component);
  }
}

1 comment
Comment actions Permalink

Never mind. I answered my own question. You just have to embed the editor such that it is part of the main IDE window (I originally put in in a dialog) and then everything just works!

0

Please sign in to leave a comment.