private static void subscribeToolWindowTopic(@NotNull Project project) {
    if (project.isDisposed()) {
      return;
    }


    LOG.debug("subscribe for ToolWindow topic of project %s", project);
    MessageBusConnection pbc = project.getMessageBus().connect();
    pbc.subscribe(ToolWindowManagerListener.TOPIC, new ToolWindowManagerListener() {
      @Override
      public void toolWindowsRegistered(@NotNull List<String> ids, @NotNull ToolWindowManager toolWindowManager) {
        for (String id : ids) {
          final @Nullable Pair<Map<Long, ActionGroup>, Customizer> actions = ActionsLoader.getToolWindowActionGroup(id);
          if (actions == null || actions.first.get(0L) == null) {
            LOG.debug("null action group (or it doesn't contain main-layout) for tool window: %s", id);
            continue;
          }

          ToolWindow toolWindow = toolWindowManager.getToolWindow(id);
          if (toolWindow == null)
            continue;
          TouchBarsManager.register(toolWindow.getComponent(), actions.first, actions.second);
          LOG.debug("register tool-window '%s' for component: %s", id, toolWindow.getComponent());
        }
      }

      @Override
      public void toolWindowUnregistered(@NotNull String id, @NotNull ToolWindow toolWindow) {
        TouchBarsManager.unregister(toolWindow.getComponent());
      }
    });

    ourProjConnections.add(pbc);
  }
private static void subscribeToolWindowTopic(@NotNull Project project)