use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class ActivitySection method drawWidgets.
@Override
public void drawWidgets(Composite composite, WorkflowElement selection) {
activity = (Activity) selection;
// id text field
idPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_TEXT);
idPropertyEditor.setLabel("ID");
idPropertyEditor.setWidth(150);
idPropertyEditor.setReadOnly(true);
idPropertyEditor.render(composite);
// logical id text field
logicalIdPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_TEXT);
logicalIdPropertyEditor.setLabel("Logical ID");
logicalIdPropertyEditor.setWidth(150);
logicalIdPropertyEditor.setReadOnly(true);
logicalIdPropertyEditor.render(composite);
// name text field
namePropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_TEXT);
namePropertyEditor.setLabel("Label");
namePropertyEditor.setMultiLine(true);
namePropertyEditor.setWidth(475);
namePropertyEditor.setHeight(30);
namePropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
activity.setName((String) newValue);
}
});
namePropertyEditor.render(composite);
// implementor combo
implementorPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_COMBO);
implementorPropertyEditor.setLabel("Implementor");
implementorPropertyEditor.setWidth(475);
List<String> implementorNames = new ArrayList<>();
for (ActivityImplementorVO implVo : getDataAccess().getActivityImplementors(false)) implementorNames.add(implVo.getImplementorClassName());
implementorPropertyEditor.setValueOptions(implementorNames);
implementorPropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
activity.setActivityImpl(activity.getProject().getActivityImpl((String) newValue));
}
});
implementorPropertyEditor.render(composite);
((Combo) implementorPropertyEditor.getWidget()).setVisibleItemCount(10);
// implementor link
linkPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_LINK);
linkPropertyEditor.setLabel("Open Implementor Source Code");
linkPropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
activity.getProject().viewSource(activity.getActivityImpl().getImplClassName());
}
});
linkPropertyEditor.render(composite);
// description text area
descriptionPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_TEXT);
descriptionPropertyEditor.setLabel("Description");
descriptionPropertyEditor.setWidth(475);
descriptionPropertyEditor.setHeight(70);
descriptionPropertyEditor.setMultiLine(true);
descriptionPropertyEditor.setTextLimit(1000);
descriptionPropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
activity.setDescription((String) newValue);
}
});
descriptionPropertyEditor.render(composite);
}
Aggregations