Example usage for com.google.gwt.user.cellview.client TreeNode getParent

List of usage examples for com.google.gwt.user.cellview.client TreeNode getParent

Introduction

In this page you can find the example usage for com.google.gwt.user.cellview.client TreeNode getParent.

Prototype

TreeNode getParent();

Source Link

Document

Get the parent node of this node.

Usage

From source file:org.gss_project.gss.web.client.CellTreeView.java

License:Open Source License

public OtherUserResource getOtherUserResourceOfOtherFolder(OthersFolderResource res) {
    TreeNode n = utils.getNodeContainingResource(tree.getRootTreeNode().setChildOpen(3, true), res);

    if (n != null) {
        if (n.getValue() instanceof OtherUserResource)
            return (OtherUserResource) n.getValue();
        TreeNode parent = n.getParent();

        while (parent != null) {
            if (parent.getValue() instanceof OtherUserResource)
                return (OtherUserResource) parent.getValue();
            parent = parent.getParent();
        }//from   w  ww . j ava 2s.c  o  m
    }
    return null;
}