Hi Santosh,
That's good. So, if you have a TreeBranch object, you can get
the leaf nodes under it this way (since TreeBranch implements the
Sequence<TreeNode> and Iterable<TreeNode> interfaces:
TreeBranch branch = ... however you got it
for (TreeNode leaf : branch) {
.... process the "leaf"
}
Then, to select the leaf node from Java, you would need to get the path
of the node (starting from the root) and then tell the TreeView to
select it, something like this:
treeView.clearSelection(); // assuming you want to select
just the leaf nodes under this branch
TreeBranch treeRoot = (TreeBranch)treeView.getTreeData();
for (TreeNode leaf : branch) {
Sequence.Tree.Path leafPath =
Sequence.Tree.pathOf(treeRoot, leaf);
treeView.addSelectedPath(leafPath);
}
HTH,
~Roger Whitcomb