01: package fr.aliacom.form.swt.maker;
02:
03: import org.w3c.dom.Element;
04:
05: import fr.aliacom.common.ui.table.BeanPropertiesMapping;
06: import fr.aliacom.form.common.IFormComponent;
07: import fr.aliacom.form.common.FormLoader;
08: import fr.aliacom.form.swt.BuilderFactory;
09: import fr.aliacom.form.swt.SWTBuilder;
10: import fr.aliacom.form.swt.ui.SWTTable;
11:
12: /**
13: * @author tom
14: *
15: * (C) 2001, 2002 Thomas Cataldo
16: */
17: public final class PropertyColumnBuilder extends SWTBuilder {
18:
19: /**
20: * @see fr.aliacom.form.swt.SWTBuilder#build(Element, IFormComponent, FormLoader, BuilderFactory)
21: */
22: public IFormComponent build(Element elem, IFormComponent parent,
23: FormLoader loader, BuilderFactory factory) {
24: SWTTable table = (SWTTable) parent;
25: BeanPropertiesMapping mapping = table.getModel()
26: .getColumnModel();
27: if (elem.getChildNodes().getLength() > 0) {
28: mapping.addProperty(elem.getAttribute("property"),
29: getNodeText(elem));
30: } else {
31: mapping.addProperty(elem.getAttribute("property"), elem
32: .getAttribute("property"));
33: }
34: return null;
35: }
36:
37: }
|