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 DefaultsPropertyElementHandler extends SynthElementHandler {
17:
18: /** Creates a new instance of DefaultsPropertyElementHandler */
19: public DefaultsPropertyElementHandler() {
20: }
21:
22: public String getName(XmlElement e) {
23: String name = super .getName(e);
24: String attr;
25: if ((attr = e.getAttribute("key")) != null)
26: name += "(" + attr + ")";
27:
28: return name;
29: }
30:
31: /**
32: * Update the panel showing details of this type of element
33: * @param page the page with the UI for this component
34: */
35: public void updateUI(XPage page) {
36: XEdit keyEdit = (XEdit) page.findComponent("defaultsKeyEdit");
37: String value = objectElement.getAttribute("key");
38: keyEdit.setText(value);
39:
40: XComboBox typeCombo = (XComboBox) page
41: .findComponent("defaultsTypeCombo");
42: value = objectElement.getAttribute("type");
43: typeCombo.setSelectedItem(value);
44:
45: XEdit dataEdit = (XEdit) page.findComponent("defaultsDataEdit");
46: value = objectElement.getAttribute("value");
47: dataEdit.setText(value);
48: }
49: }
|