Search in sources :

Example 1 with ValueChangeListener

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

the class OsgiAdapterDesignSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    activity = (Activity) selection;
    interfaceSelector = new WorkflowAssetEditor(activity, WorkAttributeConstant.SERVICE_INTERFACE, getAssetTypes());
    interfaceSelector.setLabel("Service Interface");
    interfaceSelector.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setAttribute(WorkAttributeConstant.SERVICE_INTERFACE, (String) newValue);
            methodDropdown.setValueOptions(getServiceMethodOptions());
        }
    });
    interfaceSelector.render(composite);
    methodDropdown = new PropertyEditor(activity, PropertyEditor.TYPE_COMBO);
    methodDropdown.setLabel("Method");
    methodDropdown.setWidth(277);
    methodDropdown.setValueOptions(getServiceMethodOptions());
    methodDropdown.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setAttribute(WorkAttributeConstant.SERVICE_METHOD, (String) newValue);
            paramsTable.setValue(getParamsTableValue());
        }
    });
    methodDropdown.render(composite);
    resultDropdown = new PropertyEditor(activity, PropertyEditor.TYPE_COMBO);
    resultDropdown.setLabel("Result Variable");
    resultDropdown.setWidth(277);
    resultDropdown.setValueOptions(getResultVariableOptions());
    resultDropdown.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setAttribute(WorkAttributeConstant.SERVICE_RESULT, (String) newValue);
        }
    });
    resultDropdown.render(composite);
    paramsTable = new TableEditor(activity, TableEditor.TYPE_TABLE);
    paramsTable.setColumnSpecs(getInputTableColumns());
    paramsTable.setColumnDelimiter('=');
    paramsTable.setLabel("Parameters");
    paramsTable.setAttributeName(WorkAttributeConstant.SERVICE_PARAMETERS);
    paramsTable.setHorizontalSpan(3);
    paramsTable.render(composite, false);
    helpLink = new PropertyEditor(activity, PropertyEditor.TYPE_LINK);
    helpLink.setLabel("OSGi Service Adapter Help");
    helpLink.render(composite);
}
Also used : WorkflowAssetEditor(com.centurylink.mdw.plugin.designer.properties.editor.WorkflowAssetEditor) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Example 2 with ValueChangeListener

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

the class PageletSection method setSelection.

public void setSelection(WorkflowElement selection) {
    element = (WorkflowElement) selection;
    if (propertyEditors != null) {
        for (PropertyEditor propertyEditor : propertyEditors) {
            propertyEditor.dispose();
        }
    }
    if (savePropertyEditor != null)
        savePropertyEditor.dispose();
    if (offlinePropertyEditor != null)
        offlinePropertyEditor.dispose();
    if (helpPropertyEditor != null)
        helpPropertyEditor.dispose();
    final PageletTab tab = element.getProject().getPageletTab(tabId);
    if (tab != null) {
        if (element.overrideAttributesApplied()) {
            attributeNames = new ArrayList<String>();
            propertyEditors = new PropertyEditorList(element, tab.getXml());
            for (PropertyEditor propertyEditor : propertyEditors) {
                attributeNames.add(propertyEditor.getName());
                propertyEditor.setFireDirtyStateChange(false);
                propertyEditor.render(composite);
                propertyEditor.setValue(element.getAttribute(propertyEditor.getName()));
                if (!propertyEditor.getType().equals(PropertyEditor.TYPE_LINK)) {
                    // pagelet-driven attributes are always considered
                    // override attributes
                    boolean editable = element.isUserAuthorized(UserRoleVO.PROCESS_EXECUTION) && !propertyEditor.isReadOnly();
                    propertyEditor.setEditable(editable);
                    propertyEditor.setFireDirtyStateChange(false);
                }
                if (!propertyEditor.isReadOnly()) {
                    propertyEditor.addValueChangeListener(new ValueChangeListener() {

                        public void propertyValueChanged(Object newValue) {
                            setDirty(true);
                        }
                    });
                }
            }
            // help link
            helpPropertyEditor = new PropertyEditor(element, PropertyEditor.TYPE_LINK);
            helpPropertyEditor.setLabel("Override Attributes Help");
            helpPropertyEditor.render(composite);
            helpPropertyEditor.setValue("/MDWHub/doc/override-attributes.html");
            // save button
            savePropertyEditor = createSaveButton();
        } else {
            // offline message
            offlinePropertyEditor = new PropertyEditor(element, PropertyEditor.TYPE_INFO);
            offlinePropertyEditor.render(composite);
            offlinePropertyEditor.setValue("Attributes unavailable. Reload process with server online.");
            // help link
            helpPropertyEditor = new PropertyEditor(element, PropertyEditor.TYPE_LINK);
            helpPropertyEditor.setLabel("Override Attributes Help");
            helpPropertyEditor.render(composite);
            helpPropertyEditor.setValue("/MDWHub/doc/todo.html");
        }
    }
    composite.layout(true);
}
Also used : PropertyEditorList(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 3 with ValueChangeListener

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

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

the class ProcessDesignSection method drawWidgets.

@Override
public void drawWidgets(Composite composite, WorkflowElement selection) {
    process = (WorkflowProcess) selection;
    // sla timer field
    slaPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_TIMER);
    slaPropertyEditor.setLabel("SLA");
    slaPropertyEditor.setAcceptedUnits(new Units[] { Units.Minutes, Units.Hours, Units.Days });
    slaPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            TimeInterval.TimerValue timerValue = (TimeInterval.TimerValue) newValue;
            process.setAttribute(WorkAttributeConstant.SLA, timerValue.getInterval());
            process.setAttribute(WorkAttributeConstant.SLA_UNIT, timerValue.getUnits().toString());
        }
    });
    slaPropertyEditor.render(composite);
    // synchronous checkbox
    syncPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_CHECKBOX);
    syncPropertyEditor.setLabel("Service Process");
    syncPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            Boolean value = (Boolean) newValue;
            process.setSynchronous(value.booleanValue());
        }
    });
    syncPropertyEditor.render(composite);
    // performance level dropdown
    performancePropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_COMBO);
    performancePropertyEditor.setLabel("Performance Level");
    performancePropertyEditor.setValueOptions(getPerformanceLevelOptions());
    performancePropertyEditor.setWidth(400);
    performancePropertyEditor.setReadOnly(true);
    performancePropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            String sel = (String) newValue;
            process.setPerformanceLevel(Integer.parseInt(sel.substring(0, sel.indexOf('-') - 1).trim()));
        }
    });
    performancePropertyEditor.render(composite);
    // transition outcome radio
    transitionOutcomePropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_RADIO);
    transitionOutcomePropertyEditor.setLabel("Empty Transition Outcome");
    transitionOutcomePropertyEditor.setValueOptions(getTransitionOutcomeOptions());
    transitionOutcomePropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            process.setEmptyTransitionOutcome(((String) newValue).trim());
        }
    });
    transitionOutcomePropertyEditor.render(composite);
    // transition retry
    transitionRetryPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_RADIO);
    transitionRetryPropertyEditor.setLabel("Transition Retry Default Limit");
    transitionRetryPropertyEditor.setValueOptions(getTransitionRetryOptions());
    transitionRetryPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            String sel = (String) newValue;
            process.setDefaultTransitionRetryLimit(Integer.parseInt(sel.substring(sel.indexOf('(') + 1, sel.indexOf(')'))));
        }
    });
    transitionRetryPropertyEditor.render(composite);
    // process config help link
    processConfigHelpLinkEditor = new PropertyEditor(process, PropertyEditor.TYPE_LINK);
    processConfigHelpLinkEditor.setLabel("Process Configuration Help");
    processConfigHelpLinkEditor.render(composite);
    // start page asset field
    startPagePropertyEditor = new WorkflowAssetEditor(process, WorkAttributeConstant.PROCESS_START_PAGE, Arrays.asList(new String[] { RuleSetVO.HTML, RuleSetVO.FACELET, RuleSetVO.JSX }));
    startPagePropertyEditor.setLabel("Custom Start Page");
    startPagePropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            process.setStartPage((String) newValue);
        }
    });
    startPagePropertyEditor.render(composite);
    // custom page config help link
    customPageHelpLinkEditor = new PropertyEditor(process, PropertyEditor.TYPE_LINK);
    customPageHelpLinkEditor.setLabel("Custom Page Help");
    customPageHelpLinkEditor.render(composite);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) WorkflowAssetEditor(com.centurylink.mdw.plugin.designer.properties.editor.WorkflowAssetEditor) TimeInterval(com.centurylink.mdw.plugin.designer.properties.editor.TimeInterval) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 5 with ValueChangeListener

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

