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 IteratorElement extends OneChild {
010:
011: public static String name = "Iterator";
012: private String onValue = "";
013: private String toField = "";
014: private String toVariable = "";
015: private String valueSeparator = "";
016:
017: protected static IPropertyDescriptor[] descriptors;
018:
019: public static final String ONVALUE = "on-value"; //$NON-NLS-1$
020: public static final String TOFIELD = "to-field";
021: public static final String TOVARIABLE = "to-variable";
022: public static final String VALUESEPARATOR = "value-separator";
023: static {
024: descriptors = new IPropertyDescriptor[] {
025: new TextPropertyDescriptor(ONVALUE, "on-value"),
026: new TextPropertyDescriptor(TOFIELD, "to-field"),
027: new TextPropertyDescriptor(TOVARIABLE, "to-variable"),
028: new TextPropertyDescriptor(VALUESEPARATOR,
029: "value-seperator") };
030: }
031:
032: public String getName() {
033: return name;
034: }
035:
036: public void setName(String s) {
037: name = s;
038: }
039:
040: /**
041: * @return Returns the onValue.
042: */
043: public String getOnValue() {
044: return onValue;
045: }
046:
047: /**
048: * @param onValue The onValue to set.
049: */
050: public void setOnValue(String onValue) {
051: this .onValue = onValue;
052: firePropertyChange(ONVALUE, null, onValue);
053: }
054:
055: /**
056: * @return Returns the toField.
057: */
058: public String getToField() {
059: return toField;
060: }
061:
062: /**
063: * @param toField The toField to set.
064: */
065: public void setToField(String toField) {
066: this .toField = toField;
067: firePropertyChange(TOFIELD, null, toField);
068: }
069:
070: public String getToVariable() {
071: return toVariable;
072: }
073:
074: /**
075: * @param toField The toField to set.
076: */
077: public void setToVariable(String s) {
078: toVariable = s;
079: firePropertyChange(TOVARIABLE, null, s);
080: }
081:
082: /**
083: * @return Returns the valueSeparator.
084: */
085: public String getValueSeparator() {
086: return valueSeparator;
087: }
088:
089: /**
090: * @param valueSeparator The valueSeparator to set.
091: */
092: public void setValueSeparator(String valueSeparator) {
093: this .valueSeparator = valueSeparator;
094: firePropertyChange(VALUESEPARATOR, null, valueSeparator);
095: }
096:
097: public IPropertyDescriptor[] getPropertyDescriptors() {
098: return descriptors;
099: }
100:
101: public Object getPropertyValue(Object propName) {
102: if (TOFIELD.equals(propName))
103: return getToField();
104: if (TOVARIABLE.equals(propName))
105: return getToVariable();
106: if (ONVALUE.equals(propName))
107: return getOnValue();
108: if (VALUESEPARATOR.equals(propName))
109: return getValueSeparator();
110: return super .getPropertyValue(propName);
111: }
112:
113: public void setPropertyValue(Object id, Object value) {
114: if (id == ONVALUE)
115: setOnValue((String) value);
116: if (id == TOFIELD)
117: setToField((String) value);
118: if (id == TOVARIABLE)
119: setToVariable((String) value);
120: if (id == VALUESEPARATOR)
121: setValueSeparator((String) value);
122: }
123: }
|