Search in sources :

Example 11 with WorkflowPackage

use of com.centurylink.mdw.plugin.designer.model.WorkflowPackage in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method exportPackageApplies.

public boolean exportPackageApplies(IStructuredSelection selection) {
    Object element = selection.getFirstElement();
    if (!(element instanceof WorkflowElement))
        return false;
    WorkflowProject project = ((WorkflowElement) element).getProject();
    if (selection.size() > 1 && !project.getProject().checkRequiredVersion(5, 5))
        return false;
    for (Object item : selection.toList()) {
        if (!(item instanceof WorkflowPackage))
            return false;
        WorkflowPackage pkg = (WorkflowPackage) item;
        if (pkg.isDefaultPackage() || !pkg.getProject().equals(project))
            return false;
    }
    return true;
}
Also used : WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) WorkflowElement(com.centurylink.mdw.plugin.designer.model.WorkflowElement)

Example 12 with WorkflowPackage

use of com.centurylink.mdw.plugin.designer.model.WorkflowPackage in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method createTaskManagerAction.

private IAction createTaskManagerAction() {
    IAction action = new Action() {

        @Override
        public void run() {
            if (webLaunchApplies(getSelection())) {
                if (getSelection().getFirstElement() instanceof WorkflowProject) {
                    WorkflowProject project = (WorkflowProject) getSelection().getFirstElement();
                    WebLaunchActions.getLaunchAction(project, WebApp.TaskManager).launch(project);
                } else if (getSelection().getFirstElement() instanceof WorkflowPackage) {
                    WorkflowPackage packageVersion = (WorkflowPackage) getSelection().getFirstElement();
                    WebLaunchActions.getLaunchAction(packageVersion.getProject(), WebApp.TaskManager).launch(packageVersion);
                }
            }
        }
    };
    WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(null, WebApp.TaskManager);
    action.setId(MdwMenuManager.MDW_MENU_PREFIX + "launch.task.manager");
    action.setText(launchAction.getLabel());
    action.setImageDescriptor(launchAction.getImageDescriptor());
    return action;
}
Also used : WebLaunchAction(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction) IAction(org.eclipse.jface.action.IAction) IWorkbenchAction(org.eclipse.ui.actions.ActionFactory.IWorkbenchAction) Action(org.eclipse.jface.action.Action) WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) IAction(org.eclipse.jface.action.IAction) WebLaunchAction(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject)

Example 13 with WorkflowPackage

use of com.centurylink.mdw.plugin.designer.model.WorkflowPackage in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method pasteApplies.

public boolean pasteApplies(IStructuredSelection selection) {
    if (selection.size() == 1 && selection.getFirstElement() instanceof WorkflowElement) {
        WorkflowElement element = (WorkflowElement) selection.getFirstElement();
        WorkflowPackage pkg = element.getPackage();
        if (pkg != null && !pkg.isArchived() && pkg.isUserAuthorized(UserRoleVO.ASSET_DESIGN))
            return true;
    }
    return false;
}
Also used : WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) WorkflowElement(com.centurylink.mdw.plugin.designer.model.WorkflowElement)

Example 14 with WorkflowPackage

use of com.centurylink.mdw.plugin.designer.model.WorkflowPackage in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method createWebToolsAction.

private IAction createWebToolsAction() {
    IAction action = new Action() {

        @Override
        public void run() {
            if (webLaunchApplies(getSelection())) {
                if (getSelection().getFirstElement() instanceof WorkflowProject) {
                    WorkflowProject project = (WorkflowProject) getSelection().getFirstElement();
                    WebLaunchActions.getLaunchAction(project, WebApp.WebTools).launch(project);
                } else if (getSelection().getFirstElement() instanceof WorkflowPackage) {
                    WorkflowPackage pkg = (WorkflowPackage) getSelection().getFirstElement();
                    WebLaunchActions.getLaunchAction(pkg.getProject(), WebApp.WebTools).launch(pkg);
                }
            }
        }
    };
    WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(null, WebApp.WebTools);
    action.setId(MdwMenuManager.MDW_MENU_PREFIX + "launch.web.tools");
    action.setText(launchAction.getLabel());
    action.setImageDescriptor(launchAction.getImageDescriptor());
    return action;
}
Also used : WebLaunchAction(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction) IAction(org.eclipse.jface.action.IAction) IWorkbenchAction(org.eclipse.ui.actions.ActionFactory.IWorkbenchAction) Action(org.eclipse.jface.action.Action) WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) IAction(org.eclipse.jface.action.IAction) WebLaunchAction(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject)

Example 15 with WorkflowPackage

use of com.centurylink.mdw.plugin.designer.model.WorkflowPackage in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method importTaskTemplateApplies.

public boolean importTaskTemplateApplies(IStructuredSelection selection) {
    if (selection.size() != 1 || !(selection.getFirstElement() instanceof WorkflowElement))
        return false;
    WorkflowElement element = (WorkflowElement) selection.getFirstElement();
    if (element.isArchived() || !element.getProject().isFilePersist())
        return false;
    if (!(element instanceof WorkflowPackage))
        return false;
    WorkflowPackage pkg = (WorkflowPackage) element;
    return !pkg.isDefaultPackage() && pkg.isUserAuthorized(UserRoleVO.ASSET_DESIGN);
}
Also used : WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) WorkflowElement(com.centurylink.mdw.plugin.designer.model.WorkflowElement)

Aggregations

WorkflowPackage (com.centurylink.mdw.plugin.designer.model.WorkflowPackage)85 WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)31 ArrayList (java.util.ArrayList)27 WorkflowElement (com.centurylink.mdw.plugin.designer.model.WorkflowElement)25 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)21 WorkflowAsset (com.centurylink.mdw.plugin.designer.model.WorkflowAsset)17 AutomatedTestCase (com.centurylink.mdw.plugin.designer.model.AutomatedTestCase)11 GridData (org.eclipse.swt.layout.GridData)11 CoreException (org.eclipse.core.runtime.CoreException)9 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)9 SelectionEvent (org.eclipse.swt.events.SelectionEvent)9 DesignerProxy (com.centurylink.mdw.plugin.designer.DesignerProxy)8 List (java.util.List)8 Label (org.eclipse.swt.widgets.Label)8 JSONException (org.json.JSONException)8 PackageVO (com.centurylink.mdw.model.value.process.PackageVO)7 ExternalEvent (com.centurylink.mdw.plugin.designer.model.ExternalEvent)7 Folder (com.centurylink.mdw.plugin.designer.model.Folder)7 IOException (java.io.IOException)7 InvocationTargetException (java.lang.reflect.InvocationTargetException)7