Package com.google.gwt.dev.js

Examples of com.google.gwt.dev.js.FlatteningVisitor$TreeNode


    private TreeModelBase     _treeModel;
    private HtmlTree          _tree;

    public TreeNode getTreeData()
    {
        TreeNode treeData = new TreeNodeBase("foo-folder", "Inbox", false);

        // construct a set of fake data (normally your data would come from a database)

        // populate Frank's portion of the tree
        TreeNodeBase personNode = new TreeNodeBase("person", "Frank Foo", false);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo", false));
        TreeNodeBase folderNode = new TreeNodeBase("foo-folder", "Requires Foo Reviewer", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "X050001", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "X050002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "X050003", true));
        personNode.getChildren().add(folderNode);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo Recommendation", false));
        folderNode = new TreeNodeBase("foo-folder", "Requires Foo Approval", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "J050001", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J050002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J050003", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "E050011", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "R050002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "C050003", true));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Processing", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "X050003", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "X050011", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "F050002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "G050003", true));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Approval", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "J050006", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J050007", true));
        personNode.getChildren().add(folderNode);

        treeData.getChildren().add(personNode);

        // populate Betty's portion of the tree
        personNode = new TreeNodeBase("person", "Betty Bar", false);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo", false));
        folderNode = new TreeNodeBase("foo-folder", "Requires Foo Reviewer", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "X012000", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "X013000", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "X014000", true));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("foo-folder", "Requires Foo Recommendation", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "J010026", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J020002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J030103", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "E030214", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "R020444", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "C010000", true));
        personNode.getChildren().add(folderNode);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo Approval", false));
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Processing", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "T052003", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "T020011", true));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Approval", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "J010002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J030047", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "F030112", true));
        personNode.getChildren().add(folderNode);

        treeData.getChildren().add(personNode);

        return treeData;
    }
View Full Code Here


*/
public class TreeBacker
{
    public TreeNode getTreeData()
    {
        TreeNode treeData = new TreeNodeBase("foo-folder", "Inbox", true);

        // construct a set of fake data (normally your data would come from a database)

        // populate Frank's portion of the tree
        TreeNodeBase personNode = new TreeNodeBase("person", "Frank Foo", true);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo", true));
        TreeNodeBase folderNode = new TreeNodeBase("foo-folder", "Requires Foo Reviewer", true);
        folderNode.getChildren().add(new TreeNodeBase("document", "X050001", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "X050002", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "X050003", false));
        personNode.getChildren().add(folderNode);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo Recommendation", true));
        folderNode = new TreeNodeBase("foo-folder", "Requires Foo Approval", true);
        folderNode.getChildren().add(new TreeNodeBase("document", "J050001", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "J050002", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "J050003", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "E050011", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "R050002", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "C050003", false));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Processing", true);
        folderNode.getChildren().add(new TreeNodeBase("document", "X050003", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "X050011", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "F050002", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "G050003", false));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Approval", true);
        folderNode.getChildren().add(new TreeNodeBase("document", "J050006", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "J050007", false));
        personNode.getChildren().add(folderNode);

        treeData.getChildren().add(personNode);

        // populate Betty's portion of the tree
        personNode = new TreeNodeBase("person", "Betty Bar", true);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo", true));
        folderNode = new TreeNodeBase("foo-folder", "Requires Foo Reviewer", true);
        folderNode.getChildren().add(new TreeNodeBase("document", "X012000", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "X013000", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "X014000", false));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("foo-folder", "Requires Foo Recommendation", true);
        folderNode.getChildren().add(new TreeNodeBase("document", "J010026", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "J020002", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "J030103", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "E030214", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "R020444", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "C010000", false));
        personNode.getChildren().add(folderNode);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo Approval", true));
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Processing", true);
        folderNode.getChildren().add(new TreeNodeBase("document", "T052003", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "T020011", false));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Approval", true);
        folderNode.getChildren().add(new TreeNodeBase("document", "J010002", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "J030047", false));
        folderNode.getChildren().add(new TreeNodeBase("document", "F030112", false));
        personNode.getChildren().add(folderNode);

        treeData.getChildren().add(personNode);

        return treeData;
    }
View Full Code Here

