Configuration config = new Configuration() {
@Override
public void fireEnumerate(EnumerateRequest request, AsyncCallback<Response> callback) {
Collection<Suggestion> s = new ArrayList<Suggestion>();
if ("category".equals(request.getColumnName())) {
s.add(new MultiWordSuggestion("A", "A"));
s.add(new MultiWordSuggestion("B", "B"));
s.add(new MultiWordSuggestion("C", "C"));
} else if ("category2".equals(request.getColumnName())) {
s.add(new MultiWordSuggestion("X", "X"));
s.add(new MultiWordSuggestion("Y", "Y"));
s.add(new MultiWordSuggestion("Z", "Z"));
} else {
s.add(new MultiWordSuggestion("M", "M"));
s.add(new MultiWordSuggestion("F", "F"));
}
callback.onSuccess(new Response(s));
}
@Override
public void fireSuggest(SuggestRequest request,
AsyncCallback<Response> callback) {
Collection<Suggestion> s = new ArrayList<Suggestion>();
s.add(new MultiWordSuggestion("Lancashire", "Lancashire"));
s.add(new MultiWordSuggestion("Bedfordshire", "Bedfordshire"));
s.add(new MultiWordSuggestion("Oxfordshire", "Oxfordshire"));
callback.onSuccess(new Response(s));
}
};
return config;
}