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 (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);
}
}