private void setupListeners() {
      myContentManager.addContentManagerListener(this);
      ProjectManager.getInstance().addProjectManagerListener(myProject, this);

      Disposer.register(myContent, () -> {
        myContentManager.removeContentManagerListener(this);
        ProjectManager.getInstance().removeProjectManagerListener(myProject, this);
      });
    }
private void setupListeners()