use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class AssetDrivenActivityCustomSection method setSelection.
@Override
public void setSelection(WorkflowElement selection) {
activity = (Activity) selection;
CustomAttributeVO customAttrVO = determineCustomAttr(activity);
if (propertyEditors != null) {
for (PropertyEditor propertyEditor : propertyEditors) propertyEditor.dispose();
}
if (warningLabel != null)
warningLabel.dispose();
if (commentLabel != null)
commentLabel.dispose();
if (clearBtnPropertyEditor != null)
clearBtnPropertyEditor.dispose();
if (customAttrVO == null || StringHelper.isEmpty(customAttrVO.getDefinition())) {
warningLabel = new Label(composite, SWT.NONE);
warningLabel.setText("No custom attributes defined for workflow asset type" + (customAttrVO == null ? "." : ": " + customAttrVO.getCategorizer()));
} else {
commentLabel = new Label(composite, SWT.NONE);
GridData gd = new GridData(SWT.LEFT);
gd.horizontalSpan = PropertyEditor.COLUMNS;
commentLabel.setLayoutData(gd);
commentLabel.setText("Enter the custom attribute values that must be matched at runtime for the asset to be in effect.");
valueMap = new HashMap<>();
String attr = activity.getAttribute("CustomAttributes");
if (attr != null)
valueMap = StringHelper.parseMap(attr);
// TODO: update is broken
// setAttribute() must be called on property update (must not update
// activity directly)
propertyEditors = new PropertyEditorList(activity, customAttrVO.getDefinition());
for (PropertyEditor propertyEditor : propertyEditors) {
propertyEditor.setReadOnly(true);
propertyEditor.render(composite);
propertyEditor.setValue(valueMap.get(propertyEditor.getName()));
}
// clear button
clearBtnPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_BUTTON);
clearBtnPropertyEditor.setLabel("Clear");
clearBtnPropertyEditor.setComment("Remove Criteria:");
clearBtnPropertyEditor.setWidth(65);
clearBtnPropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
clear();
}
});
clearBtnPropertyEditor.render(composite);
}
composite.layout(true);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class EventsSection method select.
@Override
public boolean select(Object toTest) {
if (toTest == null || !(toTest instanceof Activity))
return false;
Activity activity = (Activity) toTest;
if (activity.isForProcessInstance())
return false;
PropertyEditorList propEditorList = new PropertyEditorList(activity);
for (PropertyEditor propertyEditor : propEditorList) {
// return true if any widgets specify EVENTS section
if (PropertyEditor.SECTION_EVENTS.equals(propertyEditor.getSection()))
return true;
}
return false;
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class ScriptSection method drawWidgets.
public void drawWidgets(Composite composite, WorkflowElement selection) {
activity = (Activity) selection;
// artifact editor
artifactEditor = new ArtifactEditor(activity, new ScriptEditorValueProvider(activity), null);
artifactEditor.render(composite);
// output docs
outputDocsPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_PICKLIST);
outputDocsPropertyEditor.setLabel("Documents:Read-Only~Writable");
outputDocsPropertyEditor.setValueOptions(activity.getProcess().getDocRefVariableNames());
outputDocsPropertyEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
activity.setAttribute("Output Documents", (String) newValue);
}
});
outputDocsPropertyEditor.render(composite);
outputDocsPropertyEditor.setVisible(activity.canWriteOutputDocs());
// help link
helpPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_LINK);
helpPropertyEditor.setLabel("Script Activity Help");
helpPropertyEditor.render(composite);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class SubProcessMappingSection method select.
public boolean select(Object toTest) {
if (toTest == null || !(toTest instanceof Activity))
return false;
activity = (Activity) toTest;
if (!activity.isSubProcessInvoke())
return false;
if (activity.isForProcessInstance())
return false;
PropertyEditorList propEditorList = new PropertyEditorList(activity);
for (PropertyEditor propertyEditor : propEditorList) {
if (propertyEditor.getType().equals(MappingEditor.TYPE_MAPPING))
return true;
}
return false;
}
use of com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor in project mdw-designer by CenturyLinkCloud.
the class TaskVariablesSection method select.
@Override
public boolean select(Object toTest) {
if (toTest == null || !(toTest instanceof Activity))
return false;
Activity activity = (Activity) toTest;
if (!activity.isManualTask())
return false;
if (activity.isForProcessInstance())
return false;
PropertyEditorList propEditorList = new PropertyEditorList(activity);
for (PropertyEditor propertyEditor : propEditorList) {
// return true if any widgets specify Variables section
if (PropertyEditor.SECTION_VARIABLES.equals(propertyEditor.getSection()))
return true;
}
return false;
}
Aggregations