コード例 #1
0
 /**
  * Sets the selected value for the <code>CollapsiblePaneGroup</code>. Only one pane in the group
  * may be selected at a time.
  *
  * @param pane the <code>CollapsiblePane</code>
  * @param selected <code>true</code> if this pane is to be selected, otherwise <code>false</code>
  */
 public void setSelected(CollapsiblePane pane, boolean selected) {
   if (selected && pane != null && pane != _selection) {
     CollapsiblePane oldSelection = _selection;
     _selection = pane;
     if (oldSelection != null) {
       oldSelection.setEmphasized(false);
     }
     pane.setEmphasized(true);
   }
 }
コード例 #2
0
 public void propertyChange(PropertyChangeEvent evt) {
   if (Boolean.TRUE.equals(evt.getNewValue())) {
     for (CollapsiblePane p : getCollapsiblePanes()) {
       if (p != evt.getSource()) {
         p.setEmphasized(false);
       }
     }
   }
 }
コード例 #3
0
  /**
   * Adds the CollapsiblePane to the group.
   *
   * @param pane the pane to be added
   */
  public void add(CollapsiblePane pane) {
    if (pane == null) {
      return;
    }
    _panes.add(pane);
    pane.addPropertyChangeListener(CollapsiblePane.EMPHASIZED_PROPERTY, this);

    if (pane.isEmphasized()) {
      if (_selection == null) {
        _selection = pane;
      } else {
        pane.setEmphasized(false);
      }
    }
  }