01: package fr.aliacom.form.swt.maker;
02:
03: import org.w3c.dom.Element;
04:
05: import fr.aliacom.form.common.FormLoader;
06: import fr.aliacom.form.common.IFormComponent;
07: import fr.aliacom.form.swt.BuilderFactory;
08: import fr.aliacom.form.swt.SWTCommandBuilder;
09: import fr.aliacom.form.swt.ui.SWTButton;
10:
11: /**
12: * @author tom
13: *
14: * (C) 2001, 2002 Thomas Cataldo
15: */
16: public final class ButtonBuilder extends SWTCommandBuilder {
17:
18: /**
19: * @see fr.aliacom.form.swt.SWTBuilder#build(Element, IFormComponent, FormLoader, BuilderFactory)
20: */
21: public IFormComponent build(Element elem, IFormComponent parent,
22: FormLoader loader, BuilderFactory factory) {
23: SWTButton ret = new SWTButton(parent);
24:
25: if (elem.hasAttribute("pythonAction")) {
26: initFromPythonAction(ret, elem, loader.getForm(), loader
27: .getCtx());
28: } else {
29: initFromJavaAction(ret, elem, loader.getForm());
30: }
31:
32: return ret;
33: }
34:
35: }
|