Package com.volantis.mcs.protocols.widgets.attributes

Examples of com.volantis.mcs.protocols.widgets.attributes.HandlerAttributes


     * @param context The XDIME context
     */
    public HandlerElement(XDIMEContextInternal context){
        super(WidgetElements.HANDLER, context);
       
        protocolAttributes = new HandlerAttributes();
    }
View Full Code Here


       
        if (actionAttributeValue == null) {
            throw new XDIMEException("No action attribute.");
        }
       
        HandlerAttributes handlerAttributes = (HandlerAttributes) protocolAttributes;

        handlerAttributes.setEventReference(new EventReferenceImpl(eventAttributeValue));
        handlerAttributes.setActionReference(new ActionReferenceImpl(actionAttributeValue));
       
        // Initialize isEnabled attribute.
        String isEnabledAttribute = attributes.getValue("", "is-enabled");
       
        if (isEnabledAttribute != null
                && !isEnabledAttribute.equals("yes")
                && !isEnabledAttribute.equals("no")) {
            throw new XDIMEException("Invalid value for is-enabled attribute.");
        }

        handlerAttributes.setEnabled(isEnabledAttribute == null || isEnabledAttribute.equals("yes"));
    }
View Full Code Here

        if(!isWidgetSupported(protocol)) {
            return;
        }       
       
        // Render the Property Handler controller.
        HandlerAttributes handlerAttributes = (HandlerAttributes) attributes;
       
        EventReference eventReference = handlerAttributes.getEventReference();
       
        ActionReference actionReference = handlerAttributes.getActionReference();
       
        StringBuffer scriptBuffer = new StringBuffer();
       
        if (attributes.getId() != null) {
            scriptBuffer.append("Widget.register(")
                .append(createJavaScriptString(attributes.getId()))
                .append(",");
           
            addCreatedWidgetId(attributes.getId());
        }

        scriptBuffer.append("new Widget.Handler(")
            .append(createJavaScriptExpression(eventReference))
            .append(",")
            .append(createJavaScriptExpression(actionReference));
       
        if (!handlerAttributes.isEnabled()) {
            scriptBuffer.append(",{isEnabled:false}");
        }
           
        scriptBuffer.append(")");
       
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.widgets.attributes.HandlerAttributes

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.