Search in sources :

Example 11 with PropertyEditor

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

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

the class EventsSection method select.

@Override
public boolean select(Object toTest) {
    if (toTest == null || !(toTest instanceof Activity))
        return false;
    Activity activity = (Activity) toTest;
    if (activity.isForProcessInstance())
        return false;
    PropertyEditorList propEditorList = new PropertyEditorList(activity);
    for (PropertyEditor propertyEditor : propEditorList) {
        // return true if any widgets specify EVENTS section
        if (PropertyEditor.SECTION_EVENTS.equals(propertyEditor.getSection()))
            return true;
    }
    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 13 with PropertyEditor

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

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

the class SubProcessMappingSection method select.

public boolean select(Object toTest) {
    if (toTest == null || !(toTest instanceof Activity))
        return false;
    activity = (Activity) toTest;
    if (!activity.isSubProcessInvoke())
        return false;
    if (activity.isForProcessInstance())
        return false;
    PropertyEditorList propEditorList = new PropertyEditorList(activity);
    for (PropertyEditor propertyEditor : propEditorList) {
        if (propertyEditor.getType().equals(MappingEditor.TYPE_MAPPING))
            return true;
    }
    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 15 with PropertyEditor

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

the class TaskVariablesSection method select.

@Override
public boolean select(Object toTest) {
    if (toTest == null || !(toTest instanceof Activity))
        return false;
    Activity activity = (Activity) toTest;
    if (!activity.isManualTask())
        return false;
    if (activity.isForProcessInstance())
        return false;
    PropertyEditorList propEditorList = new PropertyEditorList(activity);
    for (PropertyEditor propertyEditor : propEditorList) {
        // return true if any widgets specify Variables section
        if (PropertyEditor.SECTION_VARIABLES.equals(propertyEditor.getSection()))
            return true;
    }
    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)

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