@Override
      public void contentRemoved(@NotNull ContentManagerEvent event) {
        if (window.isDisposed() || window.toolWindowManager.getProject().isDisposed()) {
          return;
        }

        Content content = event.getContent();
        if (!Content.TEMPORARY_REMOVED_KEY.get(content, false)) {
          SingleContentSupplier.removeSubContentsOfContent(content, false);
        }

        content.removePropertyChangeListener(propertyChangeListener);
        getCurrentLayout().contentRemoved(event);
        ensureSelectedContentVisible();
        rebuild();

        if (contentManager.isEmpty() &&
            contentManager == window.getContentManager() &&
            !Content.TEMPORARY_REMOVED_KEY.get(content, false)) {
          boolean removeFromStripe;
          if (window.isToHideOnEmptyContent()) {
            removeFromStripe = true;
          }
          else if (window.canCloseContents() && StatusText.getDefaultEmptyText().equals(window.getEmptyText().getText())) {
            removeFromStripe = false;
          }
          else {
            return;
          }
          window.toolWindowManager
            .hideToolWindow(window.getId(), /* hideSide = */ false, /* moveFocus = */ true, removeFromStripe, /* source = */ null);
        }
      }
@Override
      public void contentRemoved(@NotNull ContentManagerEvent event)