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

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


        if (parent == null) {
            throw new NullPointerException(getMessages()
                    .getMessage("clay.null.childComponent"));
        }

        ComponentBean displayElement = clayContext.getDisplayElement();
        if (displayElement == null) {
            throw new NullPointerException(getMessages()
                    .getMessage("clay.null.componentBean"));
        }

        Iterator vi = displayElement.getChildrenIterator();

        int childIndex = 0;
        while (vi.hasNext()) {
            ComponentBean childDisplayElement = (ComponentBean) vi.next();

            ClayContext subContext = (ClayContext) clayContext.clone();
            subContext.setDisplayElement(childDisplayElement);
            subContext.setParent(parent);
            subContext.setChild(null);
View Full Code Here


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

        ComponentBean displayElement = clayContext.getDisplayElement();
        if (displayElement == null) {
            throw new NullPointerException(getMessages()
                    .getMessage("clay.null.componentBean"));
        }

        ActionSource parent = (ActionSource) clayContext.getParent();
        if (parent == null) {
            throw new NullPointerException(getMessages()
                    .getMessage("clay.null.parentComponent"));
        }

        FacesContext facesContext = clayContext.getFacesContext();
        if (facesContext == null) {
            throw new NullPointerException(getMessages()
                    .getMessage("clay.null.facesContext"));
        }

        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 {

                ClassLoader loader = Thread.currentThread().getContextClassLoader();
                if (loader == null) {
                    loader = getClass().getClassLoader();
                }

                listener = (ActionListener) loader.loadClass(
                        displayElement.getComponentType()).newInstance();

                loader = null;
            }
        } catch (Exception e) {
            log.error(getMessages().getMessage("create.actionListener.error",
View Full Code Here

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

        ComponentBean displayElement = clayContext.getDisplayElement();
        if (displayElement == null) {
            throw new NullPointerException(getMessages()
                    .getMessage("clay.null.componentBean"));
        }

        Iterator ai = displayElement.getAttributeIterator();
        Catalog defaultCatalog = getCatalog();
        Catalog customizationCatalog = getCustomizationCatalog();

        Command defaultCommand = defaultCatalog.getCommand(Globals.SET_ATTRIBUTE_COMMAND_NAME);
        next: while (ai.hasNext()) {
View Full Code Here

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

        ComponentBean displayElement = clayContext.getDisplayElement();
        if (displayElement == null) {
            throw new NullPointerException(getMessages()
                    .getMessage("clay.null.componentBean"));
        }

        if (displayElement.getValidators().size() > 0) {
            if (child instanceof EditableValueHolder) {

                Iterator vi = displayElement.getValidatorIterator();
                while (vi.hasNext()) {
                    ValidatorBean validator = (ValidatorBean) vi.next();

                    ClayContext subContext = (ClayContext) clayContext.clone();
                    subContext.setDisplayElement(validator);
View Full Code Here

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

        ComponentBean displayElement = clayContext.getDisplayElement();
        if (displayElement == null) {
            throw new NullPointerException(getMessages()
                    .getMessage("clay.null.componentBean"));
        }

        if (displayElement.getConverter() != null) {
            if (child instanceof ValueHolder) {

                ClayContext subContext = (ClayContext) clayContext.clone();
                subContext.setDisplayElement(displayElement.getConverter());
                subContext.setParent(child);

                Catalog catalog = getCatalog();
                Command command = catalog
                        .getCommand(Globals.ADD_CONVERTER_COMMAND_NAME);
View Full Code Here

        }
        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) {
View Full Code Here

TOP

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

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.