use of com.centurylink.mdw.plugin.project.model.WorkflowProject 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;
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createImportVcsAction.
private IAction createImportVcsAction() {
IAction action = new Action() {
@Override
public void run() {
if (!importVcsApplies(getSelection()))
return;
WorkflowElement selection = (WorkflowElement) getSelection().getFirstElement();
WorkflowProject workflowProject = selection.getProject();
boolean authorized = workflowProject.getDesignerDataModel().userHasRoleInAnyGroup(UserRoleVO.PROCESS_DESIGN);
if (!authorized) {
MessageDialog.openError(getViewSite().getShell(), "Package Import", NOT_AUTHORIZED + workflowProject.getName());
return;
}
actionHandler.remoteImportVcs(selection.getProject());
}
};
ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor("icons/gitrepo.gif");
action.setImageDescriptor(imageDesc);
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "assets.from.vcs");
action.setText("Assets from VCS...");
return action;
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createServerActionGroup.
private ActionGroup createServerActionGroup() {
serverMenu = new MenuManager("Server", MdwPlugin.getImageDescriptor("icons/server.gif"), MdwMenuManager.MDW_MENU_PREFIX + "menu.server");
return new ActionGroup() {
@Override
public void fillContextMenu(IMenuManager menu) {
serverMenu.removeAll();
IStructuredSelection selection = getSelection();
if (serverActionApplies(selection)) {
WorkflowProject project = (WorkflowProject) selection.getFirstElement();
if (project.isUserAuthorizedForSystemAdmin())
serverMenu.add(refreshCachesAction);
if (!project.isRemote() || project.isUserAuthorizedForSystemAdmin()) {
stubServerAction.setChecked(project.getDesignerProxy().isStubServerRunning());
serverMenu.add(stubServerAction);
logWatcherAction.setChecked(DesignerProxy.isLogWatcherRunning());
serverMenu.add(logWatcherAction);
}
if (!MdwPlugin.isRcp()) {
if (!serverMenu.isEmpty())
serverMenu.add(new Separator("VM"));
serverMenu.add(visualVmAction);
serverMenu.add(jconsoleAction);
}
}
}
};
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createImportPackageAction.
private IAction createImportPackageAction() {
IAction action = new Action() {
@Override
public void run() {
if (!importPackageApplies(getSelection()))
return;
WorkflowElement selection = (WorkflowElement) getSelection().getFirstElement();
WorkflowProject workflowProject = selection.getProject();
boolean authorized = (workflowProject.isFilePersist() && !workflowProject.isRemote()) || workflowProject.getDesignerDataModel().userHasRoleInAnyGroup(UserRoleVO.PROCESS_DESIGN);
if (!authorized) {
MessageDialog.openError(getViewSite().getShell(), "Package Import", NOT_AUTHORIZED + workflowProject.getName());
return;
}
actionHandler.imporT(WorkflowPackage.class, selection);
}
};
ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor(ICON_PACKAGE_GIF);
action.setImageDescriptor(imageDesc);
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "import.packages");
action.setText("Package(s)...");
return action;
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method importPackageApplies.
public boolean importPackageApplies(IStructuredSelection selection) {
if (selection.size() != 1 || !(selection.getFirstElement() instanceof WorkflowElement))
return false;
WorkflowElement element = (WorkflowElement) selection.getFirstElement();
if (element.isArchived())
return false;
if (!(element instanceof WorkflowProject))
return false;
WorkflowProject project = (WorkflowProject) element;
if (!project.isInitialized())
return false;
if (element.getProject().isRemote() && project.checkRequiredVersion(6))
return "mdw".equalsIgnoreCase(project.getRemoteAppSummary(true).getAuthMethod());
if (project.isFilePersist() && !project.isRemote())
// local file persist can always import (even Git)
return true;
return project.getDesignerDataModel().userHasRoleInAnyGroup(UserRoleVO.PROCESS_DESIGN);
}
Aggregations