01: /*
02: * Created on 3 mai 2005
03: *
04: */
05: package org.openwfe.gpe.model;
06:
07: import org.eclipse.ui.views.properties.IPropertyDescriptor;
08: import org.eclipse.ui.views.properties.TextPropertyDescriptor;
09:
10: /**
11: * @author Christelle
12: *
13: */
14: public class DefinedElement extends NoChild {
15: public static String name = "Defined";
16: private String variableValue = "";
17: private String fieldValue = "";
18:
19: protected static IPropertyDescriptor[] descriptors;
20:
21: public static final String VARIABLEVALUE = "variable-value";
22: public static final String FIELDVALUE = "field-value";
23:
24: static {
25: descriptors = new IPropertyDescriptor[] {
26: new TextPropertyDescriptor(VARIABLEVALUE,
27: "variable-value"),
28: new TextPropertyDescriptor(FIELDVALUE, "field-value"), };
29: }
30:
31: public String getName() {
32: return name;
33: }
34:
35: public void setName(String s) {
36: name = s;
37: }
38:
39: public String getVariableValue() {
40: return variableValue;
41: }
42:
43: public void setVariableValue(String s) {
44: variableValue = s;
45: firePropertyChange(VARIABLEVALUE, null, s);
46: }
47:
48: public String getFieldValue() {
49: return fieldValue;
50: }
51:
52: public void setFieldValue(String s) {
53: fieldValue = s;
54: firePropertyChange(FIELDVALUE, null, s);
55: }
56:
57: public IPropertyDescriptor[] getPropertyDescriptors() {
58: return descriptors;
59: }
60:
61: public Object getPropertyValue(Object propName) {
62: if (VARIABLEVALUE.equals(propName))
63: return getVariableValue();
64: if (FIELDVALUE.equals(propName))
65: return getFieldValue();
66: return super .getPropertyValue(propName);
67: }
68:
69: public void setPropertyValue(Object id, Object value) {
70: if (id == VARIABLEVALUE)
71: setVariableValue((String) value);
72: if (id == FIELDVALUE)
73: setFieldValue((String) value);
74: }
75:
76: }
|