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

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


        // Initialise superclass.
        super(WidgetElements.DIGITAL_CLOCK, context);

        // Create an instance of DigitalClock attributes.
        // It'll be initialised later in initialiseAttributes() method.
        protocolAttributes = new DigitalClockAttributes();
    }
View Full Code Here


        if(!isWidgetSupported(protocol)) {
            return;
        }               

        DigitalClockAttributes digitalClockAttributes = (DigitalClockAttributes)attributes;

        // require AJAX script module
        if( digitalClockAttributes.getRefreshAttributes() != null ) {
            require(WidgetScriptModules.BASE_AJAX, protocol, attributes);
        }

        protocol.writeCloseSpan(clockSpanAttributes);
       
        //retrive list of attributes of clock content element which are
        // within the timer element.
        List contentAttributes = digitalClockAttributes.getContentAttributes();
       
        // create ClockContentHandler to merge contents
        ClockContextHandler clockContextHandler = new ClockContextHandler();
       
        clockContextHandler.mergeContentAttributes(contentAttributes);
   
        String[] digits = clockContextHandler.getClockContentIds("digits");
        String[] days = clockContextHandler.getClockContentIds("days");
        String[] months = clockContextHandler.getClockContentIds("months");
        String[] ampm = clockContextHandler.getClockContentIds("ampm");
        String[] separators = clockContextHandler.getClockContentIds("separators");
   
        Styles styles = digitalClockAttributes.getStyles();
       
        StylesExtractor stylesExtractor = createStylesExtractor(
                protocol, styles);
               
        String dateTimeFormat =
            getDateTimeFormat(stylesExtractor.getDateTimeFormat(),specialMarks);
       
        RefreshAttributes refreshAttributes =
            digitalClockAttributes.getRefreshAttributes();
       
        StringBuffer textRefreshAttr = new StringBuffer();
        if(refreshAttributes != null) {
            textRefreshAttr.append(", refreshURL: ")
            .append(createJavaScriptString(refreshAttributes.getSrc()))
            .append(", refreshInterval: "+ refreshAttributes.getInterval());
        }       
       
        StringBuffer textBuffer = new StringBuffer();
       
        textBuffer.append(createJavaScriptWidgetRegistrationOpening(digitalClockAttributes.getId()))
                .append("new Widget.Clock(")
                .append(createJavaScriptString(clockSpanAttributes.getId()))
                .append(", {")
                .append("format: [").append(dateTimeFormat).append("], ")
                .append("digits: [").append(splitIds(digits)).append("], ")
View Full Code Here

TOP

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

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.