pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Piotrowski <rpiotrow...@azonic.net>
Subject Re: TreeViews, Nodes and Paths
Date Tue, 23 Feb 2010 21:11:24 GMT
http://pivot.apache.org/1.3/docs/api/org/apache/pivot/collections/Sequence.Tree.html#get%28org.apache.pivot.collections.Sequence,%20org.apache.pivot.collections.Sequence.Tree.Path%29




On Tue, Feb 23, 2010 at 3:08 PM, David McNelis <Dmcnelis@sharedmarketing.com
> wrote:

>  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:gkbrown@mac.com]
> *Sent:* Tuesday, February 23, 2010 2:44 PM
> *To:* user@pivot.apache.org
> *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.
>
>
>
>
>

Mime
View raw message