01: /*
02: * Created on 26 avr. 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 IncElement extends NoChild {
15:
16: public static String name = "Inc";
17: private String field = "";
18: private String value = "";
19:
20: protected static IPropertyDescriptor[] descriptors;
21:
22: public static final String FIELD = "field";
23: public static final String VALUE = "value";
24: static {
25: descriptors = new IPropertyDescriptor[] {
26: new TextPropertyDescriptor(FIELD, "field"),
27: new TextPropertyDescriptor(VALUE, "value") };
28:
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 getField() {
40: return field;
41: }
42:
43: public void setField(String s) {
44: field = s;
45: firePropertyChange(FIELD, null, s);
46: }
47:
48: public String getValue() {
49: return value;
50: }
51:
52: public void setValue(String s) {
53: value = s;
54: firePropertyChange(VALUE, null, s);
55: }
56:
57: public IPropertyDescriptor[] getPropertyDescriptors() {
58: return descriptors;
59: }
60:
61: public Object getPropertyValue(Object propName) {
62: if (FIELD.equals(propName))
63: return getField();
64: if (VALUE.equals(propName))
65: return getValue();
66: return super .getPropertyValue(propName);
67: }
68:
69: public void setPropertyValue(Object id, Object value) {
70: if (id == FIELD)
71: setField((String) value);
72: if (id == VALUE)
73: setValue((String) value);
74:
75: }
76:
77: }
|