pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bartlett <cbartlet...@gmail.com>
Subject Re: How do I update a node in a TreeView when it has no parent?
Date Tue, 07 Jun 2011 07:41:42 GMT

I'm not totally sure that I understand your problem, but the following might

The root nodes of a TreeView are simply the elements of the List that the
TreeView uses as its data model which is accessible via

If you are looking to treat the root nodes in the same way as any other
node, I think you should be able to use a TreeBranch as the root node (as it
implements org.apache.pivot.collections.List<TreeNode>). This assumes that
you are using the provided org.apache.pivot.wtk.content.TreeBranch and
org.apache.pivot.wtk.content.TreeNode classes rather than custom ones.


On 7 June 2011 14:17, Edvin Syse <edvin@sysedata.no> wrote:

> Updating a node that has a parent, even changing it from a TreeNode to a
> BranchNode is trivial via det node.getParent().update() method. But when a
> node is at the root of the hierarchy, I don't have a parent to call update
> on. I guess I need to invoke some listener on the TreeView itselv, but how?
> :)
> -- Edvin

View raw message