the class ProcessLockSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    process = (WorkflowProcess) selection;
    // lock user read-only text field
    lockUserPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_TEXT);
    lockUserPropertyEditor.setLabel("Locked By");
    lockUserPropertyEditor.setWidth(150);
    lockUserPropertyEditor.setReadOnly(true);
    lockUserPropertyEditor.render(composite);
    // lock date read-only text field
    lockDatePropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_TEXT);
    lockDatePropertyEditor.setLabel("Lock Date");
    lockDatePropertyEditor.setWidth(150);
    lockDatePropertyEditor.setValueConverter(new DateConverter());
    lockDatePropertyEditor.setReadOnly(true);
    lockDatePropertyEditor.render(composite);
    // lock button
    lockButtonPropertyEditor = new PropertyEditor(process, PropertyEditor.TYPE_BUTTON);
    lockButtonPropertyEditor.setLabel("");
    lockButtonPropertyEditor.setWidth(65);
    lockButtonPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            toggleProcessLock();
        }
    });
    lockButtonPropertyEditor.render(composite);
}
Also used : DateConverter(com.centurylink.mdw.plugin.designer.properties.convert.DateConverter) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Aggregations

ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)44 PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)36 TableEditor (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)9 ArrayList (java.util.ArrayList)8 SelectionEvent (org.eclipse.swt.events.SelectionEvent)6 ArtifactEditor (com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor)5 Event (org.eclipse.swt.widgets.Event)5 Label (org.eclipse.swt.widgets.Label)5 Listener (org.eclipse.swt.widgets.Listener)5 DateConverter (com.centurylink.mdw.plugin.designer.properties.convert.DateConverter)4 ColumnSpec (com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec)3 PropertyEditorList (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList)3 FontData (org.eclipse.swt.graphics.FontData)3 CustomAttributeVO (com.centurylink.mdw.model.value.attribute.CustomAttributeVO)2 ElementChangeEvent (com.centurylink.mdw.plugin.designer.model.ElementChangeEvent)2 ElementChangeListener (com.centurylink.mdw.plugin.designer.model.ElementChangeListener)2 EmbeddedSubProcess (com.centurylink.mdw.plugin.designer.model.EmbeddedSubProcess)2 TimeInterval (com.centurylink.mdw.plugin.designer.properties.editor.TimeInterval)2 WorkflowAssetEditor (com.centurylink.mdw.plugin.designer.properties.editor.WorkflowAssetEditor)2 MarkdownRenderer (com.centurylink.mdw.designer.utils.MarkdownRenderer)1