001: /*
002: * Created on 3 mai 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 SubProcessElement extends NoChild {
015: public static String name = "Subprocess";
016: private String ref = "";
017: private String forget = "";
018: private String fields = "";
019: private String variableRef = "";
020: private String fieldRef = "";
021:
022: protected static IPropertyDescriptor[] descriptors;
023:
024: public static final String REF = "ref";
025: public static final String FORGET = "forget";
026: public static final String FIELDS = "fields";
027: public static final String VARIABLEREF = "variable-ref";
028: public static final String FIELDREF = "field-ref";
029: static {
030: descriptors = new IPropertyDescriptor[] {
031: new TextPropertyDescriptor(REF, "ref"),
032: new TextPropertyDescriptor(FORGET, "forget"),
033: new TextPropertyDescriptor(FIELDS, "fields"),
034: new TextPropertyDescriptor(VARIABLEREF, "variable-ref"),
035: new TextPropertyDescriptor(FIELDREF, "field-ref"), };
036: }
037:
038: public String getName() {
039: if (!(ref.equalsIgnoreCase("")))
040: return name + ": " + ref;
041: return name;
042: }
043:
044: public void setName(String s) {
045: name = s;
046: }
047:
048: public String getRef() {
049: return ref;
050: }
051:
052: public void setRef(String s) {
053: ref = s;
054: firePropertyChange(REF, null, s);
055: }
056:
057: public String getForget() {
058: return forget;
059: }
060:
061: public void setForget(String s) {
062: forget = s;
063: firePropertyChange(FORGET, null, s);
064: }
065:
066: public String getFields() {
067: return fields;
068: }
069:
070: public void setFields(String s) {
071: fields = s;
072: firePropertyChange(FIELDS, null, s);
073: }
074:
075: public String getVariableRef() {
076: return variableRef;
077: }
078:
079: public void setVariableRef(String s) {
080: variableRef = s;
081: firePropertyChange(VARIABLEREF, null, s);
082: }
083:
084: public String getFieldRef() {
085: return fieldRef;
086: }
087:
088: public void setFieldRef(String s) {
089: fieldRef = s;
090: firePropertyChange(FIELDREF, null, s);
091: }
092:
093: public IPropertyDescriptor[] getPropertyDescriptors() {
094: return descriptors;
095: }
096:
097: public Object getPropertyValue(Object propName) {
098: if (REF.equals(propName))
099: return getRef();
100: if (FORGET.equals(propName))
101: return getForget();
102: if (VARIABLEREF.equals(propName))
103: return getVariableRef();
104: if (FIELDS.equals(propName))
105: return getFields();
106: if (FIELDREF.equals(propName))
107: return getFieldRef();
108: return super .getPropertyValue(propName);
109: }
110:
111: public void setPropertyValue(Object id, Object value) {
112: if (id == REF)
113: setRef((String) value);
114: if (id == FORGET)
115: setForget((String) value);
116: if (id == VARIABLEREF)
117: setVariableRef((String) value);
118: if (id == FIELDS)
119: setFields((String) value);
120: if (id == FIELDREF)
121: setFieldRef((String) value);
122: }
123:
124: }
|