예제 #1
0
 public void cleanUp() {
   if (src != null) {
     src.removeListSelectionListener(selListener);
     src = null;
   }
   if (dst != null) {
     dst.removeListSelectionListener(selListener);
     dst = null;
   }
 }
  public void valueChanged(ListSelectionEvent e) {

    boolean isAdjusting = e.getValueIsAdjusting();
    if (isAdjusting) return;

    searchButton.setEnabled(
        ((networkSelectionModel.isSelectionEmpty()) && (localSelectionModel.isSelectionEmpty()))
            ? false
            : true);

    ListSelectionModel lsm = (ListSelectionModel) e.getSource();
    if (lsm == localSelectionModel) {
      networkSelectionModel.removeListSelectionListener(this);
      networkList.clearSelection();
      networkSelectionModel.addListSelectionListener(this);
      String localSelection = (String) localList.getSelectedValue();
      if (localSelection != null) {
        if ("local archive".equalsIgnoreCase(localSelection)) {
          rightPanelLayout.show(rPanel, SEARCH_RESULT_PANEL);
        } else if ("local directory".equalsIgnoreCase(localSelection)) {
          rightPanelLayout.show(rPanel, DIRECTORY_PANEL);
        }
        networkSelectionModel.clearSelection();
        resetSearchLabels();
      }
    } else if (lsm == networkSelectionModel) {
      rightPanelLayout.show(rPanel, SEARCH_RESULT_PANEL);
      localSelectionModel.removeListSelectionListener(this);
      localList.clearSelection();
      localSelectionModel.addListSelectionListener(this);
      updateSearchLabels((ImageServerNodeDescription) networkList.getSelectedValue());

    } else {
      if (lsm.isSelectionEmpty()) {
        if (e.getSource() == treeTable.getSelectionModel()) openArchiveButton.setEnabled(false);
        else openDirButton.setEnabled(false);
      } else {
        if (e.getSource() == treeTable.getSelectionModel()) openArchiveButton.setEnabled(true);
        else openDirButton.setEnabled(true);
      }
    }
  }
  /**
   * Sets the selection model for this <code>TableColumnModel</code> to <code>newModel</code> and
   * registers for listener notifications from the new selection model. If <code>newModel</code> is
   * <code>null</code>, an exception is thrown.
   *
   * @param newModel the new selection model
   * @exception IllegalArgumentException if <code>newModel</code> is <code>null</code>
   * @see #getSelectionModel
   */
  public void setSelectionModel(ListSelectionModel newModel) {
    if (newModel == null) {
      throw new IllegalArgumentException("Cannot set a null SelectionModel");
    }

    ListSelectionModel oldModel = selectionModel;

    if (newModel != oldModel) {
      if (oldModel != null) {
        oldModel.removeListSelectionListener(this);
      }

      selectionModel = newModel;
      newModel.addListSelectionListener(this);
    }
  }
예제 #4
0
 public void uninstall() {
   table = null;
   levels.removeSkillBonusListener(this);
   selectionModel.removeListSelectionListener(this);
 }
예제 #5
0
 public void uninstall() {
   selectionModel.removeListSelectionListener(this);
   sheetSupport.uninstall();
 }
예제 #6
0
 public void cleanUp() {
   if (lsm != null) {
     lsm.removeListSelectionListener(selListener);
   }
 }