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