Examples of ButtonAttributes


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

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

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

     */
    protected void initialiseElementSpecificAttributes(
            XDIMEContextInternal context, XDIMEAttributes attributes)
            throws XDIMEException {
       
        ButtonAttributes buttonAttributes = (ButtonAttributes) protocolAttributes;

        String attributeValue = attributes.getValue("", "action");
       
        if (attributeValue != null) {
            buttonAttributes.setActionReference(new ActionReferenceImpl(attributeValue));
        }
    }
View Full Code Here

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

    public void doRenderOpen(VolantisProtocol protocol, MCSAttributes attributes)
            throws ProtocolException {

        WidgetDefaultModule module = getWidgetDefaultModule(protocol);
       
        buttonAttributes = new ButtonAttributes();
      
        buttonAttributes.copy(attributes);
       
        final String widgetId = module.getCurrentWidgetId(actionName);
       
View Full Code Here

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

    private void initializeActionsToInternalButtonsMap(String widgetId) {
        for (int i = 0; i < INTERNAL_ACTIONS.length; i++) {
            ActionName action = INTERNAL_ACTIONS[i];
            List actionList = new ArrayList();
            actionList.add(action);
            ButtonAttributes buttonAttributes = new ButtonAttributes();
            buttonAttributes.setActionReference(new ActionReferenceImpl(widgetId, actionList));
            actionsToInternalButtonsMap.put(action, buttonAttributes);
        }
    }
View Full Code Here

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

       
        // buttonAttributes contains only action reference for given button
        // action is  used for creating fresh button attributes with
        // unique id.
        // buttonAttributes can contains also more data than action reference
        ButtonAttributes refButtonAttributes = (ButtonAttributes)
            this.actionsButtonsMapping.get(actionName);
        // new attributes created to avoid duplicated ID.
        // ButtondefaultRenderer.renderOpen create id if don't exist
        // so reusing of the same attriubtes leads to duplicated ID.
        final ButtonAttributes buttonAttributes = new ButtonAttributes();
        buttonAttributes.setActionReference(refButtonAttributes.getActionReference());
       
        if(null == buttonAttributes){
            throw new ProtocolException();           
        }
       
        DOMOutputBuffer buffer = getCurrentBuffer();

       
        //  Take styles for button element from the pseudo-element.
        Styles buttonStyles = xfGroupStyles.removeNestedStyles(pseudoElement);

        //  If they does not exist, create styles inheriting from parent ones.
        if (buttonStyles == null) {
            buttonStyles = StylingFactory.getDefaultInstance()
                .createInheritedStyles(protocol.getMarinerPageContext().getStylingEngine().getStyles(),
                        DisplayKeywords.INLINE);
        }

        //  Set default button colour.
        if (buttonStyles.getPropertyValues().getSpecifiedValue(StylePropertyDetails.COLOR) == null) {
            StyleValue color = (StyleValue) buttonColors.get(pseudoElement);
            if (color != null) {
                buttonStyles.getPropertyValues().setComputedValue(StylePropertyDetails.COLOR, color);
            }
        }
        // styles calculated so set it on buttonAttriubutes
        buttonAttributes.setStyles(buttonStyles);
        String id = buttonAttributes.getId();
        if(null == id){
            buttonAttributes.setId(protocol.getMarinerPageContext().generateUniqueFCID());
        }
       
        // Get and clear the content property for button styles.
        // The content will be inserted after element is created.
        StyleValue contentValue = buttonStyles.getPropertyValues().getSpecifiedValue(StylePropertyDetails.CONTENT);
           
        if (contentValue != null) {
            buttonStyles.getPropertyValues().clearPropertyValue(StylePropertyDetails.CONTENT);
        }
       
        // Special button renderer is created that use RemovableJavascriptContainer
        // RemovableJavascriptContainer is removed when associated buutton is removed
        // Otherwise there will be erros on result page because of attempts to access
        // not-existing buttons.
        ButtonDefaultRenderer internalButtonRenderer = new ButtonDefaultRenderer(){
           
            private JavaScriptContainer lastCreated;

            protected JavaScriptContainer createJavaScriptContainer(VolantisProtocol protocol) throws ProtocolException {
                // RemovableJavaScriptContainerFactory used because it creates containers
                // without storing them internally without removing.
                JavaScriptContainer container = 
                    RemovableJavaScriptContainerFactory.getInstance().createJavaScriptContainer();
                internalButtonsJavascriptContainer.put(buttonAttributes.getId(),
                        container);
                lastCreated = container;
                return container;
            }
View Full Code Here

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

        } else {
            protocol.writeCloseSpan(spanAttributes);
        }

        // 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);
View Full Code Here

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

        }       

        require(WidgetScriptModules.BASE_BB_DISMISS, protocol, attributes);

        // Render internal button
        buttonAttributes = new ButtonAttributes();      
        buttonAttributes.copy(attributes);
        buttonAttributes.setId(protocol.getMarinerPageContext().generateUniqueFCID());
        renderWidgetOpen(protocol, buttonAttributes);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.