private static void updateTabBar(@NotNull Object frameObject, int height) {
    JRootPane rootPane;
    if (frameObject instanceof JFrame) {
      rootPane = ((JFrame)frameObject).getRootPane();
    }
    else if (frameObject instanceof ProjectFrameHelper frameHelper) {
      rootPane = frameHelper.getFrame().getRootPane();
    }
    else {
      return;
    }

    if (rootPane == null) {
      return;
    }

    JComponent filler = (JComponent)rootPane.getClientProperty(WIN_TAB_FILLER);
    if (filler == null) {
      return;
    }

    if (height > 0) {
      height++;
    }

    boolean visible = height > 0;
    boolean oldVisible = filler.isVisible();
    filler.setVisible(visible);
    filler.setPreferredSize(new Dimension(-1, height)); // native header doesn't scale

    Container parent = filler.getParent();
    if (parent == null || oldVisible == visible) {
      return;
    }

    parent.doLayout();
    parent.revalidate();
    parent.repaint();
  }
private static void updateTabBar(@NotNull Object frameObject, int height)