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

Examples of com.volantis.mcs.protocols.widgets.internal.attributes.BlockContainerAttributes


       
        getWidgetDefaultModule(protocol).closingContainer();

        Element divElement = closeDivElement(protocol);
       
        BlockContainerAttributes blockContainerAttributes = (BlockContainerAttributes) attributes;
       
        // Prepare Javascript Container.
        StringBuffer buffer = new StringBuffer();
       
        // Finally, render the JavaScript part.
        if (attributes.getId() != null) {
            buffer.append("Widget.register(")
                .append(createJavaScriptString(attributes.getId()))
                .append(",");
           
            addCreatedWidgetId(attributes.getId());
        }
       
        buffer.append("new Widget.Internal.BlockContainer(")
            .append(createJavaScriptString(divElement.getAttributeValue("id")));
       
        if (blockContainerAttributes.getContent() != null) {
            buffer.append(",{content:")
                .append("Widget.getInstance(")
                .append(createJavaScriptString(blockContainerAttributes.getContent()))
                .append(")}");
           
            addUsedWidgetId(blockContainerAttributes.getContent());
        }
       
        buffer.append(")");
       
        // Render closing parentheses for Widget.Register invokation
View Full Code Here


        StopwatchAttributes stopwatchAttributes = (StopwatchAttributes)attributes;
       
        protocol.writeCloseSpan(stopwatchSpanAttributes);
       
        // insert an empty block container which will be used to store split times
        BlockContainerAttributes blockContainerAttributes =
            new BlockContainerAttributes();
       
        blockContainerAttributes.setId(protocol.getMarinerPageContext().generateUniqueFCID());
       
        renderWidgetOpen(protocol, blockContainerAttributes);
       
        renderWidgetClose(protocol, blockContainerAttributes);
       
       
        // retrive list of attributes of clock content element which are
        // within the timer element.
        List contentAttributes = stopwatchAttributes.getContentAttributes();
       
        // create ClockContentHandler to merge contents
        ClockContextHandler clockContextHandler = new ClockContextHandler();
       
        clockContextHandler.mergeContentAttributes(contentAttributes);
   
        String[] digits = clockContextHandler.getClockContentIds("digits");
        String[] separators = clockContextHandler.getClockContentIds("separators");
   
        Styles styles = stopwatchAttributes.getStyles();
       
        StylesExtractor stylesExtractor = createStylesExtractor(
                protocol, styles);
       
        // count mode can be set to split and lap, default is split
        String count_mode = "split";
       
        if (styles.getPropertyValues().getComputedValue(StylePropertyDetails.MCS_COUNT_MODE) == StyleKeywords.LAP) {
            count_mode = "lap";
        }
       
        String dateTimeFormat =
            getDateTimeFormat(stylesExtractor.getDateTimeFormat(),specialMarks);

        StringBuffer textBuffer = new StringBuffer();
       
        textBuffer.append(createJavaScriptWidgetRegistrationOpening(stopwatchSpanAttributes.getId()))
                .append("new Widget.Stopwatch(")
                .append(createJavaScriptString(stopwatchSpanAttributes.getId()))
                .append(", '").append(count_mode).append("', ")
                .append(createJavaScriptWidgetReference(blockContainerAttributes.getId()))
                .append(", {")
                .append("format: [").append(dateTimeFormat).append("], ")
                .append("digits: [").append(splitIds(digits)).append("], ")
                .append("separators: [")
                .append(splitIds(separators)).append("]")
                .append("})")
                .append(createJavaScriptWidgetRegistrationClosure());

        //clock-content elements must be rendered before stopwatch element
        addCreatedWidgetId(stopwatchSpanAttributes.getId());
        addUsedWidgetIds(digits);
        addUsedWidgetIds(separators);
        addUsedWidgetId(blockContainerAttributes.getId());

        writeJavaScript(textBuffer.toString());       
  }
View Full Code Here

       
        JavaScriptArrayAttributes listAttributes = (JavaScriptArrayAttributes) getCurrentAttributes(protocol);
       
        renderWidgetClose(protocol, listAttributes);
       
        BlockContainerAttributes blockContainerAttributes = new BlockContainerAttributes();
       
        blockContainerAttributes.copy(attributes);
       
        blockContainerAttributes.setId(protocol.getMarinerPageContext().generateUniqueFCID());
       
        renderWidgetOpen(protocol, blockContainerAttributes);
       
        renderWidgetClose(protocol, blockContainerAttributes);
       
        DeckAttributes deckAttributes = (DeckAttributes) attributes;

        // Prepare Javascript content.
        StringBuffer buffer = new StringBuffer();
       
        if (attributes.getId() != null) {
            buffer.append(createJavaScriptWidgetRegistrationOpening(attributes.getId()));

            addCreatedWidgetId(attributes.getId());
        }
       
        buffer.append("new Widget.Deck(")
            .append(createJavaScriptWidgetReference(blockContainerAttributes.getId()))
            .append(",{");
       
        // Render display mode.
        buffer.append("mode:")
            .append(createJavaScriptString(deckAttributes.getStyles()
                    .getPropertyValues().getComputedValue(StylePropertyDetails.MCS_DECK_MODE)
                    .getStandardCSS()));

        // Render deck pages: loaded or embeeded in static way
        LoadAttributes loadAttributes = deckAttributes.getLoadAttributes();
       
        if (loadAttributes != null) {
            String when = loadAttributes.getWhen();
            if (when == null) when = "onload";
           
            buffer.append(",load: new Widget.DeckLoad({src:")
                .append(createJavaScriptString(loadAttributes.getSrc()))
                .append(",when:")
                .append(createJavaScriptString(when))
                .append("})");                       
        } else {
            buffer.append(",pages:")
                .append(createJavaScriptWidgetReference(listAttributes.getId()));
        }
       
        buffer.append("})");
       
        addUsedWidgetId(blockContainerAttributes.getId());

        addUsedWidgetId(listAttributes.getId());
       
        if (attributes.getId() != null) {
            buffer.append(createJavaScriptWidgetRegistrationClosure());
View Full Code Here

            .getWidgetRenderer(innerEffectBlockAttributes)
            .renderOpen(protocol, innerEffectBlockAttributes);

        // Open BlockContainer widget, which will be used to change the content
        // of this Block widget.
        blockContainerAttributes = new BlockContainerAttributes();
       
        blockContainerAttributes.setId(protocol.getMarinerPageContext().generateUniqueFCID());
       
        blockContainerAttributes.setStyles(StylingFactory.getDefaultInstance()
                .createInheritedStyles(
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.widgets.internal.attributes.BlockContainerAttributes

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.