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 RestoreElement extends NoChild {
015:
016: public static String name = "Restore";
017: private String fromVariable = "";
018: private String toField = "";
019: private String mergeLead = "";
020:
021: protected static IPropertyDescriptor[] descriptors;
022:
023: public static final String FROMVARIABLE = "from-variable";
024: public static final String TOFIELD = "to-field";
025: public static final String MERGELEAD = "merge-lead";
026:
027: static {
028: descriptors = new IPropertyDescriptor[] {
029: new TextPropertyDescriptor(FROMVARIABLE,
030: "from-variable"),
031: new TextPropertyDescriptor(TOFIELD, "to-field"),
032: new TextPropertyDescriptor(MERGELEAD, "merge-lead") };
033: }
034:
035: public String getName() {
036: return name;
037: }
038:
039: public void setName(String s) {
040: name = s;
041: }
042:
043: /**
044: * @return Returns the fromVariable.
045: */
046: public String getFromVariable() {
047: return fromVariable;
048: }
049:
050: /**
051: * @param fromVariable The fromVariable to set.
052: */
053: public void setFromVariable(String fromVariable) {
054: this .fromVariable = fromVariable;
055: firePropertyChange(FROMVARIABLE, null, fromVariable);
056: }
057:
058: /**
059: * @return Returns the mergeLead.
060: */
061: public String getMergeLead() {
062: return mergeLead;
063: }
064:
065: /**
066: * @param mergeLead The mergeLead to set.
067: */
068: public void setMergeLead(String mergeLead) {
069: this .mergeLead = mergeLead;
070: firePropertyChange(MERGELEAD, null, mergeLead);
071: }
072:
073: /**
074: * @return Returns the toField.
075: */
076: public String getToField() {
077: return toField;
078: }
079:
080: /**
081: * @param toField The toField to set.
082: */
083: public void setToField(String toField) {
084: this .toField = toField;
085: firePropertyChange(TOFIELD, null, toField);
086: }
087:
088: public IPropertyDescriptor[] getPropertyDescriptors() {
089: return descriptors;
090: }
091:
092: public Object getPropertyValue(Object propName) {
093: if (FROMVARIABLE.equals(propName))
094: return getFromVariable();
095: if (TOFIELD.equals(propName))
096: return getToField();
097: if (MERGELEAD.equals(propName))
098: return getMergeLead();
099: return super .getPropertyValue(propName);
100: }
101:
102: public void setPropertyValue(Object id, Object value) {
103: if (id == FROMVARIABLE)
104: setFromVariable((String) value);
105: if (id == TOFIELD)
106: setToField((String) value);
107: if (id == MERGELEAD)
108: setMergeLead((String) value);
109: }
110:
111: }
|