use of com.centurylink.mdw.plugin.designer.properties.value.ScriptEditorValueProvider 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.value.ScriptEditorValueProvider in project mdw-designer by CenturyLinkCloud.
the class ScriptSection method setSelection.
public void setSelection(WorkflowElement selection) {
activity = (Activity) selection;
if (activity.getScriptLanguage() == null) {
activity.setScriptLanguage(artifactEditor.getValueProvider().getDefaultLanguage());
activity.fireAttributeValueChanged("SCRIPT", activity.getScriptLanguage());
}
artifactEditor.setElement(activity);
artifactEditor.setValueProvider(new ScriptEditorValueProvider(activity));
artifactEditor.setEditable(!activity.isReadOnly());
if (activity.canWriteOutputDocs()) {
outputDocsPropertyEditor.setElement(activity);
outputDocsPropertyEditor.setValue(activity.getAttribute("Output Documents"));
outputDocsPropertyEditor.setEditable(!activity.isReadOnly());
outputDocsPropertyEditor.setVisible(true);
} else {
outputDocsPropertyEditor.setVisible(false);
}
helpPropertyEditor.setValue("/MDWHub/doc/scriptActivity.html");
}
use of com.centurylink.mdw.plugin.designer.properties.value.ScriptEditorValueProvider in project mdw-designer by CenturyLinkCloud.
the class ProcessCanvasWrapper method openScript.
private void openScript(final Activity scriptOrRuleActivity) {
PanelBusyIndicator pbi = new PanelBusyIndicator(getDisplay(), getCanvas());
try {
pbi.busyWhile(new Runnable() {
public void run() {
ArtifactEditorValueProvider artifactValueProvider = null;
if (TransformEditorValueProvider.isTransformActivity(scriptOrRuleActivity))
artifactValueProvider = new TransformEditorValueProvider(scriptOrRuleActivity);
else
artifactValueProvider = new ScriptEditorValueProvider(scriptOrRuleActivity);
ArtifactEditor artifactEditor = new ArtifactEditor(scriptOrRuleActivity, artifactValueProvider, null);
artifactEditor.openTempFile(new NullProgressMonitor());
}
});
} catch (InvocationTargetException ex) {
PluginMessages.uiError(ex, "Open Script", getProject());
}
}
Aggregations