01: package fr.aliacom.form.swt.maker;
02:
03: import org.eclipse.swt.SWT;
04: import org.eclipse.swt.layout.FillLayout;
05: import org.eclipse.swt.widgets.Composite;
06: import org.eclipse.swt.widgets.Group;
07: import org.w3c.dom.Element;
08:
09: import fr.aliacom.form.common.IFormComponent;
10: import fr.aliacom.form.common.FormLoader;
11: import fr.aliacom.form.swt.BuilderFactory;
12: import fr.aliacom.form.swt.SWTBuilder;
13: import fr.aliacom.form.swt.ui.SWTComposite;
14:
15: /**
16: * @author tom
17: *
18: * (C) 2001, 2002 Thomas Cataldo
19: */
20: public final class GroupBuilder extends SWTBuilder {
21:
22: /**
23: * @see fr.aliacom.form.swt.SWTBuilder#build(Element, IFormComponent, FormLoader, BuilderFactory)
24: */
25: public IFormComponent build(Element elem, IFormComponent parent,
26: FormLoader loader, BuilderFactory factory) {
27: Group g = new Group((Composite) parent.getNativeWidget(),
28: SWT.NONE);
29: g.setText(elem.getChildNodes().item(0).getNodeValue().trim());
30: g.setLayout(new FillLayout());
31: SWTComposite ret = new SWTComposite(g);
32: buildChildren(elem, ret, loader, factory);
33: g.pack();
34: return ret;
35: }
36:
37: }
|