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