Search in sources :

Example 41 with PropertyEditor

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

the class TaskTemplateSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    taskTemplate = (TaskTemplate) selection;
    // id text field
    idEditor = new PropertyEditor(taskTemplate, PropertyEditor.TYPE_TEXT);
    idEditor.setLabel("ID");
    idEditor.setWidth(150);
    idEditor.setReadOnly(true);
    idEditor.render(composite);
    // name text field
    nameEditor = new PropertyEditor(taskTemplate, PropertyEditor.TYPE_TEXT);
    nameEditor.setLabel("Name");
    nameEditor.setWidth(300);
    nameEditor.setReadOnly(true);
    nameEditor.render(composite);
}
Also used : PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 42 with PropertyEditor

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

the class ActivityImplDesignSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    activityImpl = (ActivityImpl) selection;
    // base class combo
    baseClassPropertyEditor = new PropertyEditor(activityImpl, PropertyEditor.TYPE_COMBO);
    baseClassPropertyEditor.setLabel("Category");
    baseClassPropertyEditor.setReadOnly(true);
    baseClassPropertyEditor.setWidth(475);
    List<String> implementorBaseClasses = new ArrayList<String>();
    if (!activityImpl.getProject().checkRequiredVersion(5, 5)) {
        implementorBaseClasses = Arrays.asList(ActivityImpl.getOldBaseClasses());
    } else {
        for (Class<?> baseClass : ActivityImpl.getBaseClasses()) implementorBaseClasses.add(baseClass.getName());
    }
    baseClassPropertyEditor.setValueOptions(implementorBaseClasses);
    baseClassPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activityImpl.setBaseClassName((String) newValue);
        }
    });
    baseClassPropertyEditor.render(composite);
    // attr description text area
    attrDescriptionPropertyEditor = new PropertyEditor(activityImpl, PropertyEditor.TYPE_TEXT);
    attrDescriptionPropertyEditor.setLabel("Pagelet");
    attrDescriptionPropertyEditor.setMultiLine(true);
    attrDescriptionPropertyEditor.setWidth(475);
    attrDescriptionPropertyEditor.setHeight(150);
    attrDescriptionPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            activityImpl.setAttrDescriptionXml((String) newValue);
        }
    });
    attrDescriptionPropertyEditor.render(composite);
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) ArrayList(java.util.ArrayList) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 43 with PropertyEditor

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

the class AssetDrivenActivityCustomSection method select.

@Override
public boolean select(Object toTest) {
    if (toTest == null || !(toTest instanceof Activity))
        return false;
    Activity testActivity = (Activity) toTest;
    if (// manual tasks have asset-driven widgets
    testActivity.isManualTask())
        // but no custom section
        return false;
    if (// so do subprocess launch activities
    testActivity.isSubProcessInvoke())
        return false;
    if (testActivity.isForProcessInstance())
        return false;
    PropertyEditorList propEditorList = new PropertyEditorList((Activity) toTest);
    for (PropertyEditor propertyEditor : propEditorList) {
        // return true if any widgets are considered asset-driven
        if (propertyEditor instanceof WorkflowAssetEditor)
            return true;
    }
    return false;
}
Also used : PropertyEditorList(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList) WorkflowAssetEditor(com.centurylink.mdw.plugin.designer.properties.editor.WorkflowAssetEditor) Activity(com.centurylink.mdw.plugin.designer.model.Activity) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 44 with PropertyEditor

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

the class AssetDrivenActivityCustomSection method clear.

private void clear() {
    activity.removeAttribute("CustomAttributes");
    for (PropertyEditor propertyEditor : propertyEditors) {
        propertyEditor.setValue((String) null);
    }
    activity.fireDirtyStateChanged(true);
}
Also used : PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Example 45 with PropertyEditor

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

the class BamMonitoringSection method drawWidgets.

public void drawWidgets(Composite composite, WorkflowElement selection) {
    element = (WorkflowElement) selection;
    // trigger dropdown
    triggerPropertyEditor = new PropertyEditor(element, PropertyEditor.TYPE_COMBO);
    triggerPropertyEditor.setLabel("BAM Trigger");
    triggerPropertyEditor.setWidth(100);
    triggerPropertyEditor.setReadOnly(true);
    ArrayList<String> triggerOpts = new ArrayList<String>();
    triggerOpts.add("Start");
    triggerOpts.add("Finish");
    triggerPropertyEditor.setValueOptions(triggerOpts);
    triggerPropertyEditor.setFireDirtyStateChange(false);
    triggerPropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            if (newValue.equals("Start"))
                selectedTrigger = WorkAttributeConstant.BAM_START_MSGDEF;
            else if (newValue.equals("Finish"))
                selectedTrigger = WorkAttributeConstant.BAM_FINISH_MSGDEF;
            if (bamEventDefs.get(selectedTrigger) == null) {
                bamEventDefs.put(selectedTrigger, getValue(selectedTrigger));
            }
            bamMessagePropertyEditor.setValue(bamEventDefs.get(selectedTrigger));
            // otherwise
            bamMessagePropertyEditor.setEditable(isEditable());
        // reverts
        // Add/Delete
        // buttons
        // to
        // enabled
        }
    });
    triggerPropertyEditor.render(composite);
    separatorPropertyEditor = new PropertyEditor(element, PropertyEditor.TYPE_SEPARATOR);
    separatorPropertyEditor.setWidth(500);
    separatorPropertyEditor.render(composite);
    // bam message def
    bamMessagePropertyEditor = new PropertyEditor(element, PropertyEditor.TYPE_BAM_MESSAGE);
    bamMessagePropertyEditor.setLabel("BAM Message");
    bamMessagePropertyEditor.setWidth(500);
    bamMessagePropertyEditor.setFireDirtyStateChange(false);
    bamMessagePropertyEditor.addValueChangeListener(new ValueChangeListener() {

        public void propertyValueChanged(Object newValue) {
            BamMessageDefinition bamMessageDef = (BamMessageDefinition) newValue;
            bamEventDefs.put(selectedTrigger, bamMessageDef);
            element.setAttribute(selectedTrigger, valueConverter.toPropertyValue(bamMessageDef));
            setDirty(true);
        }
    });
    bamMessagePropertyEditor.render(composite);
    createSaveButton();
    // help link
    // spacer
    new Label(composite, SWT.NONE);
    helpPropertyEditor = new PropertyEditor(element, PropertyEditor.TYPE_LINK);
    helpPropertyEditor.setLabel("BAM Monitoring Help");
    helpPropertyEditor.render(composite);
    helpPropertyEditor.setValue("/MDWHub/doc/bam.html");
}
Also used : ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) ArrayList(java.util.ArrayList) Label(org.eclipse.swt.widgets.Label) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor) BamMessageDefinition(com.centurylink.mdw.model.value.event.BamMessageDefinition)

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