Tiese,
Here is the classs and made corresponding changes to other classes as well.
package org.activiti.designer.property.extension.field;
import java.lang.reflect.Field;
import org.activiti.designer.integration.servicetask.PropertyType;
import org.activiti.designer.integration.servicetask.validator.RequiredFieldValidator;
import org.activiti.designer.property.PropertyCustomServiceTaskSection;
import org.eclipse.bpmn2.ServiceTask;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
/**
* @author Tiese Barrell
* @since 0.6.1
* @version 1
*/
public class CustomPropertyComboFields extends AbstractCustomPropertyField {
private CCombo comboControl;
final String[] ITEMS = { "111", "112", "113", "114", "115"};
public CustomPropertyComboFields(final PropertyCustomServiceTaskSection section, final ServiceTask serviceTask, final Field field) {
super(section, serviceTask, field);
}
@Override
public PropertyType getPrimaryPropertyType() {
return PropertyType.DROP_DOWN;
}
@Override
public void refresh() {
comboControl.setText(getSimpleValueFromModel());
}
@Override
public String getSimpleValue() {
return comboControl.getText();
}
@Override
public Composite render(final Composite parent, final TabbedPropertySheetWidgetFactory factory, final FocusListener listener) {
final Composite result = factory.createFlatFormComposite(parent);
FormData data;
comboControl = factory.createCCombo(result,SWT.BORDER_SOLID);
comboControl.setEnabled(true);
if (getPropertyAnnotation().required()) {
addFieldValidator(comboControl, RequiredFieldValidator.class);
}
if (getPropertyAnnotation().fieldValidator() != null) {
addFieldValidator(comboControl, getPropertyAnnotation().fieldValidator());
}
comboControl.addFocusListener(listener);
comboControl.setItems(ITEMS);
data = new FormData();
data.left = new FormAttachment(0);
data.top = new FormAttachment(0);
data.right = new FormAttachment(100);
comboControl.setLayoutData(data);
return result;
}
}
But in the above progra,, it goanna return the same list of values for all the properties. I do not want this.
Thanks