Search in sources :

Example 1 with ScriptEditorValueProvider

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);
}
Also used : ArtifactEditor(com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor) ScriptEditorValueProvider(com.centurylink.mdw.plugin.designer.properties.value.ScriptEditorValueProvider)

Example 2 with ScriptEditorValueProvider

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");
}
Also used : ScriptEditorValueProvider(com.centurylink.mdw.plugin.designer.properties.value.ScriptEditorValueProvider)

Example 3 with ScriptEditorValueProvider

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());
    }
}
Also used : ArtifactEditor(com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) TransformEditorValueProvider(com.centurylink.mdw.plugin.designer.properties.value.TransformEditorValueProvider) ArtifactEditorValueProvider(com.centurylink.mdw.plugin.designer.properties.value.ArtifactEditorValueProvider) InvocationTargetException(java.lang.reflect.InvocationTargetException) ScriptEditorValueProvider(com.centurylink.mdw.plugin.designer.properties.value.ScriptEditorValueProvider)

Aggregations

ScriptEditorValueProvider (com.centurylink.mdw.plugin.designer.properties.value.ScriptEditorValueProvider)3 ArtifactEditor (com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor)2 PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)1 ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)1 ArtifactEditorValueProvider (com.centurylink.mdw.plugin.designer.properties.value.ArtifactEditorValueProvider)1 TransformEditorValueProvider (com.centurylink.mdw.plugin.designer.properties.value.TransformEditorValueProvider)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1