Search in sources :

Example 1 with ArtifactEditor

use of com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor in project mdw-designer by CenturyLinkCloud.

the class PrePostScriptSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    activity = (Activity) selection;
    activity.setScriptLanguages(null);
    // artifact editor
    preScriptArtifactEditor = new ArtifactEditor(activity, getNewScriptValueProvider(true), "PreScript Language");
    preScriptArtifactEditor.render(composite);
    postScriptArtifactEditor = new ArtifactEditor(activity, getNewScriptValueProvider(false), "PostScript Language");
    postScriptArtifactEditor.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)

Example 2 with ArtifactEditor

use of com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor 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 3 with ArtifactEditor

use of com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor in project mdw-designer by CenturyLinkCloud.

the class JavaSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    activity = (Activity) selection;
    // artifact editor
    artifactEditor = new ArtifactEditor(activity, new JavaEditorValueProvider(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("Dynamic Java 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) JavaEditorValueProvider(com.centurylink.mdw.plugin.designer.properties.value.JavaEditorValueProvider) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 4 with ArtifactEditor

use of com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor in project mdw-designer by CenturyLinkCloud.

the class DocumentationSection method setSelection.

public void setSelection(WorkflowElement selection) {
    element = selection;
    String attrVal = element.getAttribute(ATTR);
    if (attrVal != null && !attrVal.isEmpty()) {
        if (attrVal.length() >= 8) {
            byte[] first4 = RuleSetVO.decode(attrVal.substring(0, 8));
            if (first4[0] == 68 && first4[1] == 35 && first4[2] == 17 && first4[3] == 0)
                language = DocumentationEditorValueProvider.MS_WORD;
        }
    }
    if (artifactEditor != null) {
        artifactEditor.dispose();
        artifactEditor = null;
    }
    if (referenceIdEditor != null) {
        referenceIdEditor.dispose();
        referenceIdEditor = null;
    }
    if (sequenceIdEditor != null) {
        sequenceIdEditor.dispose();
        sequenceIdEditor = null;
    }
    if (webEditor != null) {
        webEditor.dispose();
        webEditor = null;
    }
    // artifact editor
    ArtifactEditorValueProvider valueProvider = new DocumentationEditorValueProvider(selection) {

        @Override
        public void languageChanged(String newLanguage) {
            super.languageChanged(newLanguage);
            boolean proceed = true;
            String attrVal = element.getAttribute(ATTR);
            if (attrVal != null && !attrVal.isEmpty() && !language.equals(newLanguage))
                proceed = MessageDialog.openConfirm(getShell(), "Confirm Format", "Proceed with switch to " + newLanguage + " format? (" + language + " formatted content will be lost.)");
            if (proceed) {
                language = newLanguage;
                element.setAttribute(getAttributeName(), " ");
                setSelection(element);
            } else {
                artifactEditor.setLanguage(language);
            }
        }

        @Override
        public String getLanguage() {
            return language;
        }
    };
    artifactEditor = new ArtifactEditor(selection, valueProvider, "Format");
    artifactEditor.render(composite);
    artifactEditor.setElement(selection);
    artifactEditor.setEditable(!selection.isReadOnly());
    artifactEditor.setLanguage(language);
    if (element instanceof Activity || element instanceof EmbeddedSubProcess) {
        // reference ID text field
        sequenceIdEditor = new PropertyEditor(element, PropertyEditor.TYPE_TEXT);
        sequenceIdEditor.setLabel("Sequence Number");
        sequenceIdEditor.setWidth(100);
        sequenceIdEditor.setVerticalIndent(5);
        sequenceIdEditor.render(composite);
        sequenceIdEditor.setElement(selection);
        sequenceIdEditor.setValue(element instanceof EmbeddedSubProcess ? ((EmbeddedSubProcess) element).getSequenceId() : ((Activity) element).getSequenceId());
        sequenceIdEditor.setEditable(false);
        // reference ID text field
        referenceIdEditor = new PropertyEditor(element, PropertyEditor.TYPE_TEXT);
        referenceIdEditor.setLabel("Reference ID");
        referenceIdEditor.setWidth(100);
        referenceIdEditor.setComment("Optional (select Reference ID element order when exporting)");
        referenceIdEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                element.setAttribute(WorkAttributeConstant.REFERENCE_ID, (String) newValue);
            }
        });
        referenceIdEditor.render(composite);
        referenceIdEditor.setElement(selection);
        referenceIdEditor.setEditable(!selection.isReadOnly());
        referenceIdEditor.setValue(element.getAttribute(WorkAttributeConstant.REFERENCE_ID));
    }
    if (DocumentationEditorValueProvider.MARKDOWN.equals(language) && element.getProject().checkRequiredVersion(6, 0)) {
        webEditor = new PropertyEditor(element, PropertyEditor.TYPE_WEB);
        webEditor.render(composite);
        webEditor.setElement(element);
        MarkdownRenderer renderer = new MarkdownRenderer(attrVal);
        webEditor.setValue(renderer.renderHtml());
        webEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                MarkdownRenderer renderer = new MarkdownRenderer(newValue == null ? null : newValue.toString());
                String html = renderer.renderHtml();
                webEditor.setValue(html);
            }
        });
    }
    composite.layout(true);
}
Also used : EmbeddedSubProcess(com.centurylink.mdw.plugin.designer.model.EmbeddedSubProcess) ArtifactEditor(com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) DocumentationEditorValueProvider(com.centurylink.mdw.plugin.designer.properties.value.DocumentationEditorValueProvider) Activity(com.centurylink.mdw.plugin.designer.model.Activity) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor) ArtifactEditorValueProvider(com.centurylink.mdw.plugin.designer.properties.value.ArtifactEditorValueProvider) MarkdownRenderer(com.centurylink.mdw.designer.utils.MarkdownRenderer)

Example 5 with ArtifactEditor

use of com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor 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)

Aggregations

ArtifactEditor (com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor)6 PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)5 ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)5 ArtifactEditorValueProvider (com.centurylink.mdw.plugin.designer.properties.value.ArtifactEditorValueProvider)2 ScriptEditorValueProvider (com.centurylink.mdw.plugin.designer.properties.value.ScriptEditorValueProvider)2 TransformEditorValueProvider (com.centurylink.mdw.plugin.designer.properties.value.TransformEditorValueProvider)2 MarkdownRenderer (com.centurylink.mdw.designer.utils.MarkdownRenderer)1 Activity (com.centurylink.mdw.plugin.designer.model.Activity)1 EmbeddedSubProcess (com.centurylink.mdw.plugin.designer.model.EmbeddedSubProcess)1 DocumentationEditorValueProvider (com.centurylink.mdw.plugin.designer.properties.value.DocumentationEditorValueProvider)1 JavaEditorValueProvider (com.centurylink.mdw.plugin.designer.properties.value.JavaEditorValueProvider)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1