// Delegate to addSearchResultsHandler()
addSearchResultsHandler(new SearchResultsHandler() {
public void onSearchResults(SearchResultsEvent event) {
JsArray<? extends Result> results = event.getResults();
for (int i = 0, length = results.length(); i < length; ++i) {
handler.onSearchComplete(new SearchCompleteEvent(event.getSearch(),
results.get(i)));
}
}
});
}