use of com.centurylink.mdw.plugin.designer.model.WorkflowElement in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createDebugAction.
private IAction createDebugAction() {
IAction action = new Action() {
@Override
public void run() {
if (!debugApplies(getSelection()))
return;
view.setFocus();
Object element = getSelection().getFirstElement();
if (element instanceof AutomatedTestSuite || element instanceof AutomatedTestCase)
actionHandler.debugTest(getSelection());
else
actionHandler.debug((WorkflowElement) element);
}
};
ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor("icons/debug.gif");
action.setImageDescriptor(imageDesc);
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "debug");
action.setText("Debug...");
return action;
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowElement 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.designer.model.WorkflowElement in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method importTaskTemplateApplies.
public boolean importTaskTemplateApplies(IStructuredSelection selection) {
if (selection.size() != 1 || !(selection.getFirstElement() instanceof WorkflowElement))
return false;
WorkflowElement element = (WorkflowElement) selection.getFirstElement();
if (element.isArchived() || !element.getProject().isFilePersist())
return false;
if (!(element instanceof WorkflowPackage))
return false;
WorkflowPackage pkg = (WorkflowPackage) element;
return !pkg.isDefaultPackage() && pkg.isUserAuthorized(UserRoleVO.ASSET_DESIGN);
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowElement 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.designer.model.WorkflowElement in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createFormatLoadTestResultsAction.
private IAction createFormatLoadTestResultsAction() {
IAction action = new Action() {
@Override
public void run() {
if (formatLoadTestResultsApplies(getSelection())) {
WorkflowElement element = (WorkflowElement) getSelection().getFirstElement();
actionHandler.formatResults(element.getProject(), AutomatedTestCase.LOAD_TEST);
}
}
};
ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor("icons/load_test.gif");
action.setImageDescriptor(imageDesc);
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "format.load.test.results");
action.setText("Load Test Results");
return action;
}
Aggregations