private void addToolwindowPositionListener(Project project) {
    MessageBusConnection busConnection = project.getMessageBus().connect(this);
    busConnection.subscribe(ToolWindowManagerListener.TOPIC, new ToolWindowManagerListener() {
      @Override
      public void stateChanged(@NotNull ToolWindowManager toolWindowManager) {
        ToolWindow consoleToolWindow = PythonConsoleToolWindow.getInstance(project).getToolWindow();
        if (myIsToolwindowHorizontal != isToolwindowHorizontal(consoleToolWindow)) {
          myIsToolwindowHorizontal = !myIsToolwindowHorizontal;
          if (isShowVars) {
            restoreWindow();
            ConsoleCommunication communication = getFile().getCopyableUserData(CONSOLE_COMMUNICATION_KEY);
            if (communication instanceof PydevConsoleCommunication) {
              showVariables((PydevConsoleCommunication)communication);
            }
          }
        }
      }
    });
  }
private void addToolwindowPositionListener(Project project)