01: package fr.aliacom.form.swt.maker;
02:
03: import org.w3c.dom.Element;
04:
05: import fr.aliacom.common.ui.IColor;
06: import fr.aliacom.common.ui.ITextArea;
07: import fr.aliacom.form.common.FormLoader;
08: import fr.aliacom.form.common.IFormComponent;
09: import fr.aliacom.form.common.ToolkitManager;
10: import fr.aliacom.form.swt.BuilderFactory;
11: import fr.aliacom.form.swt.SWTBuilder;
12:
13: /**
14: * @author tom
15: *
16: * (C) 2001, 2003 Thomas Cataldo
17: */
18: public class StyleBuilder 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: ITextArea area = (ITextArea) parent;
26: IColor color = ToolkitManager.getToolkit().newColor(
27: Integer.parseInt(elem.getAttribute("r")),
28: Integer.parseInt(elem.getAttribute("g")),
29: Integer.parseInt(elem.getAttribute("b")));
30: area.addStyle(elem.getAttribute("name"), color);
31: return null;
32: }
33:
34: }
|