001: package org.openwfe.gpe.model;
002:
003: import org.eclipse.ui.views.properties.IPropertyDescriptor;
004: import org.eclipse.ui.views.properties.TextPropertyDescriptor;
005:
006: /**
007: * @author helena
008: */
009: public class ParticipantElement extends NoChild {
010:
011: public static String name = "Participant";
012: private String ref = "";
013: private String filter = "";
014: public String defaultRef = "";
015: public String timeout = "";
016: public String fieldRef = "";
017: public String variableRef = "";
018: public String description = "";
019: public String descriptionFieldName = "";
020: public String defaultFieldRef = "";
021: public String elseRef = "";
022:
023: protected static IPropertyDescriptor[] descriptors;
024:
025: public static final String REF = "ref";
026: public static final String FILTER = "filter";
027: public static final String DEFAULTREF = "default-ref";
028: public static final String TIMEOUT = "timeout";
029: public static final String FIELDREF = "field-ref";
030: public static final String VARIABLEREF = "variable-ref";
031: public static final String DESCRIPTION = "description";
032: public static final String DESCRIPTIONFIELDNAME = "description-field-name";
033: public static final String DEFAULTFIELDREF = "default-field-ref";
034: public static final String ELSEREF = "else-ref";
035: private static final Object DESCRIPTIONFIELDREF = null;
036:
037: static {
038: descriptors = new IPropertyDescriptor[] {
039: new TextPropertyDescriptor(REF, "ref"),
040: new TextPropertyDescriptor(FILTER, "filter"),
041: new TextPropertyDescriptor(DEFAULTREF, "default-ref"),
042: new TextPropertyDescriptor(TIMEOUT, "timeout"),
043: new TextPropertyDescriptor(FIELDREF, "field-ref"),
044: new TextPropertyDescriptor(VARIABLEREF, "variable-ref"),
045: new TextPropertyDescriptor(DESCRIPTION, "description"),
046: new TextPropertyDescriptor(DESCRIPTIONFIELDNAME,
047: "description-field-name"),
048: new TextPropertyDescriptor(DEFAULTFIELDREF,
049: "default-field-ref"),
050: new TextPropertyDescriptor(ELSEREF, "else-ref"), };
051: }
052:
053: public String getName() {
054: if (!(ref.equalsIgnoreCase("")))
055: return name + ": " + ref;
056: return name;
057: }
058:
059: public void setName(String s) {
060: name = s;
061: }
062:
063: /**
064: * @return Returns the reference.
065: */
066: public String getRef() {
067: return ref;
068: }
069:
070: /**
071: * @param reference The reference to set.
072: */
073: public void setRef(String reference) {
074: this .ref = reference;
075: firePropertyChange(REF, null, reference);
076: }
077:
078: public String getFilter() {
079: return filter;
080: }
081:
082: public void setFilter(String s) {
083: this .filter = s;
084: firePropertyChange(FILTER, null, s);
085: }
086:
087: public String getDefaultRef() {
088: return defaultRef;
089: }
090:
091: public void setDefaultRef(String s) {
092: this .defaultRef = s;
093: firePropertyChange(DEFAULTREF, null, s);
094: }
095:
096: public String getTimeout() {
097: return timeout;
098: }
099:
100: public void setTimeout(String s) {
101: this .timeout = s;
102: firePropertyChange(TIMEOUT, null, s);
103: }
104:
105: public String getFieldRef() {
106: return fieldRef;
107: }
108:
109: public void setFieldRef(String s) {
110: this .fieldRef = s;
111: firePropertyChange(FIELDREF, null, s);
112: }
113:
114: public String getVariableRef() {
115: return variableRef;
116: }
117:
118: public void setVariableRef(String s) {
119: this .variableRef = s;
120: firePropertyChange(VARIABLEREF, null, s);
121: }
122:
123: public String getDescription() {
124: return description;
125: }
126:
127: public void setDescription(String s) {
128: this .description = s;
129: firePropertyChange(DESCRIPTION, null, s);
130: }
131:
132: public String getDescriptionFieldName() {
133: return descriptionFieldName;
134: }
135:
136: public void setDescriptionFieldName(String s) {
137: this .descriptionFieldName = s;
138: firePropertyChange(DESCRIPTIONFIELDNAME, null, s);
139: }
140:
141: public String getDefaultFieldRef() {
142: return defaultFieldRef;
143: }
144:
145: public void setDefaultFieldRef(String s) {
146: this .defaultFieldRef = s;
147: firePropertyChange(DEFAULTFIELDREF, null, s);
148: }
149:
150: public String getElseRef() {
151: return elseRef;
152: }
153:
154: public void setElseRef(String s) {
155: this .elseRef = s;
156: firePropertyChange(ELSEREF, null, s);
157: }
158:
159: public IPropertyDescriptor[] getPropertyDescriptors() {
160: return descriptors;
161: }
162:
163: public Object getPropertyValue(Object propName) {
164: if (REF.equals(propName))
165: return getRef();
166: if (FILTER.equals(propName))
167: return getFilter();
168: if (DEFAULTREF.equals(propName))
169: return getDefaultRef();
170: if (TIMEOUT.equals(propName))
171: return getTimeout();
172: if (FIELDREF.equals(propName))
173: return getFieldRef();
174: if (VARIABLEREF.equals(propName))
175: return getVariableRef();
176: if (DESCRIPTION.equals(propName))
177: return getDescription();
178: if (DESCRIPTIONFIELDNAME.equals(propName))
179: return getDescriptionFieldName();
180: if (DEFAULTFIELDREF.equals(propName))
181: return getDefaultFieldRef();
182: if (ELSEREF.equals(propName))
183: return getElseRef();
184:
185: return super .getPropertyValue(propName);
186: }
187:
188: public void setPropertyValue(Object id, Object value) {
189: if (id == REF)
190: setRef((String) value);
191: if (id == FILTER)
192: setFilter((String) value);
193: if (id == DEFAULTREF)
194: setDefaultRef((String) value);
195: if (id == TIMEOUT)
196: setTimeout((String) value);
197: if (id == FIELDREF)
198: setFieldRef((String) value);
199: if (id == VARIABLEREF)
200: setVariableRef((String) value);
201: if (id == DESCRIPTION)
202: setDescription((String) value);
203: if (id == DESCRIPTIONFIELDNAME)
204: setDescriptionFieldName((String) value);
205: if (id == DEFAULTFIELDREF)
206: setDefaultFieldRef((String) value);
207: if (id == ELSEREF)
208: setElseRef((String) value);
209: }
210: }
|