예제 #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;
   }
 }