Widget widget = constructWidget(parent.widget, classAttribute, nameAttribute, presetAttribute);
WidgetUserObject object = new WidgetUserObject(xmlNode, widget, newNode);
newNode.setUserObject(object);
newNode.setText(describeWidget(xmlNode));
NodeList childNodes = xmlNode.getChildNodes();
object.tableModel.addRow(new NameTableRow(object));
Element anchorNode = XMLUtils.getChild(xmlNode, "anchor");
if (anchorNode != null) {
object.tableModel.addRow(new PropertyTableRow(object, null, anchorNode));
}
for (int o = 0; o < childNodes.getLength(); o++) {
if (childNodes.item(o).getNodeName().equals("property")) {
Element propertyNode = (Element) childNodes.item(o);
String propertyName = propertyNode.getAttribute("name");
Object propertyValue = pf.constructProperty(propertyNode);
object.tableModel.addRow(new PropertyTableRow(object, propertyValue, propertyNode));
widget.setProperty(propertyName, propertyValue);
} else if (childNodes.item(o).getNodeName().equals("layout")) {
Element layoutNode = (Element) childNodes.item(o);
Object propertyValue = lf.constructLayout(widget, layoutNode);
object.tableModel.addRow(new PropertyTableRow(object, propertyValue, layoutNode));
widget.setProperty("layout", propertyValue);
} else if (childNodes.item(o).getNodeName().equals("emit")) {
Element emitNode = (Element) childNodes.item(o);
String name = emitNode.getAttribute("name");
TableRow row = new TableRow();
row.setValue("event", emitNode.getAttribute("event"));
row.setValue("name", name);
row.setValue(
"description",
widget.getWidgetInfo().getEventEntry(emitNode.getAttribute("event")).getDescription());
row.setValue("node", emitNode);
object.eventModel.addRow(row);
}
}
for (int i = 0; i < childNodes.getLength(); i++) {
if (childNodes.item(i).getNodeName().equals("widget")) {
Element childNode = (Element) childNodes.item(i);
/* Get the child's anchor subnode */
anchorNode = XMLUtils.getChild(childNode, "anchor");
Widget childWidget = traverseDocument(childNode, newNode);