private void updateFilterStateForAllMatches() { boolean disableFiltering= getActiveMatchFilters() == null; ArrayList<Match> changed= new ArrayList<>(); Object[] elements= getElements(); for (Object element : elements) { Match[] matches= getMatches(element); for (Match match : matches) { if (disableFiltering || updateFilterState(match)) { changed.add(match); } } } Match[] allChanges= changed.toArray(new Match[changed.size()]); fireChange(new FilterUpdateEvent(this, allChanges, getActiveMatchFilters())); }
/** * 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); } }
/** * Handles a search result event for the current search result. * @param e the event to handle * * @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); } }
private void updateFilterStateForAllMatches() { boolean disableFiltering = getActiveMatchFilters() == null; ArrayList changed = new ArrayList(); Object[] elements = getElements(); for (int i = 0; i < elements.length; i++) { Match[] matches = getMatches(elements[i]); for (int k = 0; k < matches.length; k++) { if (disableFiltering || updateFilterState(matches[k])) { changed.add(matches[k]); } } } Match[] allChanges = (Match[]) changed.toArray(new Match[changed.size()]); fireChange(new FilterUpdateEvent(this, allChanges, getActiveMatchFilters())); }
public synchronized void searchResultChanged(SearchResultEvent e) { ISearchResult searchResult= e.getSearchResult(); if (searchResult instanceof AbstractTextSearchResult) { AbstractTextSearchResult result= (AbstractTextSearchResult) searchResult; if (e instanceof MatchEvent) { MatchEvent me= (MatchEvent) e; Match[] matchesInEditor= getMatchesInEditor(me.getMatches(), result); if (matchesInEditor != null) { if (me.getKind() == MatchEvent.ADDED) { addAnnotations(matchesInEditor); } else { removeAnnotations(matchesInEditor); } } } else if (e instanceof RemoveAllEvent) { removeAnnotations(result); } else if (e instanceof FilterUpdateEvent) { Match[] matchesInEditor= getMatchesInEditor(((FilterUpdateEvent) e).getUpdatedMatches(), result); if (matchesInEditor != null) { removeAnnotations(matchesInEditor); addAnnotations(matchesInEditor); } } } }
private void updateFilterStateForAllMatches() { boolean disableFiltering= getActiveMatchFilters() == null; ArrayList changed= new ArrayList(); Object[] elements= getElements(); for (int i= 0; i < elements.length; i++) { Match[] matches= getMatches(elements[i]); for (int k= 0; k < matches.length; k++) { if (disableFiltering || updateFilterState(matches[k])) { changed.add(matches[k]); } } } Match[] allChanges= (Match[]) changed.toArray(new Match[changed.size()]); fireChange(new FilterUpdateEvent(this, allChanges, getActiveMatchFilters())); }
@Override public synchronized void searchResultChanged(SearchResultEvent e) { ISearchResult searchResult= e.getSearchResult(); if (searchResult instanceof AbstractTextSearchResult) { AbstractTextSearchResult result= (AbstractTextSearchResult) searchResult; if (e instanceof MatchEvent) { MatchEvent me= (MatchEvent) e; Match[] matchesInEditor= getMatchesInEditor(me.getMatches(), result); if (matchesInEditor != null) { if (me.getKind() == MatchEvent.ADDED) { addAnnotations(matchesInEditor); } else { removeAnnotations(matchesInEditor); } } } else if (e instanceof RemoveAllEvent) { removeAnnotations(result); } else if (e instanceof FilterUpdateEvent) { Match[] matchesInEditor= getMatchesInEditor(((FilterUpdateEvent) e).getUpdatedMatches(), result); if (matchesInEditor != null) { removeAnnotations(matchesInEditor); addAnnotations(matchesInEditor); } } } }