use of org.eclipse.search.ui.text.FilterUpdateEvent in project eclipse.platform.text by eclipse.
the class EditorAnnotationManager method searchResultChanged.
@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);
}
}
}
}
Aggregations