Search in sources :

Example 11 with WebLaunchAction

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

the class TaskManagerAction method run.

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

Example 12 with WebLaunchAction

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

the class TaskManagerAction method populateMenu.

/**
 * populates the plugin action menu (the taskmgr 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) {
            String projName = workflowProject.isFrameworkProject() ? "MDWFramework" : workflowProject.getName();
            MenuItem item = new MenuItem(menu, SWT.NONE);
            final WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(workflowProject, WebApp.TaskManager);
            item.setText(projName + " - " + launchAction.getLabel());
            item.setImage(launchAction.getIconImage());
            item.addSelectionListener(new SelectionAdapter() {

                public void widgetSelected(SelectionEvent e) {
                    mostRecentTaskManagerWorkflowProject = 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)

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