* allow sequence multi-selection

This commit is contained in:
Reinhard Pointner 2012-07-15 07:46:43 +00:00
parent 53f6b531fb
commit 80e6b9ef1a
1 changed files with 6 additions and 4 deletions

View File

@ -141,7 +141,7 @@ class HistoryDialog extends JDialog {
pane.add(content, "grow");
// initialize selection modes
sequenceTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
sequenceTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
elementTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
// bind element model to selected sequence
@ -153,9 +153,11 @@ class HistoryDialog extends JDialog {
return;
if (sequenceTable.getSelectedRow() >= 0) {
int index = sequenceTable.convertRowIndexToModel(sequenceTable.getSelectedRow());
elementModel.setData(sequenceModel.getRow(index).elements());
List<Element> elements = new ArrayList<Element>();
for (int row : sequenceTable.getSelectedRows()) {
elements.addAll(sequenceModel.getRow(sequenceTable.convertRowIndexToModel(row)).elements());
}
elementModel.setData(elements);
}
}
});