Thanks Greg.

 

I think I'm on the right track, but I'm missing something clear I think.
Here is my snippet:

 

public void selectedPathsChanged(TreeView arg0, Sequence<Path> paths) {

Sequence.Tree<TreeNode> tree = new Sequence.Tree<TreeNode>();           

                        

for(int i, n=paths.getLength(); i < n; i++){

                        

TreeNode node = tree.get(paths, paths.get(i));

                              

}

 

I tried casting the tree.get() to a TreeNode, but that didn't work, as
the get is still bringing back a path.

 

David

 

From: Greg Brown [mailto:[email protected]] 
Sent: Tuesday, February 23, 2010 2:44 PM
To: [email protected]
Subject: Re: TreeViews, Nodes and Paths

 

Hi David, 

 

You can use the get() method of
org.apache.pivot.collections.Sequence.Tree to access your tree nodes by
path.

 

Greg

 

On Feb 23, 2010, at 3:33 PM, David McNelis wrote:





I have just changed a single select TreeView to a Multi, and am having
some issues.

 

Before I was able to use TreeView and the getSelectedNode() method, but
clearly that doesn't apply to this situation.

 

The getSelectedPaths() seems to be the logical direction to go, but how
to I retrieve the selected node(s) itself from there?  There is not a
getNode(Path) method and the getNodeAt(int) returns another path.

 

I'm I missing something obvious?  Or is this really not as
straightforward as it would seem.

 

Thanks in advance for any suggestions.

 

 

Reply via email to