Search in sources :

Example 16 with PropertyEditor

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

Example 17 with PropertyEditor

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

the class DesignSection method setSelection.

@Override
public void setSelection(WorkflowElement selection) {
    activity = (Activity) selection;
    if (propertyEditors != null) {
        for (PropertyEditor propertyEditor : propertyEditors) {
            propertyEditor.dispose();
        }
    }
    if (warningLabel != null) {
        warningLabel.dispose();
    }
    if (activity.getActivityImpl().getAttrDescriptionXml() == null) {
        warningLabel = new Label(composite, SWT.NONE);
        warningLabel.setText("Please configure this attribute's parameters.");
    } else {
        propertyEditors = new PropertyEditorList(activity);
        for (PropertyEditor propertyEditor : propertyEditors) {
            if (selectForSection(propertyEditor)) {
                preRender(propertyEditor);
                propertyEditor.render(composite);
                propertyEditor.setValue(activity);
                if (!propertyEditor.getType().equals(PropertyEditor.TYPE_LINK)) {
                    propertyEditor.setEditable(!(propertyEditor.isReadOnly() || activity.isReadOnly()));
                }
            }
        }
    }
    composite.layout(true);
}
Also used : PropertyEditorList(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList) Label(org.eclipse.swt.widgets.Label) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 18 with PropertyEditor

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

the class EmbeddedSubProcessSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    embeddedSubProcess = (EmbeddedSubProcess) selection;
    // id text field
    idPropertyEditor = new PropertyEditor(embeddedSubProcess, PropertyEditor.TYPE_TEXT);
    idPropertyEditor.setLabel("ID");
    idPropertyEditor.setWidth(150);
    idPropertyEditor.setReadOnly(true);
    idPropertyEditor.render(composite);
    // name text field
    namePropertyEditor = new PropertyEditor(embeddedSubProcess, PropertyEditor.TYPE_TEXT);
    namePropertyEditor.setLabel("Name");
    namePropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            embeddedSubProcess.setName((String) newValue);
        }
    });
    namePropertyEditor.render(composite);
    // description text area
    descriptionPropertyEditor = new PropertyEditor(embeddedSubProcess, PropertyEditor.TYPE_TEXT);
    descriptionPropertyEditor.setLabel("Description");
    descriptionPropertyEditor.setHeight(100);
    descriptionPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            embeddedSubProcess.setDescription((String) newValue);
        }
    });
    descriptionPropertyEditor.render(composite);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 19 with PropertyEditor

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

the class ExpressionSection method select.

/**
 * For IFilter interface, determine which activities include this section in
 * their Design properties tab page.
 */
public boolean select(Object toTest) {
    if (toTest == null || !(toTest instanceof Activity))
        return false;
    activity = (Activity) toTest;
    if (activity.isForProcessInstance())
        return false;
    if (activity.getActivityImpl().getAttrDescriptionXml() == null)
        return false;
    PropertyEditorList propEditorList = new PropertyEditorList(activity);
    for (PropertyEditor propertyEditor : propEditorList) {
        if (propertyEditor.getType().equals(PropertyEditor.TYPE_SCRIPT)) {
            activity.setScriptLanguages(propertyEditor.getScriptLanguages());
            return "EXPRESSION".equals(propertyEditor.getScriptType());
        }
    }
    return false;
}
Also used : PropertyEditorList(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList) Activity(com.centurylink.mdw.plugin.designer.model.Activity) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 20 with PropertyEditor

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

the class ExpressionSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    activity = (Activity) selection;
    // language combo
    languagePropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_COMBO);
    languagePropertyEditor.setLabel("Language");
    languagePropertyEditor.setReadOnly(true);
    languagePropertyEditor.setWidth(150);
    languagePropertyEditor.setValueOptions(activity.getScriptLanguages());
    languagePropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setScriptLanguage((String) newValue);
        }
    });
    languagePropertyEditor.render(composite);
    // expression editor
    expressionPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_TEXT);
    expressionPropertyEditor.setLabel("Expression");
    expressionPropertyEditor.setWidth(400);
    expressionPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activity.setAttribute("Expression", (String) newValue);
        }
    });
    expressionPropertyEditor.render(composite);
    // help link
    helpPropertyEditor = new PropertyEditor(activity, PropertyEditor.TYPE_LINK);
    helpPropertyEditor.setLabel("Expression Activity Help");
    helpPropertyEditor.render(composite);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Aggregations

PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)51 ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)36 PropertyEditorList (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList)11 Activity (com.centurylink.mdw.plugin.designer.model.Activity)7 ArrayList (java.util.ArrayList)6 Label (org.eclipse.swt.widgets.Label)6 ArtifactEditor (com.centurylink.mdw.plugin.designer.properties.editor.ArtifactEditor)5 TableEditor (com.centurylink.mdw.plugin.designer.properties.editor.TableEditor)5 DateConverter (com.centurylink.mdw.plugin.designer.properties.convert.DateConverter)4 WorkflowAssetEditor (com.centurylink.mdw.plugin.designer.properties.editor.WorkflowAssetEditor)4 CustomAttributeVO (com.centurylink.mdw.model.value.attribute.CustomAttributeVO)3 FontData (org.eclipse.swt.graphics.FontData)3 TimeInterval (com.centurylink.mdw.plugin.designer.properties.editor.TimeInterval)2 GridData (org.eclipse.swt.layout.GridData)2 Button (org.eclipse.swt.widgets.Button)2 Composite (org.eclipse.swt.widgets.Composite)2 MarkdownRenderer (com.centurylink.mdw.designer.utils.MarkdownRenderer)1 ActivityImplementorVO (com.centurylink.mdw.model.value.activity.ActivityImplementorVO)1 BamMessageDefinition (com.centurylink.mdw.model.value.event.BamMessageDefinition)1 VariableVO (com.centurylink.mdw.model.value.variable.VariableVO)1