mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
if started from non-leaf then clear selection from sub-nodes while deselecting
This commit is contained in:
@@ -103,6 +103,15 @@ public class TreeSmartSelectProvider implements SmartSelectProvider<JTree> {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
//in case lead selection is not leaf
|
||||
if (paths.length == tree.getSelectionCount()) {
|
||||
for (TreePath path : paths) {
|
||||
tree.removeSelectionPath(path);
|
||||
}
|
||||
tree.addSelectionPath(leadSelection);
|
||||
tree.setLeadSelectionPath(leadSelection);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean hasCommonStart(TreePath path, TreePath leadSelection, int commonStartLength) {
|
||||
|
||||
Reference in New Issue
Block a user