示例#1
0
  public void setTabActionsAutoHide(final boolean autoHide) {
    if (myActionPanel == null || myActionPanel.isAutoHide() == autoHide) {
      return;
    }

    myActionPanel.setAutoHide(autoHide);
  }
示例#2
0
  @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;
  }
示例#3
0
  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);
  }
示例#4
0
 public void setActionPanelVisible(boolean visible) {
   if (myActionPanel != null) {
     myActionPanel.setVisible(visible);
   }
 }
示例#5
0
 public void toggleShowActions(boolean show) {
   if (myActionPanel != null) {
     myActionPanel.toggleShowActions(show);
   }
 }
示例#6
0
 public boolean updateTabActions() {
   return myActionPanel != null && myActionPanel.update();
 }
示例#7
0
 private void removeOldActionPanel() {
   if (myActionPanel != null) {
     myActionPanel.getParent().remove(myActionPanel);
     myActionPanel = null;
   }
 }