use of com.centurylink.mdw.plugin.project.model.WorkflowProject 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.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createFormatActionGroup.
private ActionGroup createFormatActionGroup() {
formatMenu = new MenuManager("Format", null, MdwMenuManager.MDW_MENU_PREFIX + "menu.format");
return new ActionGroup() {
@Override
public void fillContextMenu(IMenuManager menu) {
formatMenu.removeAll();
IStructuredSelection selection = getSelection();
WorkflowProject project = ((WorkflowElement) selection.getFirstElement()).getProject();
if (formatFunctionTestResultsApplies(selection))
formatMenu.add(formatFunctionTestResultsAction);
java.io.File resultsFile = project.getFunctionTestResultsFile();
formatFunctionTestResultsAction.setEnabled(resultsFile != null && resultsFile.exists());
if (formatLoadTestResultsApplies(selection))
formatMenu.add(formatLoadTestResultsAction);
resultsFile = project.getLoadTestResultsFile();
formatLoadTestResultsAction.setEnabled(resultsFile != null && resultsFile.exists());
}
};
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method getImportAttributeActions.
private List<IAction> getImportAttributeActions(IStructuredSelection selection) {
List<IAction> importAttributesActions = new ArrayList<>();
if (selection != null && selection.getFirstElement() instanceof WorkflowElement) {
// bam
IAction action = new Action() {
@Override
public void run() {
if (!importAttributesApplies(getSelection()))
return;
view.setFocus();
actionHandler.importAttributes(WorkAttributeConstant.BAM_ATTR_PREFIX, (WorkflowElement) getSelection().getFirstElement());
}
};
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "import.monitoring");
action.setText("Monitoring...");
importAttributesActions.add(action);
// simulation
action = new Action() {
@Override
public void run() {
if (!importAttributesApplies(getSelection()))
return;
view.setFocus();
actionHandler.importAttributes(WorkAttributeConstant.SIMULATION_ATTR_PREFIX, (WorkflowElement) getSelection().getFirstElement());
}
};
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "import.simulation");
action.setText("Simulation...");
importAttributesActions.add(action);
// pagelet-driven attributes
WorkflowProject project = ((WorkflowElement) selection.getFirstElement()).getProject();
List<PageletTab> pageletTabs = project.getPageletTabs();
if (pageletTabs != null) {
for (PageletTab pageletTab : pageletTabs) {
final String prefix = pageletTab.getOverrideAttributePrefix();
action = new Action() {
@Override
public void run() {
if (!importAttributesApplies(getSelection()))
return;
view.setFocus();
actionHandler.importAttributes(prefix, (WorkflowElement) getSelection().getFirstElement());
}
};
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "import.attributes." + prefix);
action.setText(pageletTab.getLabel() + "...");
importAttributesActions.add(action);
}
}
}
return importAttributesActions;
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class AutomatedTestLaunchShortcut method createLaunchConfiguration.
protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(WorkflowElement element, boolean debug) throws CoreException, JSONException {
String testName = null;
List<String> testCases = new ArrayList<>();
WorkflowProject workflowProject = element.getProject();
WorkflowPackage workflowPackage = null;
boolean isLegacyLaunch = false;
if (element instanceof WorkflowProject) {
testName = workflowProject.getName();
testCases = workflowProject.getTestCaseStringList();
} else if (element instanceof WorkflowPackage) {
workflowPackage = (WorkflowPackage) element;
testName = workflowPackage.getName();
testCases = workflowPackage.getTestCaseStringList();
} else if (element instanceof AutomatedTestCase) {
AutomatedTestCase testCase = (AutomatedTestCase) element;
if (testCase.isLegacy()) {
testName = workflowProject.getName() + LEGACY;
isLegacyLaunch = true;
} else {
workflowPackage = testCase.getPackage();
testName = workflowPackage.getName();
}
testCases = new ArrayList<>();
if (testCase.isPostman() && testCase.getItems() != null && workflowPackage != null) {
testCases.addAll(workflowPackage.getTestCaseItems(testCase));
} else
testCases.add(testCase.getPath());
} else if (element instanceof AutomatedTestSuite) {
testName = workflowProject.getName() + LEGACY;
isLegacyLaunch = true;
testCases = ((AutomatedTestSuite) element).getTestCaseStringList();
}
return createLaunchConfiguration(workflowProject, workflowPackage, isLegacyLaunch, testName, testCases, debug);
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class AutomatedTestLaunchShortcut method launch.
public void launch(IEditorPart editor, String mode) {
if (editor.getEditorInput() instanceof IFileEditorInput) {
IFileEditorInput fileEditorInput = (IFileEditorInput) editor.getEditorInput();
IFile file = fileEditorInput.getFile();
WorkflowProject project = WorkflowProjectManager.getInstance().getWorkflowProject(file.getProject());
WorkflowPackage pkg = project.getPackage((IFolder) file.getParent());
try {
performLaunch(pkg.getAsset(file), mode);
} catch (CoreException | JSONException ex) {
PluginMessages.uiError(ex, "Test Exec", project);
}
}
}
Aggregations