Search in sources :

Example 11 with ValueChangeListener

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

the class ActivityInstanceSection method drawWidgets.

@Override
public void drawWidgets(Composite composite, WorkflowElement selection) {
    activity = (Activity) selection;
    tableEditor = new TableEditor(activity, TableEditor.TYPE_TABLE);
    tableEditor.setReadOnly(true);
    if (columnSpecs == null)
        columnSpecs = createColumnSpecs();
    tableEditor.setColumnSpecs(columnSpecs);
    if (contentProvider == null)
        contentProvider = new ActivityInstanceContentProvider();
    tableEditor.setContentProvider(contentProvider);
    if (labelProvider == null)
        labelProvider = new ActivityInstanceLabelProvider();
    tableEditor.setLabelProvider(labelProvider);
    tableEditor.render(composite);
    // double-click
    tableEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            new ActivityInstanceDialog(getShell(), activity, (ActivityInstanceVO) newValue, Mode.VIEW).open();
        }
    });
    // right-click menu
    tableEditor.getTable().addListener(SWT.MenuDetect, new Listener() {

        public void handleEvent(Event event) {
            tableEditor.getTable().setMenu(createContextMenu(getShell()));
        }
    });
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) Listener(org.eclipse.swt.widgets.Listener) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) ActivityInstanceDialog(com.centurylink.mdw.plugin.designer.dialogs.ActivityInstanceDialog) Event(org.eclipse.swt.widgets.Event) SelectionEvent(org.eclipse.swt.events.SelectionEvent) TableEditor(com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)

Example 12 with ValueChangeListener

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

the class AssetDrivenActivityCustomSection method setSelection.

@Override
public void setSelection(WorkflowElement selection) {
    activity = (Activity) selection;
    CustomAttributeVO customAttrVO = determineCustomAttr(activity);
    if (propertyEditors != null) {
        for (PropertyEditor propertyEditor : propertyEditors) propertyEditor.dispose();
    }
    if (warningLabel != null)
        warningLabel.dispose();
    if (commentLabel != null)
        commentLabel.dispose();
    if (clearBtnPropertyEditor != null)
        clearBtnPropertyEditor.dispose();
    if (customAttrVO == null || StringHelper.isEmpty(customAttrVO.getDefinition())) {
        warningLabel = new Label(composite, SWT.NONE);
        warningLabel.setText("No custom attributes defined for workflow asset type" + (customAttrVO == null ? "." : ": " + customAttrVO.getCategorizer()));
    } else {
        commentLabel = new Label(composite, SWT.NONE);
        GridData gd = new GridData(SWT.LEFT);
        gd.horizontalSpan = PropertyEditor.COLUMNS;
        commentLabel.setLayoutData(gd);
        commentLabel.setText("Enter the custom attribute values that must be matched at runtime for the asset to be in effect.");
        valueMap = new HashMap<>();
        String attr = activity.getAttribute("CustomAttributes");
        if (attr != null)
            valueMap = StringHelper.parseMap(attr);
        // TODO: update is broken
        // setAttribute() must be called on property update (must not update
        // activity directly)
        propertyEditors = new PropertyEditorList(activity, customAttrVO.getDefinition());
        for (PropertyEditor propertyEditor : propertyEditors) {
            propertyEditor.setReadOnly(true);
            propertyEditor.render(composite);
            propertyEditor.setValue(valueMap.get(propertyEditor.getName()));
        }
        // clear button
        clearBtnPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_BUTTON);
        clearBtnPropertyEditor.setLabel("Clear");
        clearBtnPropertyEditor.setComment("Remove Criteria:");
        clearBtnPropertyEditor.setWidth(65);
        clearBtnPropertyEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                clear();
            }
        });
        clearBtnPropertyEditor.render(composite);
    }
    composite.layout(true);
}
Also used : PropertyEditorList(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) CustomAttributeVO(com.centurylink.mdw.model.value.attribute.CustomAttributeVO) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 13 with ValueChangeListener

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

the class ExtensionModulesWizardPage method drawWidgets.

/**
 * draw the widgets using a grid layout
 *
 * @param parent
 *            - the parent composite
 */
public void drawWidgets(Composite parent) {
    // create the composite to hold the widgets
    Composite composite = new Composite(parent, SWT.NULL);
    // create the layout for this wizard page
    GridLayout gl = new GridLayout();
    int ncol = 4;
    gl.numColumns = ncol;
    composite.setLayout(gl);
    extensionsTable = new ExtensionModulesTable(getProject());
    extensionsTable.create();
    extensionsTable.getTableEditor().render(composite, false);
    extensionsTable.setSelectedModules(new ArrayList<ExtensionModule>());
    extensionsTable.getTableEditor().addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            getProject().setExtensionModules(extensionsTable.getSelectedModules());
        }
    });
    setControl(composite);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) Composite(org.eclipse.swt.widgets.Composite) ExtensionModulesTable(com.centurylink.mdw.plugin.project.extensions.ExtensionModulesTable) ExtensionModule(com.centurylink.mdw.plugin.project.extensions.ExtensionModule)

Example 14 with ValueChangeListener

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

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

the class TestCaseSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    testCase = (AutomatedTestCase) selection;
    testNameEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
    testNameEditor.setLabel("Test Name");
    testNameEditor.setWidth(250);
    testNameEditor.render(composite);
    testNameEditor.setEditable(false);
    commandFileEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
    commandFileEditor.setLabel("Command File");
    commandFileEditor.setWidth(600);
    commandFileEditor.render(composite);
    commandFileEditor.setEditable(false);
    commandEditEditor = new PropertyEditor(selection, PropertyEditor.TYPE_LINK);
    commandEditEditor.setLabel("Edit Command File");
    commandEditEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            WorkflowElementActionHandler handler = new WorkflowElementActionHandler();
            handler.open(testCase);
        }
    });
    commandEditEditor.render(composite);
    statusEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
    statusEditor.setLabel("Status");
    statusEditor.setWidth(250);
    statusEditor.render(composite);
    statusEditor.setEditable(false);
    startTimeEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
    startTimeEditor.setLabel("Start Time");
    startTimeEditor.setWidth(110);
    startTimeEditor.render(composite);
    startTimeEditor.setEditable(false);
    endTimeEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
    endTimeEditor.setLabel("End Time");
    endTimeEditor.setWidth(110);
    endTimeEditor.render(composite);
    endTimeEditor.setEditable(false);
    messageEditor = new PropertyEditor(selection, PropertyEditor.TYPE_TEXT);
    messageEditor.setLabel("Message");
    commandFileEditor.setWidth(600);
    messageEditor.render(composite);
    messageEditor.setEditable(false);
}
Also used : WorkflowElementActionHandler(com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler) 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