toggleSelection(treePath);
return true;
}
protected void toggleSelection(TreePath selPath) {
HierarchyTreeNode node =
(HierarchyTreeNode) selPath.getLastPathComponent();
// toggle current selection status.
boolean isSelected = unselectedNodes.contains(node);
setSelectionStatusRecursive(node, isSelected);
if (!isSelected) {
while (true) {
node = (HierarchyTreeNode) node.getParent();
if (node == null) break;
setSelectionStatus(node, false);
}
}
}