Search in sources :

Example 6 with PropertyEditorList

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

Example 7 with PropertyEditorList

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

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

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

the class ProcessesSection 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 PROCESSES section
        if (PropertyEditor.SECTION_PROCESSES.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 10 with PropertyEditorList

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

the class WorkflowAssetAttributesSection method setSelection.

public void setSelection(WorkflowElement selection) {
    if (workflowAsset != null)
        workflowAsset.removeElementChangeListener(this);
    workflowAsset = (WorkflowAsset) selection;
    workflowAsset.addElementChangeListener(this);
    if (propertyEditors != null) {
        for (PropertyEditor propertyEditor : propertyEditors) propertyEditor.dispose();
    }
    if (warningLabel != null)
        warningLabel.dispose();
    if (savePropertyEditor != null)
        savePropertyEditor.dispose();
    if (workflowAsset.getCustomAttribute().getDefinition() == null) {
        warningLabel = new Label(composite, SWT.NONE);
        warningLabel.setText("Please define the custom attributes.");
    } else {
        propertyEditors = new PropertyEditorList(workflowAsset, workflowAsset.getCustomAttribute().getDefinition());
        for (PropertyEditor propertyEditor : propertyEditors) {
            propertyEditor.render(composite);
            propertyEditor.setValue(workflowAsset);
        }
        // save button
        savePropertyEditor = new PropertyEditor(workflowAsset, PropertyEditor.TYPE_BUTTON);
        savePropertyEditor.setLabel("Save");
        savePropertyEditor.setComment("Save Attributes:");
        savePropertyEditor.setWidth(65);
        savePropertyEditor.addValueChangeListener(new ValueChangeListener() {

            public void propertyValueChanged(Object newValue) {
                saveAttributes();
            }
        });
        savePropertyEditor.render(composite);
        savePropertyEditor.setElement(workflowAsset);
    }
    composite.layout(true);
}
Also used : PropertyEditorList(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList) ValueChangeListener(com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener) Label(org.eclipse.swt.widgets.Label) PropertyEditor(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)

Aggregations

PropertyEditorList (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList)12 PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)11 Activity (com.centurylink.mdw.plugin.designer.model.Activity)6 ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)3 Label (org.eclipse.swt.widgets.Label)3 CustomAttributeVO (com.centurylink.mdw.model.value.attribute.CustomAttributeVO)2 WorkflowAsset (com.centurylink.mdw.plugin.designer.model.WorkflowAsset)2 WorkflowAssetEditor (com.centurylink.mdw.plugin.designer.properties.editor.WorkflowAssetEditor)2 AssetLocator (com.centurylink.mdw.plugin.designer.properties.editor.AssetLocator)1 GridData (org.eclipse.swt.layout.GridData)1 PartInitException (org.eclipse.ui.PartInitException)1