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;
}
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);
}
});
}
}
}
}
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);
}
}
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;
}
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);
}
Aggregations