01: package fr.aliacom.form.swt.maker;
02:
03: import org.w3c.dom.Element;
04:
05: import fr.aliacom.common.ui.ITree;
06: import fr.aliacom.common.ui.tree.TreeModel;
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.tree.CommandTreeNode;
12:
13: /**
14: * @author tom
15: *
16: * (C) 2001, 2002 Thomas Cataldo
17: */
18: public class TreeRootBuilder 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: String text = getNodeText(elem);
26: CommandTreeNode root = new CommandTreeNode(null, null, text,
27: (elem.getAttribute("icon").length() > 0 ? elem
28: .getAttribute("icon") : null));
29: buildChildren(elem, root, loader, factory);
30: ITree tree = (ITree) parent;
31: tree.setModel(new TreeModel(root));
32: return null;
33: }
34:
35: }
|