package org.openwfe.gpe.model;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
/**
* @author helena
*/
public class IteratorElement extends OneChild {
public static String name = "Iterator";
private String onValue = "";
private String toField = "";
private String toVariable = "";
private String valueSeparator = "";
protected static IPropertyDescriptor[] descriptors;
public static final String ONVALUE = "on-value"; //$NON-NLS-1$
public static final String TOFIELD = "to-field";
public static final String TOVARIABLE = "to-variable";
public static final String VALUESEPARATOR = "value-separator";
static {
descriptors = new IPropertyDescriptor[] {
new TextPropertyDescriptor(ONVALUE,"on-value"),
new TextPropertyDescriptor(TOFIELD,"to-field"),
new TextPropertyDescriptor(TOVARIABLE,"to-variable"),
new TextPropertyDescriptor(VALUESEPARATOR,"value-seperator")};
}
public String getName() {
return name;
}
public void setName(String s) {
name = s;
}
/**
* @return Returns the onValue.
*/
public String getOnValue() {
return onValue;
}
/**
* @param onValue The onValue to set.
*/
public void setOnValue(String onValue) {
this.onValue = onValue;
firePropertyChange(ONVALUE, null, onValue);
}
/**
* @return Returns the toField.
*/
public String getToField() {
return toField;
}
/**
* @param toField The toField to set.
*/
public void setToField(String toField) {
this.toField = toField;
firePropertyChange(TOFIELD, null, toField);
}
public String getToVariable() {
return toVariable;
}
/**
* @param toField The toField to set.
*/
public void setToVariable(String s) {
toVariable = s;
firePropertyChange(TOVARIABLE, null, s);
}
/**
* @return Returns the valueSeparator.
*/
public String getValueSeparator() {
return valueSeparator;
}
/**
* @param valueSeparator The valueSeparator to set.
*/
public void setValueSeparator(String valueSeparator) {
this.valueSeparator = valueSeparator;
firePropertyChange(VALUESEPARATOR, null, valueSeparator);
}
public IPropertyDescriptor[] getPropertyDescriptors() {
return descriptors;
}
public Object getPropertyValue(Object propName) {
if(TOFIELD.equals(propName))
return getToField();
if(TOVARIABLE.equals(propName))
return getToVariable();
if(ONVALUE.equals(propName))
return getOnValue();
if(VALUESEPARATOR.equals(propName))
return getValueSeparator();
return super.getPropertyValue(propName);
}
public void setPropertyValue(Object id, Object value){
if(id == ONVALUE)
setOnValue((String)value);
if(id == TOFIELD)
setToField((String)value);
if(id == TOVARIABLE)
setToVariable((String)value);
if(id == VALUESEPARATOR)
setValueSeparator((String)value);
}
}
|