@Override
      public void contentRemoved(@NotNull ContentManagerEvent e) {
        if ((!(toolWindow instanceof ToolWindowEx)
             || ApplicationManager.getApplication().isHeadlessEnvironment()
             || !((ToolWindowEx)toolWindow).getDecorator().isSplitUnsplitInProgress())
            && contentManager.isEmpty()) {
          toolWindow.setAvailable(false);
        }
      }
@Override
      public void contentRemoved(@NotNull ContentManagerEvent e)