Search in sources :

Example 1 with WebLaunchAction

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

the class WebToolsAction method run.

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

Example 2 with WebLaunchAction

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

the class WebToolsAction method populateMenu.

/**
 * populates the plugin action menu (the webtools 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();
            // MDWWeb
            MenuItem item = new MenuItem(menu, SWT.NONE);
            final WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(workflowProject, WebApp.WebTools);
            item.setText(projName + " - " + launchAction.getLabel());
            item.setImage(launchAction.getIconImage());
            item.addSelectionListener(new SelectionAdapter() {

                public void widgetSelected(SelectionEvent e) {
                    mostRecentWebToolsLaunchWorkflowProject = 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 3 with WebLaunchAction

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

the class NotificationChecker method doCheck.

private void doCheck() {
    if (running) {
        try {
            String msg = checkNotices();
            if (msg != null) {
                WebApp webapp = workflowProject.checkRequiredVersion(5, 5) ? WebApp.MdwHub : WebApp.TaskManager;
                WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(workflowProject, webapp);
                String urlPath;
                if (taskInstanceId == null)
                    urlPath = workflowProject.getMyTasksPath();
                else
                    urlPath = workflowProject.getTaskInstancePath(taskInstanceId, isAssigned);
                showBalloon(msg, launchAction, urlPath);
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}
Also used : WebLaunchAction(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction) ParseException(java.text.ParseException) WebApp(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebApp)

Example 4 with WebLaunchAction

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

the class Page method run.

public void run() {
    boolean is55 = getProject().checkRequiredVersion(5, 5);
    String urlPath;
    if (isTaskInstancePage()) {
        MdwInputDialog dlg = new MdwInputDialog(MdwPlugin.getShell(), "Task Instance ID", false);
        if (dlg.open() != Dialog.OK)
            return;
        try {
            Long taskInstanceId = new Long(dlg.getInput());
            urlPath = getProject().getTaskInstancePath(taskInstanceId);
        } catch (NumberFormatException ex) {
            MessageDialog.openError(MdwPlugin.getShell(), "Invalid Input", "Invalid task instance ID: " + dlg.getInput());
            return;
        }
    } else {
        // TODO: why does new path format not work?
        // if (is55)
        // urlPath = TaskAttributeConstant.PAGE_PATH + getName();
        // else
        urlPath = TaskAttributeConstant.PAGE_COMPATIBILITY_PATH + getName();
    }
    WebApp webapp = is55 ? WebApp.MdwHub : WebApp.TaskManager;
    WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(getProject(), webapp);
    launchAction.launch(getPackage(), urlPath);
}
Also used : WebLaunchAction(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction) MdwInputDialog(com.centurylink.mdw.plugin.designer.dialogs.MdwInputDialog) WebApp(com.centurylink.mdw.plugin.actions.WebLaunchActions.WebApp)

Example 5 with WebLaunchAction

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

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