Package org.apache.cocoon.woody.datatype

Examples of org.apache.cocoon.woody.datatype.Datatype


        Element datatypeElement = DomHelper.getChildElement(widgetElement, Constants.WD_NS, "datatype");
        if (datatypeElement == null)
            throw new Exception("A nested datatype element is required for the widget specified at " + DomHelper.getLocation(widgetElement));

        Datatype datatype = datatypeManager.createDatatype(datatypeElement, true);
        if (datatype.getSelectionList() == null)
            throw new Exception("Error: multivaluefields always require a selectionlist at " + DomHelper.getLocation(datatypeElement));
        definition.setDatatype(datatype);

        boolean required = DomHelper.getAttributeAsBoolean(widgetElement, "required", false);
        definition.setRequired(required);
View Full Code Here


        Element datatypeElement = DomHelper.getChildElement(widgetElement, Constants.WD_NS, "datatype");
        if (datatypeElement == null)
            throw new Exception("A nested datatype element is required for the widget specified at " + DomHelper.getLocation(widgetElement));

        Datatype datatype = datatypeManager.createDatatype(datatypeElement, false);
        fieldDefinition.setDatatype(datatype);

        setLabel(widgetElement, fieldDefinition);

        boolean required = DomHelper.getAttributeAsBoolean(widgetElement, "required", false);
View Full Code Here

        if (datatypeElement == null) {
            throw new Exception("A nested datatype element is required for the widget at " +
                                DomHelper.getLocation(widgetElement));
        }

        Datatype datatype = datatypeManager.createDatatype(datatypeElement, false);
        fieldDefinition.setDatatype(datatype);

        buildSelectionList(widgetElement, fieldDefinition);

        Iterator iter = buildEventListeners(widgetElement, "on-value-changed", ValueChangedListener.class).iterator();
View Full Code Here

    public void jsSet_value(Object value) throws JavaScriptException {
        if (delegate instanceof DataWidget) {
            value = unwrap(value);
            if (value != null) {
                Datatype datatype = ((DataWidget)delegate).getDatatype();
                Class typeClass = datatype.getTypeClass();
                if (typeClass == String.class) {
                    value = Context.toString(value);
                } else if (typeClass == boolean.class ||
                           typeClass == Boolean.class) {
                    value = Context.toBoolean(value) ? Boolean.TRUE : Boolean.FALSE;
View Full Code Here

        Element datatypeElement = DomHelper.getChildElement(widgetElement, Constants.WD_NS, "datatype");
        if (datatypeElement == null)
            throw new Exception("A nested datatype element is required for the widget specified at " + DomHelper.getLocation(widgetElement));

        Datatype datatype = datatypeManager.createDatatype(datatypeElement, true);
        definition.setDatatype(datatype);

        boolean hasSelectionList = buildSelectionList(widgetElement, definition);
        if (!hasSelectionList)
            throw new Exception("Error: multivaluefields always require a selectionlist at " + DomHelper.getLocation(widgetElement));
View Full Code Here

        Element datatypeElement = DomHelper.getChildElement(widgetElement, Constants.WD_NS, "datatype");
        if (datatypeElement == null)
            throw new Exception("A nested datatype element is required for the widget specified at " + DomHelper.getLocation(widgetElement));

        Datatype datatype = datatypeManager.createDatatype(datatypeElement, false);
        definition.setDatatype(datatype);

        setDisplayData(widgetElement, definition);

        return definition;
View Full Code Here

    public void jsSet_value(Object value) throws JavaScriptException {
        if (delegate instanceof DataWidget) {
            value = unwrap(value);
            if (value != null) {
                Datatype datatype = ((DataWidget)delegate).getDatatype();
                Class typeClass = datatype.getTypeClass();
                if (typeClass == String.class) {
                    value = Context.toString(value);
                } else if (typeClass == boolean.class ||
                           typeClass == Boolean.class) {
                    value = Context.toBoolean(value) ? Boolean.TRUE : Boolean.FALSE;
View Full Code Here

        Element datatypeElement = DomHelper.getChildElement(widgetElement, Constants.WD_NS, "datatype");
        if (datatypeElement == null)
            throw new Exception("A nested datatype element is required for the widget specified at " + DomHelper.getLocation(widgetElement));

        Datatype datatype = datatypeManager.createDatatype(datatypeElement, true);
        definition.setDatatype(datatype);

        boolean hasSelectionList = buildSelectionList(widgetElement, definition);
        if (!hasSelectionList)
            throw new Exception("Error: multivaluefields always require a selectionlist at " + DomHelper.getLocation(widgetElement));
View Full Code Here

        Element datatypeElement = DomHelper.getChildElement(widgetElement, Constants.WD_NS, "datatype");
        if (datatypeElement == null)
            throw new Exception("A nested datatype element is required for the widget specified at " + DomHelper.getLocation(widgetElement));

        Datatype datatype = datatypeManager.createDatatype(datatypeElement, false);
        definition.setDatatype(datatype);

        setDisplayData(widgetElement, definition);

        return definition;
View Full Code Here

        Element datatypeElement = DomHelper.getChildElement(widgetElement, Constants.WD_NS, "datatype");
        if (datatypeElement == null)
            throw new Exception("A nested datatype element is required for the widget specified at " + DomHelper.getLocation(widgetElement));

        Datatype datatype = datatypeManager.createDatatype(datatypeElement, false);
        fieldDefinition.setDatatype(datatype);

        buildSelectionList(widgetElement, fieldDefinition);
       
        Iterator iter = buildEventListeners(widgetElement, "on-value-changed", ValueChangedListener.class).iterator();
View Full Code Here

TOP

Related Classes of org.apache.cocoon.woody.datatype.Datatype

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.