Search in sources :

Example 1 with TransformEditorValueProvider

use of com.centurylink.mdw.plugin.designer.properties.value.TransformEditorValueProvider in project mdw-designer by CenturyLinkCloud.

the class TransformSection method setSelection.

public void setSelection(WorkflowElement selection) {
    activity = (Activity) selection;
    if (activity.getTransformLanguage() == null)
        activity.setTransformLanguage("GPath");
    artifactEditor.setElement(activity);
    artifactEditor.setValueProvider(new TransformEditorValueProvider(activity));
    artifactEditor.setEditable(!activity.isReadOnly());
    inputDocumentEditor.setElement(activity);
    inputDocumentEditor.setValue(activity.getAttribute("Input Documents"));
    inputDocumentEditor.setEditable(!activity.isReadOnly());
    outputDocumentEditor.setElement(activity);
    outputDocumentEditor.setValue(activity.getAttribute("Output Documents"));
    outputDocumentEditor.setEditable(!activity.isReadOnly());
    helpPropertyEditor.setValue("/MDWHub/doc/documentTransform.html");
}
Also used : TransformEditorValueProvider(com.centurylink.mdw.plugin.designer.properties.value.TransformEditorValueProvider)

Example 2 with TransformEditorValueProvider

use of com.centurylink.mdw.plugin.designer.properties.value.TransformEditorValueProvider in project mdw-designer by CenturyLinkCloud.

the class TransformSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    activity = (Activity) selection;
    // artifact editor
    artifactEditor = new ArtifactEditor(activity, new TransformEditorValueProvider(activity), null);
    artifactEditor.render(composite);
    // input document combo
    inputDocumentEditor = new PropertyEditor(activity, PropertyEditor.TYPE_COMBO);
    inputDocumentEditor.setLabel("Input Document");
    inputDocumentEditor.setWidth(150);
    inputDocumentEditor.setReadOnly(true);
    inputDocumentEditor.setValueOptions(activity.getProcess().getDocRefVariableNames());
    inputDocumentEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setAttribute("Input Documents", (String) newValue);
        }
    });
    inputDocumentEditor.render(composite);
    // output document combo
    outputDocumentEditor = new PropertyEditor(activity, PropertyEditor.TYPE_COMBO);
    outputDocumentEditor.setLabel("Output Document");
    outputDocumentEditor.setWidth(150);
    outputDocumentEditor.setReadOnly(true);
    outputDocumentEditor.setValueOptions(activity.getProcess().getDocRefVariableNames());
    outputDocumentEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setAttribute("Output Documents", (String) newValue);
        }
    });
    outputDocumentEditor.render(composite);
    // help link
    helpPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_LINK);
    helpPropertyEditor.setLabel("Transform 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) TransformEditorValueProvider(com.centurylink.mdw.plugin.designer.properties.value.TransformEditorValueProvider)

Example 3 with TransformEditorValueProvider

use of com.centurylink.mdw.plugin.designer.properties.value.TransformEditorValueProvider 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

TransformEditorValueProvider (com.centurylink.mdw.plugin.designer.properties.value.TransformEditorValueProvider)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 ScriptEditorValueProvider (com.centurylink.mdw.plugin.designer.properties.value.ScriptEditorValueProvider)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1