Search in sources :

Example 11 with PropertyEditorList

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

the class TaskTemplateEditor method createPages.

@Override
protected void createPages() {
    pages = new HashMap<>();
    try {
        WorkflowAsset pageletAsset = taskTemplate.getPagelet();
        if (!pageletAsset.isLoaded())
            pageletAsset.load();
        String pageletXml = pageletAsset.getContent();
        propertyEditors = new PropertyEditorList(taskTemplate, pageletXml);
        // general section
        addPage((String) null);
        int pageCount = 1;
        for (String section : propertyEditors.getSections()) {
            addPage(section);
            pageCount++;
        }
        addPage(textEditor, getEditorInput());
        setPageText(pageCount, "Source");
        pages.put("Source", textEditor);
        firePropertyChange(PROP_TITLE);
        taskTemplate.addElementChangeListener(this);
        taskTemplate.addDirtyStateListener(this);
    } catch (PartInitException ex) {
        PluginMessages.uiError(getSite().getShell(), ex, "Task Template", taskTemplate.getProject());
    }
}
Also used : PropertyEditorList(com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditorList) WorkflowAsset(com.centurylink.mdw.plugin.designer.model.WorkflowAsset) PartInitException(org.eclipse.ui.PartInitException)

Example 12 with PropertyEditorList

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

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