public RemovePotentialMatchesAction(IWorkbenchSite site) { fSite= site; if (usePluralLabel()) { setText(SearchMessages.RemovePotentialMatchesAction_removePotentialMatches_text); setToolTipText(SearchMessages.RemovePotentialMatchesAction_removePotentialMatches_tooltip); } else { setText(SearchMessages.RemovePotentialMatchesAction_removePotentialMatch_text); setToolTipText(SearchMessages.RemovePotentialMatchesAction_removePotentialMatch_tooltip); } }
public void run() { IMarker[] markers= getMarkers(); if (markers != null) try { SearchPlugin.getWorkspace().deleteMarkers(markers); } catch (CoreException ex) { ExceptionHandler.handle(ex, SearchMessages.Search_Error_deleteMarkers_title, SearchMessages.Search_Error_deleteMarkers_message); } else { String title= SearchMessages.RemovePotentialMatchesAction_dialog_title; String message= SearchMessages.RemovePotentialMatchesAction_dialog_message; MessageDialog.openInformation(fSite.getShell(), title, message); } // action only makes sense once setEnabled(false); }
menu.appendToGroup(IContextMenuConstants.GROUP_REMOVE_MATCHES, new RemovePotentialMatchesAction(fOuterPart.getViewSite()));
@Override public void run() { IMarker[] markers= getMarkers(); if (markers != null) try { SearchPlugin.getWorkspace().deleteMarkers(markers); } catch (CoreException ex) { ExceptionHandler.handle(ex, SearchMessages.Search_Error_deleteMarkers_title, SearchMessages.Search_Error_deleteMarkers_message); } else { String title= SearchMessages.RemovePotentialMatchesAction_dialog_title; String message= SearchMessages.RemovePotentialMatchesAction_dialog_message; MessageDialog.openInformation(fSite.getShell(), title, message); } // action only makes sense once setEnabled(false); }
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); } }
public RemovePotentialMatchesAction(IWorkbenchSite site) { fSite= site; if (usePluralLabel()) { setText(SearchMessages.RemovePotentialMatchesAction_removePotentialMatches_text); setToolTipText(SearchMessages.RemovePotentialMatchesAction_removePotentialMatches_tooltip); } else { setText(SearchMessages.RemovePotentialMatchesAction_removePotentialMatch_text); setToolTipText(SearchMessages.RemovePotentialMatchesAction_removePotentialMatch_tooltip); } }