        return treeData;
    }

    public TreeNode getSimpleTreeData()
    {
        TreeNode treeData = new TreeNodeBase("branch", "Inbox", true);

        // construct a set of fake data (normally your data would come from a database)

        // populate Frank's portion of the tree
        TreeNodeBase branchNode = new TreeNodeBase("branch", "Frank Foo", true);
        branchNode.getChildren().add(new TreeNodeBase("branch", "Requires Foo", true));
        TreeNodeBase folderNode = new TreeNodeBase("branch", "Requires Foo Reviewer", true);
        folderNode.getChildren().add(new TreeNodeBase("leaf", "X050001", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "X050002", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "X050003", false));
        branchNode.getChildren().add(folderNode);
        branchNode.getChildren().add(new TreeNodeBase("branch", "Requires Foo Recommendation", true));
        folderNode = new TreeNodeBase("branch", "Requires Foo Approval", true);
        folderNode.getChildren().add(new TreeNodeBase("leaf", "J050001", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "J050002", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "J050003", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "E050011", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "R050002", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "C050003", false));
        branchNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("branch", "Requires Bar Processing", true);
        folderNode.getChildren().add(new TreeNodeBase("leaf", "X050003", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "X050011", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "F050002", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "G050003", false));
        branchNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("branch", "Requires Bar Approval", true);
        folderNode.getChildren().add(new TreeNodeBase("leaf", "J050006", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "J050007", false));
        branchNode.getChildren().add(folderNode);

        treeData.getChildren().add(branchNode);

        // populate Betty's portion of the tree
        branchNode = new TreeNodeBase("branch", "Betty Bar", true);
        branchNode.getChildren().add(new TreeNodeBase("branch", "Requires Foo", true));
        folderNode = new TreeNodeBase("branch", "Requires Foo Reviewer", true);
        folderNode.getChildren().add(new TreeNodeBase("leaf", "X012000", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "X013000", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "X014000", false));
        branchNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("branch", "Requires Foo Recommendation", true);
        folderNode.getChildren().add(new TreeNodeBase("leaf", "J010026", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "J020002", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "J030103", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "E030214", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "R020444", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "C010000", false));
        branchNode.getChildren().add(folderNode);
        branchNode.getChildren().add(new TreeNodeBase("branch", "Requires Foo Approval", true));
        folderNode = new TreeNodeBase("branch", "Requires Bar Processing", true);
        folderNode.getChildren().add(new TreeNodeBase("leaf", "T052003", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "T020011", false));
        branchNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("branch", "Requires Bar Approval", true);
        folderNode.getChildren().add(new TreeNodeBase("leaf", "J010002", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "J030047", false));
        folderNode.getChildren().add(new TreeNodeBase("leaf", "F030112", false));
        branchNode.getChildren().add(folderNode);

        treeData.getChildren().add(branchNode);

        return treeData;

    }
View Full Code Here

    private TreeModelBase _treeModel;
    private HtmlTree _tree;

    public TreeNode getTreeData()
    {
        TreeNode treeData = new TreeNodeBase("foo-folder", "Inbox", false);

        // construct a set of fake data (normally your data would come from a database)

        // populate Frank's portion of the tree
        TreeNodeBase personNode = new TreeNodeBase("person", "Frank Foo", false);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo", false));
        TreeNodeBase folderNode = new TreeNodeBase("foo-folder", "Requires Foo Reviewer", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "X050001", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "X050002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "X050003", true));
        personNode.getChildren().add(folderNode);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo Recommendation", false));
        folderNode = new TreeNodeBase("foo-folder", "Requires Foo Approval", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "J050001", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J050002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J050003", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "E050011", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "R050002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "C050003", true));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Processing", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "X050003", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "X050011", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "F050002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "G050003", true));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Approval", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "J050006", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J050007", true));
        personNode.getChildren().add(folderNode);

        treeData.getChildren().add(personNode);

        // populate Betty's portion of the tree
        personNode = new TreeNodeBase("person", "Betty Bar", false);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo", false));
        folderNode = new TreeNodeBase("foo-folder", "Requires Foo Reviewer", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "X012000", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "X013000", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "X014000", true));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("foo-folder", "Requires Foo Recommendation", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "J010026", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J020002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J030103", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "E030214", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "R020444", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "C010000", true));
        personNode.getChildren().add(folderNode);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo Approval", false));
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Processing", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "T052003", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "T020011", true));
        personNode.getChildren().add(folderNode);
        folderNode = new TreeNodeBase("bar-folder", "Requires Bar Approval", false);
        folderNode.getChildren().add(new TreeNodeBase("document", "J010002", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "J030047", true));
        folderNode.getChildren().add(new TreeNodeBase("document", "F030112", true));
        personNode.getChildren().add(folderNode);

        treeData.getChildren().add(personNode);

        return treeData;
    }
