use of org.eclipse.ui.actions.ActionContext in project tdi-studio-se by Talend.
the class JobHierarchyViewPart method fillJobViewerContextMenu.
private void fillJobViewerContextMenu(JobHierarchyViewer viewer, IMenuManager menu) {
// viewer entries
// ISelection selection = viewer.getSelection();
// if (focusOnSelectionAction.canActionBeAdded())
// menu.appendToGroup(GROUP_FOCUS, focusOnSelectionAction);
// menu.appendToGroup(GROUP_FOCUS, fFocusOnTypeAction);
menu.add(focusOnTypeAction);
fActionGroups.setContext(new ActionContext(getSite().getSelectionProvider().getSelection()));
fActionGroups.fillContextMenu(menu);
fActionGroups.setContext(null);
}
use of org.eclipse.ui.actions.ActionContext in project eclipse.platform.text by eclipse.
the class SearchResultViewer method fillContextMenu.
void fillContextMenu(IMenuManager menu) {
ISelection selection = getSelection();
if (fActionGroup != null) {
ActionContext context = new ActionContext(selection);
context.setInput(getInput());
fActionGroup.setContext(context);
fActionGroup.fillContextMenu(menu);
fActionGroup.setContext(null);
}
if (fContextMenuContributor != null)
fContextMenuContributor.fill(menu, this);
if (!selection.isEmpty()) {
menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, fCopyToClipboardAction);
menu.appendToGroup(IContextMenuConstants.GROUP_GOTO, fGotoMarkerActionProxy);
if (enableRemoveMatchMenuItem())
menu.appendToGroup(IContextMenuConstants.GROUP_REMOVE_MATCHES, new RemoveMatchAction(this));
menu.appendToGroup(IContextMenuConstants.GROUP_REMOVE_MATCHES, new RemoveResultAction(this, true));
if (isPotentialMatchSelected())
menu.appendToGroup(IContextMenuConstants.GROUP_REMOVE_MATCHES, new RemovePotentialMatchesAction(fOuterPart.getViewSite()));
}
// If we have elements
if (getItemCount() > 0)
menu.appendToGroup(IContextMenuConstants.GROUP_REMOVE_MATCHES, new RemoveAllResultsAction());
menu.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, fSearchAgainAction);
if (getItemCount() > 0) {
fSortDropDownAction = fSortDropDownAction.renew();
if (fSortDropDownAction.getSorterCount() > 1)
menu.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, fSortDropDownAction);
}
}
use of org.eclipse.ui.actions.ActionContext in project erlide_eclipse by erlang.
the class ErlangEditor method editorContextMenuAboutToShow.
@Override
protected void editorContextMenuAboutToShow(final IMenuManager menu) {
super.editorContextMenuAboutToShow(menu);
if (SystemConfiguration.getInstance().isClearCacheAvailable()) {
setupClearCacheActions();
menu.prependToGroup(ITextEditorActionConstants.GROUP_SETTINGS, clearCacheAction);
menu.prependToGroup(ITextEditorActionConstants.GROUP_SETTINGS, clearAllCachesAction);
}
menu.prependToGroup(ITextEditorActionConstants.GROUP_OPEN, compileAction);
menu.prependToGroup(ITextEditorActionConstants.GROUP_OPEN, fShowOutline);
addCommonActions(menu);
menu.appendToGroup(ITextEditorActionConstants.GROUP_FIND, callhierarchy);
final ActionContext context = new ActionContext(getSelectionProvider().getSelection());
fContextMenuGroup.setContext(context);
fContextMenuGroup.fillContextMenu(menu);
fContextMenuGroup.setContext(null);
}
use of org.eclipse.ui.actions.ActionContext in project erlide_eclipse by erlang.
the class ErlangSearchResultPage method fillContextMenu.
@Override
protected void fillContextMenu(final IMenuManager mgr) {
super.fillContextMenu(mgr);
addSortActions(mgr);
fActionGroup.setContext(new ActionContext(getSite().getSelectionProvider().getSelection()));
fActionGroup.fillContextMenu(mgr);
}
use of org.eclipse.ui.actions.ActionContext in project erlide_eclipse by erlang.
the class ImplementorsSearchGroup method addWorkingSetAction.
private void addWorkingSetAction(final IWorkingSet[] workingSets, final IMenuManager manager) {
FindAction action;
if (fEditor != null) {
action = new WorkingSetFindAction(fEditor, new FindReferencesInWorkingSetAction(fEditor, workingSets), SearchUtil.toString(workingSets));
} else {
action = new WorkingSetFindAction(fSite, new FindReferencesInWorkingSetAction(fSite, workingSets), SearchUtil.toString(workingSets));
}
final ActionContext context = getContext();
if (context != null) {
action.update(context.getSelection());
}
addAction(action, manager);
}
Aggregations