Momo
Momo

Reputation: 2491

How to walk through a CellTree in GWT

I have a simple question: Is there is any way to walk through a celltree without using node.setChildOpen(i, true)?

I have this code sample:

public void find(TreeNode node) {
    for (int i = 0; i < node.getChildCount(); i++) {
        if (!node.isChildLeaf(i)) {
            find(node.setChildOpen(i, true));
        }
    }
}

Thanks

EDIT

I posted the complete code here How to get the path of a selected item from a CellTree in GWT

Upvotes: 2

Views: 1375

Answers (1)

&#220;mit
&#220;mit

Reputation: 17499

No, you have to use recursion to traverse through the CellTree Nodes.

Upvotes: 1

Related Questions