}
// Require script module
require(WIDGET_TICKER, protocol, attributes);
UpdateStatusAttributes updateStatusAttributes =
(UpdateStatusAttributes) attributes;
// Open span element enclosing the widget.
SpanAttributes spanAttributes = new SpanAttributes();
spanAttributes.copy(attributes);
protocol.writeOpenSpan(spanAttributes);
// Render four elements for each status value.
Element normalElement = renderStatusElement(protocol,
updateStatusAttributes, StatefulPseudoClasses.MCS_NORMAL);
Element busyElement = renderStatusElement(protocol,
updateStatusAttributes, StatefulPseudoClasses.MCS_BUSY);
Element failedElement = renderStatusElement(protocol,
updateStatusAttributes, StatefulPseudoClasses.MCS_FAILED);
Element suspendedElement = renderStatusElement(protocol,
updateStatusAttributes, StatefulPseudoClasses.MCS_SUSPENDED);
// Close span element enclosing the widget.
protocol.writeCloseSpan(spanAttributes);
// Prepare Javascript content.
StringWriter scriptWriter = new StringWriter();
// Finally, render the JavaScript part.
scriptWriter.write("Ticker.createUpdateStatus({");
scriptWriter.write("normalId:" +
createJavaScriptString(normalElement.getAttributeValue("id")));
scriptWriter.write(",busyId:" +
createJavaScriptString(busyElement.getAttributeValue("id")));
scriptWriter.write(",failedId:" +
createJavaScriptString(failedElement.getAttributeValue("id")));
scriptWriter.write(",suspendedId:" + createJavaScriptString(
suspendedElement.getAttributeValue("id")));
scriptWriter.write(",displayStyle:"
+ createJavaScriptString(updateStatusAttributes.getStyles().
getPropertyValues().getComputedValue(
StylePropertyDetails.DISPLAY).getStandardCSS()));
scriptWriter.write("})");
addUsedFeedPollerId(protocol);