How to get the content of the toolWindow in Pycharm?

Answered

I'm developing a plugin for Pycharm (2019.3.3) and I want to get the running result that appears in the Tool Window. I have read "Get current console output to work with" and "Read text from" Run "window", but my problem is that my plug-ins are loaded as follows:

public class MainComponent implements ProjectComponent {
  //Plug in loading
  private AnActionListener anActionListener = (AnActionListener) new ActionVisitor();

  @Override public void projectOpened() {
    System.out.println("projectOpened");
  }

  @Override public void projectClosed() {
    System.out.println("projectClosed");
  }

  @Override public void initComponent() { 
    MouseRun mr=new MouseRun();
    mr.start();
    ActionManager actionManager = ActionManager.getInstance();
    actionManager.addAnActionListener(anActionListener);
  }

  @Override public void disposeComponent() { 
    System.out.println("disposeComponent"); 
  } 
}


In this case, I don't know how to obtain the Project object.

1 comment
Comment actions Permalink

Hi,

Your use case is unclear, but according to the Components documentation page, you can't use ProjectComponent which is deprecated, so start with migrating to other plugin components.

0

Please sign in to leave a comment.