01: package com.xoetrope.svgscanner.model;
02:
03: import net.xoetrope.swing.XEdit;
04: import net.xoetrope.xml.XmlElement;
05: import net.xoetrope.xui.XPage;
06:
07: /**
08: *
09: * <p> Copyright (c) Xoetrope Ltd., 2001-2007, This software is licensed under
10: * the GNU Public License (GPL), please see license.txt for more details. If
11: * you make commercial use of this software you must purchase a commercial
12: * license from Xoetrope.</p>
13: * <p>$Revision: 1.7 $</p>
14: */
15: public class ColorElementHandler extends SynthElementHandler {
16: /** Creates a new instance of ColorElementHandler */
17: public ColorElementHandler() {
18: }
19:
20: public String getName(XmlElement e) {
21: String name = super .getName(e);
22: String attr;
23: if ((attr = e.getAttribute("id")) != null)
24: name += "(" + attr + ")";
25:
26: return name;
27: }
28:
29: /**
30: * Update the panel showing details of this type of element
31: * @param page the page with the UI for this component
32: */
33: public void updateUI(XPage page) {
34: XEdit idEdit = (XEdit) page.findComponent("colorIdEdit");
35: String value = objectElement.getAttribute("id");
36: idEdit.setText(value);
37:
38: XEdit idRefEdit = (XEdit) page.findComponent("colorIdRefEdit");
39: value = objectElement.getAttribute("idref");
40: idRefEdit.setText(value);
41:
42: XEdit nameEdit = (XEdit) page.findComponent("colorNameEdit");
43: value = objectElement.getAttribute("name");
44: nameEdit.setText(value);
45:
46: XEdit valueEdit = (XEdit) page.findComponent("colorValueEdit");
47: value = objectElement.getAttribute("value");
48: valueEdit.setText(value);
49: // colorValueBtn
50: }
51: }
|