Exemple #1
0
 public void unpinTabs() {
   for (int i = 0; i < this.getTabCount(); i++) {
     Component tabCom = this.getTabComponentAt(i);
     if (tabCom != null && tabCom instanceof TabbedPanelTab && tabCom.isVisible()) {
       TabbedPanelTab jp = (TabbedPanelTab) tabCom;
       jp.setPinned(false);
       this.saveTabState(jp.getAbstractPanel());
     }
   }
 }
Exemple #2
0
 private void setCloseButtonStates() {
   // Hide all 'close' buttons except for the selected tab
   for (int i = 0; i < this.getTabCount(); i++) {
     Component tabCom = this.getTabComponentAt(i);
     if (tabCom != null && tabCom instanceof TabbedPanelTab) {
       TabbedPanelTab jp = (TabbedPanelTab) tabCom;
       jp.setEnabled(i == getSelectedIndex());
     }
   }
 }
Exemple #3
0
 /**
  * Temporarily lock/unlock the specified tab, eg if its active and mustnt be closed. Locked
  * (AbstractPanel) tabs will not have the pin/close tab buttons displayed
  *
  * @param panel
  * @param hideable
  */
 public void setTabLocked(AbstractPanel panel, boolean lock) {
   for (int i = 0; i < this.getTabCount(); i++) {
     Component tabCom = this.getTabComponentAt(i);
     if (tabCom != null && tabCom instanceof TabbedPanelTab && tabCom.isVisible()) {
       TabbedPanelTab jp = (TabbedPanelTab) tabCom;
       if (panel.equals(jp.getAbstractPanel())) {
         jp.setLocked(!lock);
       }
     }
   }
 }