if(!isWidgetSupported(protocol)) {
return;
}
GalleryAttributes galleryAttributes = (GalleryAttributes) attributes;
protocol.writeCloseDiv(galleryDivAttributes);
// Render enclosed item-display ids.
for (int index = 0; index < displayIds.size(); index++) {
String displayId = (String) displayIds.get(index);
if (index != 0)
scriptWriter.write(",");
scriptWriter.write(createJavaScriptString(displayId));
addUsedWidgetId(displayId);
}
displayIds = null;
scriptWriter.write("]");
// Render reference to gallery items
String itemsId = galleryAttributes.getItems();
if (itemsId == null) {
itemsId = protocol.getMarinerPageContext().generateFCID("GALLERY_ITEMS");
}
scriptWriter.write(",items:" + createJavaScriptString(itemsId));
addUsedWidgetId(itemsId);
if (galleryAttributes.getSlideshow() != null) {
scriptWriter.write(",slideshow:" + createJavaScriptString(galleryAttributes.getSlideshow()));
addUsedWidgetId(galleryAttributes.getSlideshow());
}
if (galleryAttributes.getSlideshowPopup() != null) {
scriptWriter.write(",slideshowPopup:" + createJavaScriptString(galleryAttributes.getSlideshowPopup()));
addUsedWidgetId(galleryAttributes.getSlideshowPopup());
}
// Extract style values and render them into JavaScript
StylesExtractor stylesExtractor = createStylesExtractor(protocol, galleryAttributes.getStyles());
double slideshowLaunchDelay = stylesExtractor.getSlideshowLaunchDelay();
if (!Double.isInfinite(slideshowLaunchDelay)) {
scriptWriter.write(",slideshowLaunchDelay:" + Double.toString(slideshowLaunchDelay));