01: package net.xoetrope.builder.editor.components.swing;
02:
03: import java.awt.AWTEvent;
04: import java.awt.Component;
05:
06: import net.xoetrope.swing.XComboBox;
07: import net.xoetrope.builder.editor.XEditorProject;
08: import net.xoetrope.builder.editor.XPropertiesEditor;
09: import net.xoetrope.builder.editor.components.PropertyHelper;
10: import net.xoetrope.builder.editor.XPageResource;
11: import net.xoetrope.xui.data.XListBinding;
12: import net.xoetrope.xui.XProjectManager;
13: import net.xoetrope.xui.data.XDataBinding;
14: import net.xoetrope.xui.data.XModel;
15:
16: /**
17: * A helper for the XComboBox types
18: * <p> Copyright (c) Xoetrope Ltd., 2002-2003</p>
19: * <p> $Revision: 1.19 $</p>
20: */
21: public class XComboBoxHelper extends PropertyHelper {
22: protected String extraProperties[] = { "ActionHandler", "Data",
23: "DestinationData" };
24:
25: public XComboBoxHelper() {
26: className = XComboBox.class.toString();
27: componentType = "ComboBox";
28: extraPropertyNames = extraProperties;
29: }
30:
31: /**
32: * Set the value of the property exposed by the component
33: * @param pageResource the pageResource that owns/manages the component
34: * @param comp the component instance
35: * @param i the component property index
36: * @return the value
37: */
38: public void setPropertyValue(XPageResource pageResource,
39: Component comp, int i, String value) {
40: if (i == numBasicProperties + 1)
41: setData(pageResource, comp, new XListBinding(comp, value));
42: else if (i == numBasicProperties + 2) {
43: XListBinding binding = new XListBinding(comp,
44: getPropertyValue(pageResource, comp,
45: numBasicProperties + 1));
46: binding.setOutputPath(XModel.prefixOutputPath(value));
47: setData(pageResource, comp, binding);
48: } else
49: super.setPropertyValue(pageResource, comp, i, value);
50: }
51: }
|