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.ButtonGroup;
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.SWTCardPanel;
12:
13: /**
14: * @author tom
15: *
16: * (C) 2001, 2003 Thomas Cataldo
17: */
18: public final class CardPanelBuilder 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:
26: SWTCardPanel cp = new SWTCardPanel((Composite) parent
27: .getNativeWidget());
28: buildChildren(elem, cp, loader, factory);
29: cp.displayFirst();
30:
31: if (elem.hasAttribute("connectToGroup")) {
32: ButtonGroup group = (ButtonGroup) loader.getCtx().get(
33: elem.getAttribute("connectToGroup")).getValue();
34: group.addGroupListener(cp);
35: }
36:
37: return cp;
38: }
39:
40: }
|