01: /*
02: * Created on 30 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 GreaterElement extends CompareElement {
15:
16: public static String name = "Greater";
17: private String equals = "";
18:
19: protected static IPropertyDescriptor[] descriptors;
20:
21: public static final String EQUALS = "equals";
22: public static final String FIELDVALUE = "field-value";
23: public static final String OTHERVALUE = "other-value";
24: static {
25: descriptors = new IPropertyDescriptor[] {
26: new TextPropertyDescriptor(EQUALS, "equals"),
27: new TextPropertyDescriptor(FIELDVALUE, "field-value"),
28: new TextPropertyDescriptor(OTHERVALUE, "other-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 getEquals() {
40: return equals;
41: }
42:
43: public void setEquals(String s) {
44: equals = s;
45: firePropertyChange(EQUALS, null, s);
46: }
47:
48: public IPropertyDescriptor[] getPropertyDescriptors() {
49: return descriptors;
50: }
51:
52: public Object getPropertyValue(Object propName) {
53: if (EQUALS.equals(propName))
54: return getEquals();
55: if (FIELDVALUE.equals(propName))
56: return getFieldValue();
57: if (OTHERVALUE.equals(propName))
58: return getOtherValue();
59: return super .getPropertyValue(propName);
60: }
61:
62: public void setPropertyValue(Object id, Object value) {
63: if (id == EQUALS)
64: setEquals((String) value);
65: if (id == FIELDVALUE)
66: setFieldValue((String) value);
67: if (id == OTHERVALUE)
68: setOtherValue((String) value);
69: }
70:
71: }
|