mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
optimization to make 'select all' available for tree tables: merge select events as they were in table
This commit is contained in:
@@ -28,8 +28,10 @@ import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EventObject;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -283,15 +285,19 @@ public class TreeTable extends JBTable {
|
||||
|
||||
clearSelection();
|
||||
if (min != -1 && max != -1) {
|
||||
List<TreePath> selectionPaths = new ArrayList<TreePath>();
|
||||
for (int counter = min; counter <= max; counter++) {
|
||||
if (listSelectionModel.isSelectedIndex(counter)) {
|
||||
TreePath selPath = myTree.getPathForRow(counter);
|
||||
|
||||
if (selPath != null) {
|
||||
addSelectionPath(selPath);
|
||||
selectionPaths.add(selPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!selectionPaths.isEmpty()) {
|
||||
addSelectionPaths(selectionPaths.toArray(new TreePath[selectionPaths.size()]));
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
|
||||
Reference in New Issue
Block a user