pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Programmatically adding/removing TreeView's nodes?
Date Thu, 04 Feb 2010 00:52:38 GMT
Hi Stuart,

TreeView uses an implementation of the org.apache.pivot.collections.List interface as a model.
Nested Lists represent branches, and non-lists represent leaves. So, you can simply use the
List methods to add and remove tree nodes.

How nodes are presented is up to the TreeView's renderer. Pivot includes a default renderer
called TreeViewNodeRenderer that is capable of presenting instances of org.apache.pivot.wtk.content.TreeNode.
This class represents a leaf and provides text and icon properties. A subclass, TreeBranch,
implements the List interface and serves as a branch. However, you can easily define your
own renderer and leaf/branch classes if you prefer.


On Feb 3, 2010, at 7:21 PM, Stuart White wrote:

> I am new to Pivot and am struggling to understand how I
> programmatically add/remove a TreeView's nodes.  Can someone point me
> to some example code demonstrating this?  Thanks!

View raw message