use of org.eclipse.ui.actions.ActionGroup 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 org.eclipse.ui.actions.ActionGroup in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createNewActionGroup.
private ActionGroup createNewActionGroup() {
newMenu = new MenuManager("New", null, MdwMenuManager.MDW_MENU_PREFIX + "menu.new");
return new ActionGroup() {
@Override
public void fillContextMenu(IMenuManager menu) {
newMenu.removeAll();
IStructuredSelection selection = getSelection();
if (!newMenuApplies(selection))
return;
if (!MdwPlugin.isRcp())
newMenu.add(newCloudProjectAction);
if (createApplies(WorkflowProject.class, selection))
newMenu.add(newRemoteProjectAction);
newMenu.add(new Separator());
if (createApplies(WorkflowPackage.class, selection))
newMenu.add(newPackageAction);
if (createApplies(WorkflowProcess.class, selection))
newMenu.add(newProcessAction);
newMenu.add(new Separator());
if (createApplies(Activity.class, selection)) {
MenuManager activityMenu = new MenuManager("Activity", null, MdwMenuManager.MDW_MENU_PREFIX + "menu.new.activity");
activityMenu.add(newGeneralActivityAction);
activityMenu.add(newStartActivityAction);
activityMenu.add(newAdapterActivityAction);
activityMenu.add(newEvaluatorActivityAction);
newMenu.add(activityMenu);
}
if (createApplies(ExternalEvent.class, selection)) {
MenuManager eventHandlerMenu = new MenuManager("Event Handler", null, MdwMenuManager.MDW_MENU_PREFIX + "menu.new.event.handler");
eventHandlerMenu.add(newEventHandlerAction);
eventHandlerMenu.add(newCamelProcessHandlerAction);
eventHandlerMenu.add(newCamelNotifyHandlerAction);
newMenu.add(eventHandlerMenu);
}
newMenu.add(new Separator());
if (createApplies(WorkflowAsset.class, selection)) {
newMenu.add(new Separator());
newMenu.add(newCamelRouteAction);
newMenu.add(newJarFileAction);
newMenu.add(newJavaSourceAction);
newMenu.add(newJsonAction);
newMenu.add(newKotlinAction);
newMenu.add(newPageAction);
newMenu.add(newReportAction);
newMenu.add(newRuleAction);
newMenu.add(newScriptAction);
newMenu.add(newSpringConfigAction);
if (selection.getFirstElement() instanceof WorkflowElement && ((WorkflowElement) selection.getFirstElement()).getProject().isFilePersist())
newMenu.add(newTaskTemplateAction);
newMenu.add(newTemplateAction);
newMenu.add(newTestCaseAction);
newMenu.add(newTextResourceAction);
newMenu.add(newWebResourceAction);
newMenu.add(newWordDocAction);
newMenu.add(newXmlDocAction);
newMenu.add(newYamlAction);
newMenu.add(newKotlinAction);
newMenu.add(new Separator());
}
newMenu.add(new Separator(OTHER));
IWorkbenchAction otherAction = ActionFactory.NEW.create(getViewSite().getWorkbenchWindow());
otherAction.setId(MdwMenuManager.MDW_MENU_PREFIX + "new.other");
otherAction.setText(OTHER_DOT);
newMenu.add(otherAction);
}
};
}
use of org.eclipse.ui.actions.ActionGroup 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 org.eclipse.ui.actions.ActionGroup in project erlide_eclipse by erlang.
the class ErlangOutlinePage method createControl.
@Override
public void createControl(final Composite parent) {
final Tree tree = new Tree(parent, SWT.MULTI);
fOutlineViewer = new TreeViewer(tree);
fOutlineViewer.setAutoExpandLevel(0);
fOutlineViewer.setUseHashlookup(true);
fOutlineViewer.setContentProvider(fEditor.createOutlineContentProvider());
fOutlineViewer.setLabelProvider(fEditor.createOutlineLabelProvider());
fOutlineViewer.addPostSelectionChangedListener(this);
fOutlineViewer.setInput(fModule);
final IPageSite site = getSite();
fOpenAndLinkWithEditorHelper = new OpenAndLinkWithEditorHelper(fOutlineViewer, fEditor, site.getPage());
final IContextService service = site.getService(IContextService.class);
if (service != null) {
service.activateContext("org.erlide.ui.erlangOutlineAndNavigatorScope");
}
final MenuManager manager = new MenuManager();
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(final IMenuManager m) {
// recursive loop?
// menuAboutToShow(m);
contextMenuAboutToShow(m);
}
});
final Menu menu = manager.createContextMenu(tree);
tree.setMenu(menu);
site.registerContextMenu(ErlangCore.PLUGIN_ID + ".outline", manager, fOutlineViewer);
fActionGroups = new CompositeActionGroup(new ActionGroup[] { new ErlangSearchActionGroup(this) });
// register global actions
final IActionBars actionBars = site.getActionBars();
actionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, fEditor.getAction(ITextEditorActionConstants.UNDO));
actionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, fEditor.getAction(ITextEditorActionConstants.REDO));
fActionGroups.fillActionBars(actionBars);
registerToolbarActions(actionBars);
final IHandlerService handlerService = site.getService(IHandlerService.class);
if (handlerService != null) {
handlerService.activateHandler(IWorkbenchCommandConstants.NAVIGATE_TOGGLE_LINK_WITH_EDITOR, new ActionHandler(fToggleLinkingAction));
}
fPartListener = new IPartListener() {
@Override
public void partOpened(final IWorkbenchPart part) {
// JC borde filter-metoden ovan r�cka?
addFilters();
}
@Override
public void partDeactivated(final IWorkbenchPart part) {
}
@Override
public void partClosed(final IWorkbenchPart part) {
}
@Override
public void partBroughtToTop(final IWorkbenchPart part) {
}
@Override
public void partActivated(final IWorkbenchPart part) {
addFilters();
}
};
getSite().getPage().addPartListener(fPartListener);
}
use of org.eclipse.ui.actions.ActionGroup in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createRunActionGroup.
private ActionGroup createRunActionGroup() {
runMenu = new MenuManager("Run", MdwPlugin.getImageDescriptor(ICON_RUN_GIF), MdwMenuManager.MDW_MENU_PREFIX + "menu.run");
return new ActionGroup() {
@Override
public void fillContextMenu(IMenuManager menu) {
runMenu.removeAll();
IStructuredSelection selection = getSelection();
if (runOnServerApplies(selection))
runMenu.add(runOnServerAction);
if (runTestsApplies(selection))
runMenu.add(runTestsAction);
}
};
}
Aggregations