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

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

Introduction

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

Prototype

Object getValue();

Source Link

Document

Get the value associated with this node.

Usage

From source file:com.google.code.tree.client.UpdatableTreeModel.java

License:Apache License

private NodeChildToClose searchTreeNode(TreeNode parent, UpdatableTreeNode nodeToCheck) {
    int childCount = parent.getChildCount();
    for (int idx = 0; idx < childCount; idx++) {
        boolean leaveOpen = parent.isChildOpen(idx);
        TreeNode node = parent.setChildOpen(idx, true, false);
        if (!leaveOpen)
            parent.setChildOpen(idx, false, false);
        if (node != null) {
            UpdatableTreeNode utn = (UpdatableTreeNode) node.getValue();
            NodeChildToClose nctc = null;
            if (nodeToCheck.getParent() == utn) {
                nctc = new NodeChildToClose();
                nctc.node = parent;/*w ww.j  a v a2  s  .c  o m*/
                nctc.childIndex = idx;
                return nctc;
            } else {
                if (node.getChildCount() > 0) {
                    nctc = searchTreeNode(node, nodeToCheck);
                    if (nctc != null)
                        return nctc;
                }
            }
        }
    }
    return null;
}

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

License:Open Source License

public void updateNodeChildrenForRemove(final String resource) {
    GWT.log("********************************");
    GWT.log("[UPDATENODECHILDREN]" + resource);
    GWT.log("********************************");
    boolean updated = false;
    TreeNode node = null;
    TreeNode sharedNode = null;//from w ww .  j av  a 2 s.c om
    if (tree.getRootTreeNode().isChildOpen(0)) {
        node = utils.getNodeContainingResource2(tree.getRootTreeNode().setChildOpen(0, true), resource);
    }
    GWT.log("CHECK NODE1:" + node + " " + resource);

    if (tree.getRootTreeNode().isChildOpen(2)) {
        GWT.log("CHECK NODE2:" + node);
        if (node == null)
            node = utils.getNodeContainingResource2(tree.getRootTreeNode().setChildOpen(2, true), resource);

    }
    if (node == null)
        if (tree.getRootTreeNode().isChildOpen(3)) {
            GWT.log("CHECK NODE3:" + node);
            node = utils.getNodeContainingResource2(tree.getRootTreeNode().setChildOpen(3, true), resource);
        }
    if (node != null && node.getValue() instanceof RestResourceWrapper) {
        GWT.log("*********************"
                + ((RestResourceWrapper) node.getValue()).getResource().getFolders().size());
        RestResourceWrapper wrapper = (RestResourceWrapper) node.getValue();
        if (wrapper.getResource().countNotDeletedSubfolders() == 1
                || wrapper.getResource().countNotDeletedSubfolders() == 0) {
            updateNodeChildren(((RestResourceWrapper) node.getValue()).getResource().getParentURI());
            if (((RestResourceWrapper) node.getValue()).getResource().getParentURI()
                    .equals(myFolders.getUri())) {
                if (utils.doesSharedNodeContainsResourceIn1stLevel(resource)
                        || utils.doesSharedNodeContainsResourceIn2ndLevel(resource)) {
                    updateMySharedNode();
                }
            }

        } else
            updateNodeChildren(((RestResource) node.getValue()).getUri());
        return;
    }
    updateNodeChildren(resource);
}

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();
        }/*www .  j  a  v  a 2 s  . c om*/
    }
    return null;
}