@Override
      public void stateChanged(@NotNull ToolWindowManager toolWindowManager,
                               @NotNull ToolWindow affectedToolWindow,
                               @NotNull ToolWindowManagerEventType changeType) {
        if (lastChangeType == changeType || !affectedToolWindow.getId().equals(toolWindow.getId())) return;
        lastChangeType = changeType;
        if (lastChangeType == ToolWindowManagerEventType.ActivateToolWindow && affectedToolWindow.getContentManager().getContentCount() == 0) {
          PydevConsoleRunner runner = PythonConsoleRunnerFactory.getInstance().createConsoleRunner(myProject, null);
          runner.run(true);
        }
      }
@Override
      public void stateChanged(@NotNull ToolWindowManager toolWindowManager,
                               @NotNull ToolWindow affectedToolWindow,
                               @NotNull ToolWindowManagerEventType changeType)