Пример #1
0
  public void selectionChanged() {
    int[] selRows = dataTable.getSelectedRows();
    boolean hasSelection = (selRows != null && selRows.length != 0);
    removeAction.setEnabled(hasSelection);

    frame.setRemoveActionEnabled(this, hasSelection);
  }
Пример #2
0
  public void delete() {
    int[] selRows = dataTable.getSelectedRows();
    Set<InputFile> dataToRemove = new HashSet<InputFile>();
    for (int row : selRows) {
      dataToRemove.add(document.getInputFiles().get(row));
    }

    // TODO: would probably be a good idea to check if the user wants to remove the last file
    document.getInputFiles().removeAll(dataToRemove);
    document.fireDataChanged();

    if (document.getInputFiles().size() == 0) {
      // all data partitions removed so reset the taxa
      frame.setStatusMessage("No data loaded");
    }
  }