pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandro Martini <sandro.mart...@gmail.com>
Subject Re: TreeView
Date Tue, 20 Dec 2011 11:17:46 GMT
Hi,
under tutorials (from the latest trunk), take a look at:
org.apache.pivot.tutorials.explorer.tools.EventLoggerSkin , and
ComponentExplorerWindow (from the Component Explorer Tutorial/Demo),
there are some methods/blocks to traverse a Tree, like this:

    public void selectAllEvents(boolean select) {
        List<TreeNode> treeData =
(List<TreeNode>)declaredEventsTreeView.getTreeData();

        ItemIterator<TreeNode> iter =
Sequence.Tree.depthFirstIterator(treeData);
        while(iter.hasNext()) {
            iter.next();
            declaredEventsTreeView.setNodeChecked(iter.getPath(), select);
        }
    }

the call to depthFirstIterator (used as descripted) should be good for
your case.

Tell me if you need more info.


Bye

Mime
View raw message