public void setTabActionsAutoHide(final boolean autoHide) {
    if (myActionPanel == null || myActionPanel.isAutoHide() == autoHide) {
      return;
    }

    myActionPanel.setAutoHide(autoHide);
  }
  @Override
  public Dimension getPreferredSize() {
    final Dimension size = super.getPreferredSize();
    if (myActionPanel != null && !myActionPanel.isVisible()) {
      final Dimension actionPanelSize = myActionPanel.getPreferredSize();
      size.width += actionPanelSize.width;
    }

    final JBTabsPosition pos = myTabs.getTabsPosition();
    switch (pos) {
      case top:
      case bottom:
        size.height +=
            myTabs.isEditorTabs() ? TabsUtil.ACTIVE_TAB_UNDERLINE_HEIGHT : getSelectedOffset();
        break;
      case left:
      case right:
        size.width += getSelectedOffset();
        break;
    }

    return size;
  }
  private void invalidateIfNeeded() {
    if (myLabel.getRootPane() == null) return;

    Dimension d = myLabel.getSize();
    Dimension pref = myLabel.getPreferredSize();
    if (d != null && d.equals(pref)) {
      return;
    }

    setInactiveStateImage(null);

    myLabel.invalidate();

    if (myActionPanel != null) {
      myActionPanel.invalidate();
    }

    myTabs.revalidateAndRepaint(false);
  }
 public void setActionPanelVisible(boolean visible) {
   if (myActionPanel != null) {
     myActionPanel.setVisible(visible);
   }
 }
 public void toggleShowActions(boolean show) {
   if (myActionPanel != null) {
     myActionPanel.toggleShowActions(show);
   }
 }
 public boolean updateTabActions() {
   return myActionPanel != null && myActionPanel.update();
 }
 private void removeOldActionPanel() {
   if (myActionPanel != null) {
     myActionPanel.getParent().remove(myActionPanel);
     myActionPanel = null;
   }
 }