use of com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener in project mdw-designer by CenturyLinkCloud.
the class ActivityInstanceSection method drawWidgets.
@Override
public void drawWidgets(Composite composite, WorkflowElement selection) {
activity = (Activity) selection;
tableEditor = new TableEditor(activity, TableEditor.TYPE_TABLE);
tableEditor.setReadOnly(true);
if (columnSpecs == null)
columnSpecs = createColumnSpecs();
tableEditor.setColumnSpecs(columnSpecs);
if (contentProvider == null)
contentProvider = new ActivityInstanceContentProvider();
tableEditor.setContentProvider(contentProvider);
if (labelProvider == null)
labelProvider = new ActivityInstanceLabelProvider();
tableEditor.setLabelProvider(labelProvider);
tableEditor.render(composite);
// double-click
tableEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
new ActivityInstanceDialog(getShell(), activity, (ActivityInstanceVO) newValue, Mode.VIEW).open();
}
});
// right-click menu
tableEditor.getTable().addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event event) {
tableEditor.getTable().setMenu(createContextMenu(getShell()));
}
});
}
use of com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener 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.ValueChangeListener in project mdw-designer by CenturyLinkCloud.
the class ExtensionModulesWizardPage method drawWidgets.
/**
* draw the widgets using a grid layout
*
* @param parent
* - the parent composite
*/
public void drawWidgets(Composite parent) {
// create the composite to hold the widgets
Composite composite = new Composite(parent, SWT.NULL);
// create the layout for this wizard page
GridLayout gl = new GridLayout();
int ncol = 4;
gl.numColumns = ncol;
composite.setLayout(gl);
extensionsTable = new ExtensionModulesTable(getProject());
extensionsTable.create();
extensionsTable.getTableEditor().render(composite, false);
extensionsTable.setSelectedModules(new ArrayList<ExtensionModule>());
extensionsTable.getTableEditor().addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
getProject().setExtensionModules(extensionsTable.getSelectedModules());
}
});
setControl(composite);
}
use of com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener 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.ValueChangeListener in project mdw-designer by CenturyLinkCloud.
the class TestCaseSection method drawWidgets.
public void drawWidgets(Composite composite, WorkflowElement selection) {
testCase = (AutomatedTestCase) selection;
testNameEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
testNameEditor.setLabel("Test Name");
testNameEditor.setWidth(250);
testNameEditor.render(composite);
testNameEditor.setEditable(false);
commandFileEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
commandFileEditor.setLabel("Command File");
commandFileEditor.setWidth(600);
commandFileEditor.render(composite);
commandFileEditor.setEditable(false);
commandEditEditor = new PropertyEditor(selection, PropertyEditor.TYPE_LINK);
commandEditEditor.setLabel("Edit Command File");
commandEditEditor.addValueChangeListener(new ValueChangeListener() {
public void propertyValueChanged(Object newValue) {
WorkflowElementActionHandler handler = new WorkflowElementActionHandler();
handler.open(testCase);
}
});
commandEditEditor.render(composite);
statusEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
statusEditor.setLabel("Status");
statusEditor.setWidth(250);
statusEditor.render(composite);
statusEditor.setEditable(false);
startTimeEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
startTimeEditor.setLabel("Start Time");
startTimeEditor.setWidth(110);
startTimeEditor.render(composite);
startTimeEditor.setEditable(false);
endTimeEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
endTimeEditor.setLabel("End Time");
endTimeEditor.setWidth(110);
endTimeEditor.render(composite);
endTimeEditor.setEditable(false);
messageEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
messageEditor.setLabel("Message");
commandFileEditor.setWidth(600);
messageEditor.render(composite);
messageEditor.setEditable(false);
}
Aggregations