Пример #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;
   }
 }