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 UndefinedElement extends NoChild {
15: public static String name = "Undefined";
16: private String fieldValue = "";
17: private String variableValue = "";
18:
19: protected static IPropertyDescriptor[] descriptors;
20:
21: public static final String FIELDVALUE = "field-value";
22: public static final String VARIABLEVALUE = "variable-value";
23: static {
24: descriptors = new IPropertyDescriptor[] {
25: new TextPropertyDescriptor(FIELDVALUE, "field-value"),
26: new TextPropertyDescriptor(VARIABLEVALUE,
27: "variable-value"), };
28: }
29:
30: public String getName() {
31: return name;
32: }
33:
34: public void setName(String s) {
35: name = s;
36: }
37:
38: public String getFieldValue() {
39: return fieldValue;
40: }
41:
42: public void setFieldValue(String s) {
43: fieldValue = s;
44: firePropertyChange(FIELDVALUE, null, s);
45: }
46:
47: public String getVariableValue() {
48: return variableValue;
49: }
50:
51: public void setVariableValue(String s) {
52: variableValue = s;
53: firePropertyChange(VARIABLEVALUE, null, s);
54: }
55:
56: public IPropertyDescriptor[] getPropertyDescriptors() {
57: return descriptors;
58: }
59:
60: public Object getPropertyValue(Object propName) {
61: if (FIELDVALUE.equals(propName))
62: return getFieldValue();
63: if (VARIABLEVALUE.equals(propName))
64: return getVariableValue();
65: return super .getPropertyValue(propName);
66: }
67:
68: public void setPropertyValue(Object id, Object value) {
69: if (id == FIELDVALUE)
70: setFieldValue((String) value);
71: if (id == VARIABLEVALUE)
72: setVariableValue((String) value);
73: }
74:
75: }
|