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 StateElementHandler extends SynthElementHandler {
16:
17: /** Creates a new instance of StateElementHandler */
18: public StateElementHandler() {
19: }
20:
21: public String getName(XmlElement e) {
22: String name = "state";
23: String attr;
24: if ((attr = e.getAttribute("id")) != null)
25: name += "(" + attr + ")";
26: else if ((attr = e.getAttribute("value")) != null)
27: name += "(" + attr + ")";
28:
29: return name;
30: }
31:
32: /**
33: * Update the panel showing details of this type of element
34: * @param page the page with the UI for this component
35: */
36: public void updateUI(XPage page) {
37: XEdit idEdit = (XEdit) page.findComponent("stateIdEdit");
38: String value = objectElement.getAttribute("id");
39: idEdit.setText(value);
40:
41: XEdit idRefEdit = (XEdit) page.findComponent("stateIdRefEdit");
42: value = objectElement.getAttribute("idref");
43: idRefEdit.setText(value);
44:
45: XEdit cloneEdit = (XEdit) page.findComponent("stateCloneEdit");
46: value = objectElement.getAttribute("clone");
47: cloneEdit.setText(value);
48:
49: XEdit valueEdit = (XEdit) page.findComponent("stateValueEdit");
50: value = objectElement.getAttribute("value");
51: valueEdit.setText(value);
52: }
53: }
|