View Full Code Here

    FolderBean folderBean = (FolderBean) FacesContext
    .getCurrentInstance().getApplication().createValueBinding(
        FolderBean.BEAN_REF).getValue(
        FacesContext.getCurrentInstance());
   
    TreeNode treeNode = this.treeModel.getNode();
    String identifier = treeNode.getIdentifier();
    CollectionDao collectionDao = CollectionDao.createInstance();
    Collection collection = collectionDao.retrieve(identifier);
    List allViewFolders = new ArrayList();
    List elem = populateAllViewFolders(collection,
        allViewFolders);
View Full Code Here

    return allViewFolders;
  }

  public String seeFolder() {

    TreeNode treeNode = this.treeModel.getNode();
    String identifier = treeNode.getIdentifier();

    FolderDao folderDao = FolderDao.createInstance();
    Folder folder = folderDao.retrieve(identifier);

    FolderBean folderBean = (FolderBean) FacesContext
View Full Code Here

    return "exploration_folder_description";
  }

  public void downloadFileAction(ActionEvent event) throws IOException {

    TreeNode treeNode = this.treeModel.getNode();
    String identifier = treeNode.getIdentifier();

    StoredFileDao fileDao = StoredFileDao.createInstance();
    StoredFile file = fileDao.retrieve(identifier);

    FacesContext facesContext = FacesContext.getCurrentInstance();
View Full Code Here

        }
        return true;
    }

    protected void encodeCurrentNode(FacesContext context, ResponseWriter out, HtmlTree tree) throws IOException {
        TreeNode node = tree.getNode();

        // set configurable values
        boolean showRootNode = getBoolean(tree, JSFAttr.SHOW_ROOT_NODE, true);
        boolean showNav = getBoolean(tree, JSFAttr.SHOW_NAV, true);
        boolean showLines = getBoolean(tree, JSFAttr.SHOW_LINES, true);
        boolean clientSideToggle = getBoolean(tree, JSFAttr.CLIENT_SIDE_TOGGLE, true);

        if (clientSideToggle) {
            // we must show the nav icons if client side toggle is enabled (regardless of what user says)
            showNav = true;
        }

        UIComponent nodeTypeFacet = tree.getFacet(node.getType());
        UIComponent nodeImgFacet = null;

        if (nodeTypeFacet == null) {
            throw new IllegalArgumentException("Unable to locate facet with the name: " + node.getType());
        }

        // render node padding
        String[] pathInfo = tree.getPathInformation(tree.getNodeId());
        int paddingLevel = pathInfo.length - 1;
View Full Code Here

     * @param tree HtmlTree
     * @return The additional navigation image to display inside the node (if any).  Only used with client-side toggle.
     * @throws IOException
     */
    private UIComponent encodeNavigation(FacesContext context, ResponseWriter out, HtmlTree tree) throws IOException {
        TreeNode node = tree.getNode();
        String nodeId = tree.getNodeId();
        String spanId = TOGGLE_SPAN + ":" + tree.getId() + ":" + nodeId;//TOGGLE_SPAN + nodeId;
        boolean showLines = getBoolean(tree, JSFAttr.SHOW_LINES, false);
        boolean clientSideToggle = getBoolean(tree, JSFAttr.CLIENT_SIDE_TOGGLE, true);
        UIComponent nodeTypeFacet = tree.getFacet(node.getType());
        String navSrc = null;
        String altSrc = null;
        UIComponent nodeImgFacet = null;

        int bitMask = NOTHING;
        bitMask += (node.isLeaf()) ? NOTHING : CHILDREN;
        bitMask += (tree.isNodeExpanded()) ? EXPANDED : NOTHING;
        bitMask += (tree.isLastChild(tree.getNodeId())) ? LAST : NOTHING;
        bitMask += (showLines) ? LINES : NOTHING;

        switch (bitMask) {
        case (NOTHING):

        case (LAST):
            navSrc = "spacer.gif";
            break;

        case (LINES):
            navSrc = "line-middle.gif";
            break;

        case (LINES + LAST):
            navSrc = "line-last.gif";
            break;

        case (CHILDREN):

        case (CHILDREN + LAST):
            navSrc = "nav-plus.gif";
            altSrc = "nav-minus.gif";
            break;

        case (CHILDREN + LINES):

            navSrc = "nav-plus-line-middle.gif";
            altSrc = "nav-minus-line-middle.gif";
            break;

        case (CHILDREN + LINES + LAST):

            navSrc = "nav-plus-line-last.gif";
            altSrc = "nav-minus-line-last.gif";
            break;

        case (CHILDREN + EXPANDED):

        case (CHILDREN + EXPANDED + LAST):
            navSrc = "nav-minus.gif";
            altSrc = "nav-plus.gif";
            break;

        case (CHILDREN + EXPANDED + LINES):
            navSrc = "nav-minus-line-middle.gif";
            altSrc = "nav-plus-line-middle.gif";
            break;

        case (CHILDREN + EXPANDED + LINES + LAST):
            navSrc = "nav-minus-line-last.gif";
            altSrc = "nav-plus-line-last.gif";
            break;

        // unacceptable bitmask combinations

        case (EXPANDED + LINES):
        case (EXPANDED + LINES + LAST):
        case (EXPANDED):
        case (EXPANDED + LAST):

            throw new IllegalStateException("Encountered a node [" + nodeId + "] + with an illogical state.  "
                    + "Node is expanded but it is also considered a leaf (a leaf cannot be considered expanded.");

        default:
            // catch all for any other combinations
            throw new IllegalArgumentException("Invalid bit mask of " + bitMask);
        }

        // adjust navSrc and altSrc so that the images can be retrieved using the extensions filter
        String navSrcUrl = getImageSrc(null, tree, navSrc);
        navSrc = getImageSrc(context, tree, navSrc);
        altSrc = getImageSrc(context, tree, altSrc);

        // render nav cell
        out.startElement(HTML.TD_ELEM, tree);
        out.writeAttribute(HTML.WIDTH_ATTR, "5", null);
        out.writeAttribute(HTML.HEIGHT_ATTR, "100%", null);
        out.writeAttribute("valign", "top", null);

        if ((bitMask & LINES) != 0 && (bitMask & LAST) == 0) {
            out.writeURIAttribute("background", getImageSrc(context, tree, "line-trunk.gif"), null);
        }

        //      add the appropriate image for the nav control
        UIGraphic image = new UIGraphic();
        image.setId(IMAGE_PREFIX);
        image.setUrl(navSrcUrl);
        Map imageAttrs = image.getAttributes();
        imageAttrs.put(HTML.WIDTH_ATTR, "19");
        imageAttrs.put(HTML.HEIGHT_ATTR, "18");
        imageAttrs.put(HTML.BORDER_ATTR, "0");

        if (clientSideToggle) {
            /**
             * With client side toggle, user has the option to specify open/closed images for the node (in addition to
             * the navigtion ones provided by the component.)
             */
            String expandImgSrc = "";
            String collapseImgSrc = "";
            String nodeImageId = "";

            UIComponent expandFacet = nodeTypeFacet.getFacet("expand");
            if (expandFacet != null) {
                UIGraphic expandImg = (UIGraphic) expandFacet;
                expandImgSrc = context.getApplication().getViewHandler().getResourceURL(context, expandImg.getUrl());
                if (expandImg.isRendered()) {
                    expandImg.setId(IMAGE_PREFIX + NODE_STATE_EXPANDED);
                    expandImg.setParent(tree);
                    nodeImageId = expandImg.getClientId(context);
                    nodeImgFacet = expandFacet;
                }
            }

            UIComponent collapseFacet = nodeTypeFacet.getFacet("collapse");
            if (collapseFacet != null) {
                UIGraphic collapseImg = (UIGraphic) collapseFacet;
                collapseImgSrc = context.getApplication().getViewHandler().getResourceURL(context, collapseImg.getUrl());
                if (collapseImg.isRendered()) {
                    collapseImg.setId(IMAGE_PREFIX + NODE_STATE_CLOSED);
                    collapseImg.setParent(tree);
                    nodeImageId = collapseImg.getClientId(context);
                    nodeImgFacet = collapseFacet;
                }
            }

            image.setParent(tree);
            if (node.getChildCount() > 0) {
                String onClick = new StringBuffer().append("treeNavClick('").append(spanId).append("', '").append(image.getClientId(context)).append("', '").append(navSrc).append("', '").append(
                        altSrc).append("', '").append(nodeImageId).append("', '").append(expandImgSrc).append("', '").append(collapseImgSrc).append("', '").append(tree.getId()).append("', '").append(
                        nodeId).append("');").toString();

                imageAttrs.put(HTML.ONCLICK_ATTR, onClick);
View Full Code Here

    private HtmlTree tree;

    private String nodePath;

    public TreeNode getTreeData() {
        TreeNode treeData = new TreeNodeBase("foo-folder", "Inbox", false);

// construct a set of fake data (normally your data would come from a database)

// populate Frank's portion of the tree
        TreeNodeBase personNode = new TreeNodeBase("person", "Frank Foo", false);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Frank Foo Subnode", false));
        treeData.getChildren().add(personNode);

// populate Betty's portion of the tree
        personNode = new TreeNodeBase("person", "Betty Bar", false);
        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Betty Bar Subnode", false));
        treeData.getChildren().add(personNode);

        return treeData;
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.js.FlatteningVisitor$TreeNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.