Package org.apache.shale.clay.config.beans

Examples of org.apache.shale.clay.config.beans.AttributeBean


        link.setRenderId(generateId());
        link.setJsfid("commandLink");
        link.setComponentType("javax.faces.HtmlCommandLink");

        // add a value attribute
        AttributeBean attr = new AttributeBean();
        attr.setName("value");
        attr.setValue(item.getLabel());
        link.addAttribute(attr);

        // turn on the the immediate attribute so the validation
        // logic is not invoked when switching tabs
        attr = new AttributeBean();
        attr.setName("immediate");
        attr.setValue("true");
        link.addAttribute(attr);

        // add a action method binding event when the link is clicked
        attr = new AttributeBean();
        attr.setName("action");
        attr.setValue("#{@managed-bean-name.changeTab}");
        link.addAttribute(attr);

        // create a parameter
        ElementBean param = new ElementBean();
        param.setJsfid("param");
        param.setComponentType("javax.faces.Parameter");
        // RenderId is the key to the Map. Increment for each new parameter
        param.setRenderId(generateId());

       
        // add a query param for the selected tab index
        attr = new AttributeBean();
        attr.setName("name");
        attr.setValue("tabIndex");
        param.addAttribute(attr);

        // add a query parameter for the tab index
        attr = new AttributeBean();
        attr.setName("value");
        attr.setValue(((Integer) item.getValue()).toString());
        param.addAttribute(attr);

        // add a parameter to the commandLink
        link.addChild(param);
View Full Code Here


    protected ElementBean createVerbatimMetadata(String html, String renderExp,
            FacesContext context) {
        ElementBean text = createVerbatimMetadata(html, context);

        // add a rendered attribute
        AttributeBean attr = new AttributeBean();
        attr.setName("rendered");
        attr.setValue(renderExp);
        attr.setBindingType(AttributeBean.BINDING_TYPE_VALUE);
        text.addAttribute(attr);

        return text;

    }
View Full Code Here

        text.setRenderId(generateId());
        text.setJsfid("f:verbatim");
        text.setComponentType("javax.faces.HtmlOutputText");
            
        // add a value attribute
        AttributeBean attr = new AttributeBean();
        attr.setName("value");
        attr.setValue(html);
        text.addAttribute(attr);

        // add a escape attribute
        attr = new AttributeBean();
        attr.setName("escape");
        attr.setValue(Boolean.FALSE.toString());
        text.addAttribute(attr);
       
        // add a isTransient attribute
        attr = new AttributeBean();
        attr.setName("isTransient");
        attr.setValue(Boolean.TRUE.toString());
        text.addAttribute(attr);

        return text;
    }
View Full Code Here

        text.setJsfid("outputText");
        text.setComponentType("javax.faces.HtmlOutputText");

        // add a value attribute
        AttributeBean attr = new AttributeBean();
        attr.setName("value");
        attr.setValue(value);
        text.addAttribute(attr);

        // add a escape attribute
        attr = new AttributeBean();
        attr.setName("escape");
        attr.setValue(Boolean.FALSE.toString());
        text.addAttribute(attr);

        // add a isTransient attribute
        attr = new AttributeBean();
        attr.setName("isTransient");
        attr.setValue(Boolean.TRUE.toString());
        text.addAttribute(attr);

    }
View Full Code Here

        text.setJsfid("outputText");
        text.setComponentType("javax.faces.HtmlOutputText");

        // add a value attribute
        AttributeBean attr = new AttributeBean();
        attr.setName("value");
        attr.setValue(value.toString());
        text.addAttribute(attr);

        // add a escape attribute
        attr = new AttributeBean();
        attr.setName("escape");
        attr.setValue(Boolean.FALSE.toString());
        text.addAttribute(attr);

        // add a isTransient attribute
        attr = new AttributeBean();
        attr.setName("isTransient");
        attr.setValue(Boolean.TRUE.toString());
        text.addAttribute(attr);
    }
