Package com.volantis.mcs.protocols.widgets

Examples of com.volantis.mcs.protocols.widgets.ActionReference


            final String wizardId = wizardAttrs.getId();
           
            // associate button with complete action
            final List memberList = new ArrayList();
            memberList.add(ActionName.COMPLETE);
            buttonAttributes.setActionReference(new ActionReference() {
                public String getWidgetId() {return wizardId;}
                public List getMemberNames() {return memberList;}
            });
           
            WidgetModule widgetModule = protocol.getWidgetModule();
View Full Code Here


       
        // Render only javascript responsible for handling button
        ButtonScriptHandlerAttributes actionButtonAttributes =
            (ButtonScriptHandlerAttributes) attributes;
       
        ActionReference actionReference = actionButtonAttributes.getActionReference();
       
        // Get disabled styles.
        StylesExtractor stylesExtractor =
            createStylesExtractor(protocol, attributes.getStyles());

        stylesExtractor.setPseudoClass(StatefulPseudoClasses.MCS_DISABLED);
       
        StringBuffer scriptBuffer = new StringBuffer();
       
        // Finally, render the JavaScript part.
        if (attributes.getId() != null) {
            scriptBuffer.append("Widget.register(")
                .append(createJavaScriptString(attributes.getId()))
                .append(",");
           
            addCreatedWidgetId(attributes.getId());
        }

        scriptBuffer.append("new Widget.Button(")
            .append(createJavaScriptString(actionButtonAttributes.getId()))
            .append(",{")
            .append("disabledStyle:" + stylesExtractor.getJavaScriptStyles());
       
        if (actionReference != null) {
            scriptBuffer.append(",action:")
                .append(createJavaScriptExpression(actionReference));
           
            addUsedWidgetId(actionReference.getWidgetId());
        }
       
        scriptBuffer.append("})");
       
        if (attributes.getId() != null) {
View Full Code Here

        }

        // Render the action button controller.
        ButtonAttributes actionButtonAttributes = (ButtonAttributes) attributes;
       
        ActionReference actionReference = actionButtonAttributes.getActionReference();
       
        // Get disabled styles.
        StylesExtractor stylesExtractor = createStylesExtractor(protocol, attributes.getStyles());

        stylesExtractor.setPseudoClass(StatefulPseudoClasses.MCS_DISABLED);
       
        StringBuffer scriptBuffer = new StringBuffer();
       
        // Finally, render the JavaScript part.
        if (attributes.getId() != null) {
            scriptBuffer.append("Widget.register(")
                .append(createJavaScriptString(attributes.getId()))
                .append(",");
           
            addCreatedWidgetId(attributes.getId());
        }

        scriptBuffer.append("new Widget.Button(")
            .append(createJavaScriptString(elementId))
            .append(",{")
            .append("disabledStyle:" + stylesExtractor.getJavaScriptStyles());
       
        if (actionReference != null) {
            scriptBuffer.append(",action:")
                .append(createJavaScriptExpression(actionReference));
           
            addUsedWidgetId(actionReference.getWidgetId());
        }
       
        scriptBuffer.append("})");
       
        if (attributes.getId() != null) {
View Full Code Here

        // 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(")");
       
        if (attributes.getId() != null) {
            scriptBuffer.append(")");
        }

        addUsedWidgetId(eventReference.getWidgetId());
        addUsedWidgetId(actionReference.getWidgetId());
       
        // Write JavaScript content to DOM.
        try {
            getJavaScriptWriter().write(scriptBuffer.toString());
        } catch (IOException e) {
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.widgets.ActionReference

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.