001: /*
002: * Created on 26 avr. 2005
003: *
004: */
005: package org.openwfe.gpe.model;
006:
007: import org.eclipse.ui.views.properties.IPropertyDescriptor;
008: import org.eclipse.ui.views.properties.TextPropertyDescriptor;
009:
010: /**
011: * @author Christelle
012: *
013: */
014: public class SetElement extends NoChild {
015:
016: public static String name = "Set";
017: private String variable = "";
018: private String field = "";
019: private String value = "";
020: private String fieldValue = "";
021: private String variableValue = "";
022: private String type = "";
023: private String functionValue = "";
024:
025: protected static IPropertyDescriptor[] descriptors;
026:
027: public static final String VARIABLE = "variable";
028: public static final String FIELD = "field";
029: public static final String VALUE = "value";
030: public static final String FIELDVALUE = "field-value";
031: public static final String VARIABLEVALUE = "variable-value";
032: public static final String TYPE = "type";
033: public static final String FUNCTIONVALUE = "function-value";
034: static {
035: descriptors = new IPropertyDescriptor[] {
036: new TextPropertyDescriptor(VARIABLE, "variable"),
037: new TextPropertyDescriptor(FIELD, "field"),
038: new TextPropertyDescriptor(VALUE, "value"),
039: new TextPropertyDescriptor(FIELDVALUE, "field-value"),
040: new TextPropertyDescriptor(VARIABLEVALUE,
041: "variable-value"),
042: new TextPropertyDescriptor(TYPE, "type"),
043: new TextPropertyDescriptor(FUNCTIONVALUE,
044: "function-value"), };
045: }
046:
047: public String getName() {
048: return name;
049: }
050:
051: public void setName(String s) {
052: name = s;
053: }
054:
055: public String getVariable() {
056: return variable;
057: }
058:
059: public void setVariable(String s) {
060: variable = s;
061: firePropertyChange(VARIABLE, null, s);
062: }
063:
064: public String getField() {
065: return field;
066: }
067:
068: public void setField(String s) {
069: field = s;
070: firePropertyChange(FIELD, null, s);
071: }
072:
073: public String getValue() {
074: return value;
075: }
076:
077: public void setValue(String s) {
078: value = s;
079: firePropertyChange(VALUE, null, s);
080: }
081:
082: public String getFieldValue() {
083: return fieldValue;
084: }
085:
086: public void setFieldValue(String s) {
087: fieldValue = s;
088: firePropertyChange(FIELDVALUE, null, s);
089: }
090:
091: public String getVariableValue() {
092: return variableValue;
093: }
094:
095: public void setVariableValue(String s) {
096: variableValue = s;
097: firePropertyChange(VARIABLEVALUE, null, s);
098: }
099:
100: public String getType() {
101: return type;
102: }
103:
104: public void setType(String s) {
105: type = s;
106: firePropertyChange(TYPE, null, s);
107: }
108:
109: public String getFunctionValue() {
110: return functionValue;
111: }
112:
113: public void setFunctionValue(String s) {
114: functionValue = s;
115: firePropertyChange(FUNCTIONVALUE, null, s);
116: }
117:
118: public IPropertyDescriptor[] getPropertyDescriptors() {
119: return descriptors;
120: }
121:
122: public Object getPropertyValue(Object propName) {
123: if (VARIABLE.equals(propName))
124: return getVariable();
125: if (FIELD.equals(propName))
126: return getField();
127: if (VALUE.equals(propName))
128: return getValue();
129: if (FIELDVALUE.equals(propName))
130: return getFieldValue();
131: if (VARIABLEVALUE.equals(propName))
132: return getVariableValue();
133: if (TYPE.equals(propName))
134: return getType();
135: if (FUNCTIONVALUE.equals(propName))
136: return getFunctionValue();
137: return super .getPropertyValue(propName);
138: }
139:
140: public void setPropertyValue(Object id, Object value) {
141: if (id == VARIABLE)
142: setVariable((String) value);
143: if (id == FIELD)
144: setField((String) value);
145: if (id == VALUE)
146: setValue((String) value);
147: if (id == FIELDVALUE)
148: setFieldValue((String) value);
149: if (id == VARIABLEVALUE)
150: setVariableValue((String) value);
151: if (id == TYPE)
152: setType((String) value);
153: if (id == FUNCTIONVALUE)
154: setFunctionValue((String) value);
155: }
156:
157: }
|