View Full Code Here

        //HTML node has been thrown out.  Look to see if the clayJsfid can be
        //found in the forming ComponentBean.
        if (getJsfid() == null) {
            String attrClayJsfid = "null";
            ComponentBean displayElement = (ComponentBean) getAttributes().get(Globals.CLAY_RESERVED_ATTRIBUTE);
            AttributeBean attr = displayElement.getAttribute("clayJsfid");
            if (displayElement != null && (attr != null)) {
                attrClayJsfid = attr.getValue();
            }
            throw new NullPointerException(messages.getMessage("clay.jsfid.null",
                  new Object[] { attrClayJsfid}));
        }
View Full Code Here

        ClayContext clayContext = (ClayContext) context;
        if (clayContext == null) {
            throw new NullPointerException(getMessages().getMessage("clay.null.clayContext"));
        }
        AttributeBean attributeBean = clayContext.getAttribute();
        if (attributeBean == null) {
            throw new NullPointerException(getMessages().getMessage("clay.null.attributeBean"));
        }
        ComponentBean displayElement = clayContext.getDisplayElement();
        if (displayElement == null) {
            throw new NullPointerException(getMessages().getMessage("clay.null.componentBean"));
        }
        FacesContext facesContext = clayContext.getFacesContext();
        if (facesContext == null) {
            throw new NullPointerException(getMessages().getMessage("clay.null.facesContext"));
        }

        if (attributeBean.getName().equals("actionListener") && attributeBean.getValue() != null) {
            isFinal = true;

            UIComponent child = (UIComponent) clayContext.getChild();
            if (child == null) {
                throw new NullPointerException(getMessages().getMessage("clay.null.childComponent"));
View Full Code Here

     * @param root parent
     */
    protected void encodeBegin(Node node, ElementBean target, ComponentBean root) {
        String value = node.getToken().getRawText();

        AttributeBean attr = new AttributeBean();
        attr.setBindingType(AttributeBean.BINDING_TYPE_VALUE);
        attr.setName("value");
        attr.setValue(value.toString());
        target.addAttribute(attr);

        attr = new AttributeBean();
        attr.setBindingType(AttributeBean.BINDING_TYPE_NONE);
        attr.setName("escape");
        attr.setValue(Boolean.FALSE.toString());
        target.addAttribute(attr);

        attr = new AttributeBean();
        attr.setBindingType(AttributeBean.BINDING_TYPE_NONE);
        attr.setName("isTransient");
        attr.setValue(Boolean.TRUE.toString());
        target.addAttribute(attr);

    }
View Full Code Here

            root.addChild(endTarget);

            StringBuffer tmp = new StringBuffer();
            tmp.append("</").append(node.getName()).append(">");

            AttributeBean attr = new AttributeBean();
            attr.setBindingType(AttributeBean.BINDING_TYPE_NONE);
            attr.setName("value");
            attr.setValue(tmp.toString());
            endTarget.addAttribute(attr);

            attr = new AttributeBean();
            attr.setBindingType(AttributeBean.BINDING_TYPE_NONE);
            attr.setName("escape");
            attr.setValue(Boolean.FALSE.toString());
            endTarget.addAttribute(attr);

            attr = new AttributeBean();
            attr.setBindingType(AttributeBean.BINDING_TYPE_NONE);
            attr.setName("isTransient");
            attr.setValue(Boolean.TRUE.toString());
            endTarget.addAttribute(attr);

        }
    }
View Full Code Here

                    .getMessage("clay.null.facesContext"));
        }

        Validator validator = null;
        try {
            AttributeBean attr = displayElement.getAttribute("binding");
            if (attr != null && isValueReference(attr.getValue())) {
                clayContext.setAttribute(attr);
                String expr = replaceMnemonic(clayContext);
                ValueBinding vb = facesContext.getApplication()
                        .createValueBinding(expr);
                validator = (Validator) vb.getValue(facesContext);
View Full Code Here

TOP

Related Classes of org.apache.shale.clay.config.beans.AttributeBean

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.