1 16 package org.apache.cocoon.woody.formmodel; 17 18 import org.apache.cocoon.woody.Constants; 19 import org.apache.cocoon.woody.util.DomHelper; 20 import org.w3c.dom.Element ; 21 22 28 public class UnionDefinitionBuilder extends AbstractWidgetDefinitionBuilder { 29 30 public WidgetDefinition buildWidgetDefinition(Element element) throws Exception { 31 UnionDefinition definition = new UnionDefinition(); 32 setLocation(element, definition); 33 setId(element, definition); 34 definition.setCaseWidgetId(DomHelper.getAttribute(element, "case", "")); 35 setDisplayData(element, definition); 36 setValidators(element, definition); 37 38 Element widgetsElement = DomHelper.getChildElement(element, Constants.WD_NS, "widgets", true); 39 Element [] widgetElements = DomHelper.getChildElements(widgetsElement, Constants.WD_NS); 41 for (int i = 0; i < widgetElements.length; i++) { 42 Element widgetElement = widgetElements[i]; 43 WidgetDefinition widgetDefinition = buildAnotherWidgetDefinition(widgetElement); 44 definition.addWidgetDefinition(widgetDefinition); 45 } 46 47 return definition; 48 } 49 } 51 52 | Popular Tags |