You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by coder java <co...@gmail.com> on 2011/12/19 11:05:17 UTC
TreeView
Hi,
I just follow the Tree View example in svn .
I need to update the content dynamically . Any one please give some idea
how i can do it ?
Thanks in advance
Regards
Sony John
Re: TreeView
Posted by Sandro Martini <sa...@gmail.com>.
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
Re: TreeView
Posted by coder java <co...@gmail.com>.
Hi Sandro ,
I was looking on the example ,
i trying to loop through all treeview elements ,But iam not able to get all
tree node as follows .
could you please help
List<?> sf = treeView1.getTreeData();
for(Object obj : sf)
{
TreeBranch branch = (TreeBranch) obj;
System.out.println(branch.getText());
for(int i=0; i<branch.getLength(); i++)
{
System.out.println(branch.get(i).getText());
}
//System.out.println(branch.get(0).getText());
//System.out.println(tree.toString());
}
On Mon, Dec 19, 2011 at 9:22 PM, Sandro Martini <sa...@gmail.com>wrote:
> Hi,
> under the tests subproject (in trunk) you can find some minimal sample
> of different usage of TreeView in this package:
> org.apache.pivot.tests.issues
>
> Note that they are our minimal tests to look at related JIRA issues
> (some resolved, others not) ...
>
> Bye
>
Re: TreeView
Posted by Sandro Martini <sa...@gmail.com>.
Hi,
under the tests subproject (in trunk) you can find some minimal sample
of different usage of TreeView in this package:
org.apache.pivot.tests.issues
Note that they are our minimal tests to look at related JIRA issues
(some resolved, others not) ...
Bye
Re: TreeView
Posted by Greg Brown <gk...@verizon.net>.
Since tree data is just composed of nested Lists, you can use any method in the List interface to modify the structure.
G
On Dec 19, 2011, at 5:05 AM, coder java wrote:
> Hi,
> I just follow the Tree View example in svn .
> I need to update the content dynamically . Any one please give some idea how i can do it ?
> Thanks in advance
> Regards
> Sony John
>