/** * Removes all matches from this search result. * * <p>Subclasses may extend this method. */ public void removeAll() { synchronized (fElementsToMatches) { doRemoveAll(); } fireChange(new RemoveAllEvent(this)); }
@Override public void run() { Match match= fPage.getCurrentMatch(); AbstractTextSearchResult result= fPage.getInput(); if (match != null && result != null) result.removeMatch(match); }
/** * Handles a search result event for the current search result. * * @since 3.2 */ protected void handleSearchResultChanged(final SearchResultEvent e) { if (e instanceof MatchEvent) { postUpdate(((MatchEvent) e).getMatches()); } else if (e instanceof RemoveAllEvent) { postClear(); } else if (e instanceof FilterUpdateEvent) { postUpdate(((FilterUpdateEvent) e).getUpdatedMatches()); updateFilterActions(fFilterActions); } }
@Override public Object[] getElements(Object inputElement) { if (inputElement instanceof AbstractTextSearchResult) return ((AbstractTextSearchResult) inputElement).getElements(); return new Object[0]; }
private void gotoNextMatch(boolean activateEditor) { fCurrentMatchIndex++; Match nextMatch = getCurrentMatch(); if (nextMatch == null) { navigateNext(true); fCurrentMatchIndex = 0; } showCurrentMatch(activateEditor); }
@Override protected StructuredViewer getViewer() { // override so that it's visible in the package. return super.getViewer(); }
private boolean showCurrentMatch(boolean activateEditor) { Match currentMatch = getCurrentMatch(); if (currentMatch != null) { showMatch(currentMatch, activateEditor); return true; } return false; }
private FileTextSearchScope(String description, IResource[] resources, IWorkingSet[] workingSets, String[] fileNamePatterns, boolean visitDerived) { fDescription= description; fRootElements= resources; fFileNamePatterns= fileNamePatterns; fVisitDerived= visitDerived; fWorkingSets= workingSets; fPositiveFileNameMatcher= createMatcher(fileNamePatterns, false); fNegativeFileNameMatcher= createMatcher(fileNamePatterns, true); }
@Override public void queryFinished(final ISearchQuery query) { // handle the end of the query in the UIUpdateJob, as ui updates // may not be finished here. postEnsureSelection(); } };
/** * Selects the element corresponding to the next match and shows the match * in an editor. Note that this will cycle back to the first match after the * last match. */ public void gotoNextMatch() { gotoNextMatch(false); }
/** * Removes all matches from this search result. * <p> * Subclasses may extend this method. * </p> */ public void removeAll() { synchronized (fElementsToMatches) { doRemoveAll(); } fireChange(new RemoveAllEvent(this)); } private void doRemoveAll() {
public void run() { Match match= fPage.getCurrentMatch(); AbstractTextSearchResult result= fPage.getInput(); if (match != null && result != null) result.removeMatch(match); }
/** * Removes all matches from this search result. * <p> * Subclasses may extend this method. * </p> */ public void removeAll() { synchronized (fElementsToMatches) { doRemoveAll(); } fireChange(new RemoveAllEvent(this)); } private void doRemoveAll() {