if (repeaterWidget && !(widget instanceof Repeater)) {
throw new SAXException("WoodyTemplateTransformer: the element \"repeater-widget\" can only be used for repeater widgets.");
}
} else if (localName.equals(WIDGET_LABEL)) {
checkContextWidgetAvailable(qName);
Widget widget = getWidget(attributes);
widget.generateLabel(contentHandler);
} else if (localName.equals(REPEATER_WIDGET_LABEL)) {
checkContextWidgetAvailable(qName);
Widget widget = getWidget(attributes);
if (!(widget instanceof Repeater)) {
throw new SAXException("WoodyTemplateTransformer: the element \"repeater-widget-label\" can only be used for repeater widgets.");
}
String widgetId = attributes.getValue("widget-id");
if (widgetId == null || widgetId.length() == 0) {
throw new SAXException("WoodyTemplateTransformer: the element \"repeater-widget-label\" requires a \"widget-id\" attribute.");
}
((Repeater)widget).generateWidgetLabel(widgetId, contentHandler);
} else if (localName.equals(REPEATER_SIZE)) {
checkContextWidgetAvailable(qName);
Widget widget = getWidget(attributes);
if (!(widget instanceof Repeater))
throw new SAXException("WoodyTemplateTransformer: the element \"repeater-size\" can only be used for repeater widgets.");
contentHandler.startPrefixMapping(Constants.WI_PREFIX, Constants.WI_NS);
((Repeater)widget).generateSize(contentHandler);
contentHandler.endPrefixMapping(Constants.WI_PREFIX);