Examples of AbstractTreeNode


Examples of org.richfaces.component.AbstractTreeNode

     */
    private final class RowKeyContextCallback implements ContextCallback {
        private Object rowKey;

        public void invokeContextCallback(FacesContext context, UIComponent target) {
            AbstractTreeNode treeNode = (AbstractTreeNode) target;
            rowKey = treeNode.findTreeComponent().getRowKey();
        }
View Full Code Here

Examples of org.richfaces.component.AbstractTreeNode

        final Map<String, String> map = context.getExternalContext().getRequestParameterMap();
        String newToggleState = map.get(component.getClientId(context) + NEW_NODE_TOGGLE_STATE);
        if (newToggleState != null) {

            AbstractTreeNode treeNode = (AbstractTreeNode) component;

            boolean initialState = treeNode.isExpanded();
            boolean newState = Boolean.valueOf(newToggleState);
            if (initialState ^ newState) {
                new TreeToggleEvent(treeNode, newState).queue();
            }
View Full Code Here

Examples of org.richfaces.component.AbstractTreeNode

    }

    public void encodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId) throws IOException {

        if (AbstractTreeNode.SUBTREE_META_COMPONENT_ID.equals(metaComponentId)) {
            AbstractTreeNode treeNode = (AbstractTreeNode) component;
            new TreeEncoderPartial(context, treeNode).encode();
        } else {
            throw new IllegalArgumentException(metaComponentId);
        }
    }
View Full Code Here

Examples of org.richfaces.component.AbstractTreeNode

    }

    protected void encodeIcon(FacesContext context, UIComponent component) throws IOException {
        TreeNodeState nodeState = getNodeState(context);

        AbstractTreeNode treeNode = (AbstractTreeNode) component;

        AbstractTree tree = treeNode.findTreeComponent();

        if (nodeState.isLeaf()) {
            String iconLeaf = (String) getFirstNonEmptyAttribute("iconLeaf", treeNode, tree);
            encodeIconForNodeState(context, tree, treeNode, nodeState, iconLeaf);
        } else {
            String iconExpanded = (String) getFirstNonEmptyAttribute("iconExpanded", treeNode, tree);
            String iconCollapsed = (String) getFirstNonEmptyAttribute("iconCollapsed", treeNode, tree);

            if (Strings.isNullOrEmpty(iconCollapsed) && Strings.isNullOrEmpty(iconExpanded)) {
                encodeIconForNodeState(context, tree, treeNode, nodeState, null);
            } else {
                SwitchType toggleType = getToggleTypeOrDefault(treeNode.findTreeComponent());

                if (toggleType == SwitchType.client || nodeState == TreeNodeState.collapsed) {
                    encodeIconForNodeState(context, tree, treeNode, TreeNodeState.collapsed, iconCollapsed);
                }
View Full Code Here

Examples of org.richfaces.component.AbstractTreeNode

                    .get("iconClass")), customIcon);
        }
    }

    protected void addClientEventHandlers(FacesContext facesContext, UIComponent component) {
        AbstractTreeNode treeNode = (AbstractTreeNode) component;

        // TODO check node state
        // TODO check toggle/selection types
        TreeRenderingContext renderingContext = TreeRenderingContext.get(facesContext);
        renderingContext.addHandlers(treeNode);
View Full Code Here

Examples of org.richfaces.component.AbstractTreeNode

        TreeRenderingContext renderingContext = TreeRenderingContext.get(facesContext);
        renderingContext.addHandlers(treeNode);
    }

    protected UIComponent getHandleLoadingFacetIfApplicable(UIComponent component) {
        AbstractTreeNode treeNode = (AbstractTreeNode) component;

        AbstractTree tree = treeNode.findTreeComponent();

        if (getToggleTypeOrDefault(tree) != SwitchType.ajax) {
            return null;
        }

        UIComponent facet = treeNode.getFacet(HANDLE_LOADING_FACET_NAME);
        if (facet == null) {
            facet = tree.getFacet(HANDLE_LOADING_FACET_NAME);
        }

        if (facet != null && facet.isRendered()) {
View Full Code Here

Examples of org.richfaces.component.AbstractTreeNode

            throw new FacesException(e.getMessage(), e);
        }
    }

    protected void writeTreeNodeStartElement(TreeNodeState nodeState) throws IOException {
        AbstractTreeNode treeNodeComponent = tree.findTreeNodeComponent();

        context.getAttributes().put(TREE_NODE_STATE_ATTRIBUTE, nodeState);

        responseWriter.startElement(HtmlConstants.DIV_ELEM, tree);
        responseWriter.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
            HtmlUtil.concatClasses("rf-tr-nd", nodeState.getNodeClass()), null);
        responseWriter.writeAttribute(HtmlConstants.ID_ATTRIBUTE, treeNodeComponent.getClientId(context), null);

        emitClientToggleEvent(treeNodeComponent, nodeState);
    }
View Full Code Here

Examples of org.richfaces.component.AbstractTreeNode

            }

            FacesContext facesContext = ctx.getFacesContext();
            Application application = facesContext.getApplication();

            AbstractTreeNode treeNode = (AbstractTreeNode) application.createComponent(AbstractTreeNode.COMPONENT_TYPE);
            treeNode.setId(DEFAULT_TREE_NODE_ID);

            c.getFacets().put(DEFAULT_TREE_NODE_FACET_NAME, treeNode);

            UIComponent text = application.createComponent(HtmlOutputText.COMPONENT_TYPE);

            text.setValueExpression(
                "value",
                application.getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{" + var + "}",
                    String.class));
            treeNode.getChildren().add(text);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.