Search in sources :

Example 6 with WebLaunchAction

use of com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction 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 7 with WebLaunchAction

use of com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction in project mdw-designer by CenturyLinkCloud.

the class MdwHubAction method populateMenu.

/**
 * populates the plugin action menu (the mdwhub icon) with its items
 */
public void populateMenu(Menu menu) {
    WorkflowProjectManager wfProjectMgr = WorkflowProjectManager.getInstance();
    List<WorkflowProject> workflowProjects = wfProjectMgr.getWorkflowProjects();
    if (workflowProjects.isEmpty()) {
        MenuItem item = new MenuItem(menu, SWT.NONE);
        item.setText("(No Projects)");
        item.setImage(MdwPlugin.getImageDescriptor("icons/wait.gif").createImage());
        item.setEnabled(false);
    } else {
        for (final WorkflowProject workflowProject : workflowProjects) {
            if (workflowProject.checkRequiredVersion(5, 5)) {
                String projName = workflowProject.isFrameworkProject() ? "MDWFramework" : workflowProject.getName();
                // MDWWeb
                MenuItem item = new MenuItem(menu, SWT.NONE);
                final WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(workflowProject, WebApp.MdwHub);
                item.setText(projName + " - " + launchAction.getLabel());
                item.setImage(launchAction.getIconImage());
                item.addSelectionListener(new SelectionAdapter() {

                    public void widgetSelected(SelectionEvent e) {
                        mostRecentHubWorkflowProject = workflowProject;
                        launchAction.launch(workflowProject);
                    }
                });
            }
        }
    }
}
Also used : WebLaunchAction(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) MenuItem(org.eclipse.swt.widgets.MenuItem) WorkflowProjectManager(com.centurylink.mdw.plugin.project.WorkflowProjectManager)

Example 8 with WebLaunchAction

use of com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction in project mdw-designer by CenturyLinkCloud.

the class WorkflowElementActionHandler method runFromPage.

public void runFromPage(WorkflowElement element) {
    if (element instanceof WorkflowProcess) {
        WorkflowProcess processVersion = (WorkflowProcess) element;
        IEditorPart editorPart = findOpenEditor(processVersion);
        if (editorPart != null && editorPart.isDirty()) {
            if (MessageDialog.openQuestion(getShell(), "Process Launch", "Save process '" + processVersion.getLabel() + "' before launching?"))
                editorPart.doSave(new NullProgressMonitor());
        }
        WebApp webapp = WebApp.TaskManager;
        if (element.getProject().checkRequiredVersion(5, 5) && !processVersion.isCompatibilityRendering())
            webapp = WebApp.MdwHub;
        WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(element.getProject(), webapp);
        String urlPath = "/start.jsf?process=" + processVersion.getName();
        if (webapp.equals(WebApp.MdwHub)) {
            urlPath = urlPath + "&processVersion=" + processVersion.getVersion();
        }
        launchAction.launch(element.getProject(), urlPath);
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) WebLaunchAction(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction) IEditorPart(org.eclipse.ui.IEditorPart) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) WebApp(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebApp)

Example 9 with WebLaunchAction

use of com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method createMdwHubAction.

private IAction createMdwHubAction() {
    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.MdwHub).launch(project);
                } else if (getSelection().getFirstElement() instanceof WorkflowPackage) {
                    WorkflowPackage packageVersion = (WorkflowPackage) getSelection().getFirstElement();
                    WebLaunchActions.getLaunchAction(packageVersion.getProject(), WebApp.MdwHub).launch(packageVersion);
                }
            }
        }
    };
    WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(null, WebApp.MdwHub);
    action.setId(MdwMenuManager.MDW_MENU_PREFIX + "launch.hub");
    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 10 with WebLaunchAction

use of com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction in project mdw-designer by CenturyLinkCloud.

the class MdwHubAction method run.

public void run(IAction action) {
    WorkflowProject workflowProject = getProject(getSelection());
    WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(workflowProject, WebApp.MdwHub);
    if (workflowProject != null)
        launchAction.launch(workflowProject);
    else if (mostRecentHubWorkflowProject != null)
        launchAction.launch(mostRecentHubWorkflowProject);
}
Also used : WebLaunchAction(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject)

Aggregations

WebLaunchAction (com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction)12 WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)9 WebApp (com.centurylink.mdw.plugin.actions.WebLaunchActions.WebApp)3 WorkflowPackage (com.centurylink.mdw.plugin.designer.model.WorkflowPackage)3 WorkflowProjectManager (com.centurylink.mdw.plugin.project.WorkflowProjectManager)3 Action (org.eclipse.jface.action.Action)3 IAction (org.eclipse.jface.action.IAction)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 MenuItem (org.eclipse.swt.widgets.MenuItem)3 IWorkbenchAction (org.eclipse.ui.actions.ActionFactory.IWorkbenchAction)3 MdwInputDialog (com.centurylink.mdw.plugin.designer.dialogs.MdwInputDialog)1 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)1 ParseException (java.text.ParseException)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 IEditorPart (org.eclipse.ui.IEditorPart)1