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

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


     */
    protected void addAttribute(Node node, ElementBean target) {
        String name = (String) target.getAttributes().get("name");
        String value = (String) target.getAttributes().get("value");

        AttributeBean attr = target.getAttribute(name);
        if (attr != null) {
            createAttribute(attr, value, target);
        } else {
            attr = new AttributeBean();
            attr.setName(name);
            attr.setValue(value);
            attr.setBindingType(AttributeBean.BINDING_TYPE_EARLY);
            target.addAttribute(attr);
        }
    }
View Full Code Here


        clayContext.setSymbols(symbolTable);

        // evaluate nested symbols; symbols having symbols as values
        realizeSymbols(clayContext);

        AttributeBean attr = null;
        attr = displayElement.getAttribute("renderKitId");
        if (attr != null && attr.getValue() != null) {
            clayContext.setAttribute(attr);
            String expr = replaceMnemonic(clayContext);
            if (expr != null) {
                if (isValueReference(expr)) {
                    getTagUtils().setValueBinding(facesContext.getViewRoot(), "renderKitId", expr);
                } else {
                    facesContext.getViewRoot().setRenderKitId(expr);
                }
            }
            clayContext.setAttribute(null);
        }
        attr = displayElement.getAttribute("locale");
        if (attr != null && attr.getValue() != null) {
            clayContext.setAttribute(attr);
            String expr = replaceMnemonic(clayContext);
            if (expr != null) {
                if (isValueReference(expr)) {
                    getTagUtils().setValueBinding(facesContext.getViewRoot(), "locale", expr);
View Full Code Here

                   new Object[] {id, symbolTable}));
        }

        if (child == null) {
            try {
                AttributeBean attr = displayElement.getAttribute("binding");
                if (attr != null
                    && attr.getValue() != null) {

                   clayContext.setAttribute(attr);
                   String expr = replaceMnemonic(clayContext);
                   ValueBinding vb = facesContext.getApplication().createValueBinding(expr);
                   child = facesContext.getApplication().createComponent(vb, facesContext,
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("converter") && attributeBean.getValue() != null) {
            isFinal = true;

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

            if (child instanceof ValueHolder) {
                String expr = null;

                boolean isEL = isValueReference(attributeBean.getValue());
                expr = replaceMnemonic(clayContext);

                if (isEL) {
                   getTagUtils().setValueBinding(child, "converter", expr);
                } else {
View Full Code Here

        }

        ActionListener listener = 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);
                listener = (ActionListener) vb.getValue(facesContext);
            } else {
View Full Code Here

        Catalog defaultCatalog = getCatalog();
        Catalog customizationCatalog = getCustomizationCatalog();

        Command defaultCommand = defaultCatalog.getCommand(Globals.SET_ATTRIBUTE_COMMAND_NAME);
        next: while (ai.hasNext()) {
            AttributeBean a = (AttributeBean) ai.next();
            if (a.getValue() == null) {
               continue next;
            }

            Command command = null;
            //look for a command override in the customization catalog first
            if (customizationCatalog != null) {
                command = customizationCatalog.getCommand(a.getName());
            }
            //look for a command override in the defaut catalog
            if (command == null) {
               command = defaultCatalog.getCommand(a.getName());
            }
            //use the default command
            if (command == null) {
               command = defaultCommand;
            }
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("action") && 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

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.