* allow sequence multi-selection
This commit is contained in:
parent
53f6b531fb
commit
80e6b9ef1a
|
@ -141,7 +141,7 @@ class HistoryDialog extends JDialog {
|
||||||
pane.add(content, "grow");
|
pane.add(content, "grow");
|
||||||
|
|
||||||
// initialize selection modes
|
// initialize selection modes
|
||||||
sequenceTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
sequenceTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
elementTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
elementTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||||
|
|
||||||
// bind element model to selected sequence
|
// bind element model to selected sequence
|
||||||
|
@ -153,9 +153,11 @@ class HistoryDialog extends JDialog {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (sequenceTable.getSelectedRow() >= 0) {
|
if (sequenceTable.getSelectedRow() >= 0) {
|
||||||
int index = sequenceTable.convertRowIndexToModel(sequenceTable.getSelectedRow());
|
List<Element> elements = new ArrayList<Element>();
|
||||||
|
for (int row : sequenceTable.getSelectedRows()) {
|
||||||
elementModel.setData(sequenceModel.getRow(index).elements());
|
elements.addAll(sequenceModel.getRow(sequenceTable.convertRowIndexToModel(row)).elements());
|
||||||
|
}
|
||||||
|
elementModel.setData(elements);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue