Package org.apache.myfaces.custom.tree.model

Examples of org.apache.myfaces.custom.tree.model.TreeModel


     * @param path the <code>TreePath</code> identifying a node
     */
    public void expandPath(TreePath path, FacesContext context)
    {
        // Only expand if not leaf!
        TreeModel model = getModel(context);

        if (path != null && model != null && !model.isLeaf(path.getLastPathComponent()))
        {
            int[] translatedPath = HtmlTreeNode.translatePath(path, getModel(context));
            HtmlTreeNode rootNode = getRootNode();
            if (rootNode == null)
            {
View Full Code Here



    private void createRootNode(FacesContext context)
    {
        HtmlTreeNode node;
        TreeModel model = getModel(context);
        Object root = model.getRoot();
        node = (HtmlTreeNode) context.getApplication().createComponent(HtmlTreeNode.COMPONENT_TYPE);
        String id = createUniqueId(context);
        node.setId(id);

        node.setPath(new TreePath(new Object[]{root}));
View Full Code Here

        {
            // nothing to do
            return;
        }

        TreeModel model = getTreeModel(context);
        int childCount = model.getChildCount(getUserObject());
        int pathUpdateIndex = getTranslatedPath().length;

        for (int i = 0; i < children.length; i++)
        {
            int index = children[i];
            translateChildrenPath(pathUpdateIndex, index, 1);
            Object userObject = model.getChild(getUserObject(), index);
            addNode(model, userObject, index, childCount, context);
        }
    }
View Full Code Here

        {
            // nothing to do
            return;
        }

        TreeModel model = getTreeModel(context);

        for (int i = 0; i < children.length; i++)
        {
            int index = children[i];
            Object userObject = model.getChild(getUserObject(), index);
            HtmlTreeNode node = (HtmlTreeNode) getChildren().get(index);
            node.setUserObject(userObject);
            // todo: modify path????
        }
    }
View Full Code Here

        this.expanded = expanded;

        if (expanded)
        {
            FacesContext context = FacesContext.getCurrentInstance();
            TreeModel model = getTreeModel(context);
            int childCount = model.getChildCount(getUserObject());

            for (int i = 0; i < childCount; i++)
            {
                Object child = model.getChild(getUserObject(), i);
                HtmlTreeNode node = createNode(model, child, childCount, i, context);
                getChildren().add(node);
            }
            layout[layout.length - 1] -= OFFSET;
        } else
View Full Code Here

TOP

Related Classes of org.apache.myfaces.custom.tree.model.TreeModel

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.