public void parse(XMLElement elem, String fieldName, JClassType type,
UiBinderWriter writer) throws UnableToCompleteException {
// Consume the single layout element.
XMLElement layout = elem.consumeSingleChildElement();
if (!isLayoutManagerElement(layout)) {
writer.die(
"In %1$s, child must be an instance of LayoutManager but found %2$s",
elem, layout);
}
Map<String, String> layoutAttrs = new HashMap<String, String>();
while (layout.getAttributeCount() > 0) {
XMLAttribute attr = layout.getAttribute(0);
layoutAttrs.put(attr.getLocalName(), attr.consumeStringValue());
}
// Parse children.
for (XMLElement child : layout.consumeChildElements()) {
if (!writer.isWidgetElement(child)) {
writer.die("%s can contain only widgets, but found %s", elem, child);
}
if (child.getLocalName().endsWith("LayoutData")) {
Map<String, String> layoutDataAttrs = new HashMap<String, String>();
while (child.getAttributeCount() > 0) {
XMLAttribute attr = child.getAttribute(0);
layoutDataAttrs.put(attr.getLocalName(), attr.consumeStringValue());
}
XMLElement widget = child.consumeSingleChildElement();
String childFieldName = writer.parseElementToField(child);
String widgetFieldName = writer.parseElementToField(widget);
boolean decorated = false;