01: package fr.aliacom.form.swt.maker;
02:
03: import org.eclipse.swt.widgets.Composite;
04: import org.w3c.dom.Element;
05:
06: import fr.aliacom.form.common.FormComponentLoader;
07: import fr.aliacom.form.common.FormLoader;
08: import fr.aliacom.form.common.IFormComponent;
09: import fr.aliacom.form.swt.BuilderFactory;
10: import fr.aliacom.form.swt.SWTBuilder;
11: import fr.aliacom.form.swt.ui.SWTTextArea;
12:
13: /**
14: * @author tom
15: *
16: * (C) 2001, 2003 Thomas Cataldo
17: */
18: public class TextAreaBuilder extends SWTBuilder {
19:
20: /**
21: * @see fr.aliacom.form.swt.SWTBuilder#build(org.w3c.dom.Element, fr.aliacom.form.common.IFormComponent, fr.aliacom.form.common.FormLoader, fr.aliacom.form.swt.BuilderFactory)
22: */
23: public IFormComponent build(Element elem, IFormComponent parent,
24: FormLoader loader, BuilderFactory factory) {
25: SWTTextArea text = new SWTTextArea((Composite) parent
26: .getNativeWidget(), elem.getAttribute("property"));
27:
28: if (elem.hasAttribute("editable")) {
29: text.setEditable(elem.getAttribute("editable").equals(
30: "true") ? true : false);
31: }
32: if (elem.hasAttribute("enabled")) {
33: text.setEditable(elem.getAttribute("enabled")
34: .equals("true") ? true : false);
35: }
36: if (elem.hasAttribute("scrollOnAppend")) {
37: text.setScrollOnAppend(elem.getAttribute("scrollOnAppend")
38: .equals("true") ? true : false);
39: }
40:
41: if (elem.hasAttribute("bean")) {
42: loader.addLoader(elem.getAttribute("bean"),
43: new FormComponentLoader(text));
44: }
45: buildChildren(elem, text, loader, factory);
46: return text;
47: }
48:
49: }
|