Hide "Count" column in HistoryDialog

This commit is contained in:
Reinhard Pointner 2016-08-10 19:37:27 +08:00
parent cf4314708a
commit 5818685e1f
1 changed files with 8 additions and 21 deletions

View File

@ -170,14 +170,10 @@ class HistoryDialog extends JDialog {
}); });
// clear sequence selection when elements are selected // clear sequence selection when elements are selected
elementTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { elementTable.getSelectionModel().addListSelectionListener(evt -> {
if (elementTable.getSelectedRow() >= 0) {
@Override // allow selected rows only in one of the two tables
public void valueChanged(ListSelectionEvent e) { sequenceTable.getSelectionModel().clearSelection();
if (elementTable.getSelectedRow() >= 0) {
// allow selected rows only in one of the two tables
sequenceTable.getSelectionModel().clearSelection();
}
} }
}); });
@ -718,17 +714,14 @@ class HistoryDialog extends JDialog {
case 1: case 1:
return "Name"; return "Name";
case 2: case 2:
return "Count";
case 3:
return "Date"; return "Date";
default:
return null;
} }
return null;
} }
@Override @Override
public int getColumnCount() { public int getColumnCount() {
return 4; return 3;
} }
@Override @Override
@ -744,12 +737,9 @@ class HistoryDialog extends JDialog {
case 1: case 1:
return String.class; return String.class;
case 2: case 2:
return Integer.class;
case 3:
return Date.class; return Date.class;
default:
return null;
} }
return null;
} }
@Override @Override
@ -760,12 +750,9 @@ class HistoryDialog extends JDialog {
case 1: case 1:
return getName(data.get(row)); return getName(data.get(row));
case 2: case 2:
return data.get(row).elements().size();
case 3:
return data.get(row).date(); return data.get(row).date();
default:
return null;
} }
return null;
} }
public Sequence getRow(int row) { public Sequence getRow(int row) {