use of org.eclipse.ui.actions.OpenWithMenu in project egit by eclipse.
the class RepositoriesViewActionProvider method fillContextMenu.
@Override
public void fillContextMenu(IMenuManager menu) {
ISelection s = getContext().getSelection();
if (s.isEmpty() || !(s instanceof IStructuredSelection))
return;
IStructuredSelection selection = (IStructuredSelection) s;
ICommonViewerWorkbenchSite site = (ICommonViewerWorkbenchSite) getActionSite().getViewSite();
if (shouldAddShowInMenu(selection)) {
MenuManager showInSubMenu = UIUtils.createShowInMenu(site.getWorkbenchWindow());
menu.appendToGroup(ICommonMenuConstants.GROUP_SHOW, showInSubMenu);
}
IFile file = getSelectedFile(selection);
if (file != null) {
MenuManager openWithSubMenu = new MenuManager(UIText.RepositoriesViewActionProvider_OpenWithMenu);
openWithSubMenu.add(new OpenWithMenu(site.getPage(), file));
menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, openWithSubMenu);
}
}
Aggregations