01: package fr.aliacom.form.swt.maker;
02:
03: import org.eclipse.swt.SWT;
04: import org.eclipse.swt.widgets.Menu;
05: import org.eclipse.swt.widgets.Shell;
06: import org.w3c.dom.Element;
07:
08: import fr.aliacom.form.common.IFormComponent;
09: import fr.aliacom.form.common.FormLoader;
10: import fr.aliacom.form.swt.BuilderFactory;
11: import fr.aliacom.form.swt.SWTBuilder;
12: import fr.aliacom.form.swt.ui.SWTMenuBar;
13:
14: /**
15: * @author tom
16: *
17: * (C) 2001, 2002 Thomas Cataldo
18: */
19: public final class MenubarBuilder extends SWTBuilder {
20:
21: /**
22: * @see fr.aliacom.form.swt.SWTBuilder#build(Element, IFormComponent, FormLoader, BuilderFactory)
23: */
24: public IFormComponent build(Element elem, IFormComponent parent,
25: FormLoader loader, BuilderFactory factory) {
26: Shell shell = (Shell) loader.getForm().getNativeWidget();
27: Menu bar = new Menu(shell, SWT.BAR);
28: SWTMenuBar ret = new SWTMenuBar(bar);
29: buildChildren(elem, ret, loader, factory);
30: shell.setMenuBar(bar);
31: return ret;
32: }
33:
34: }
|