Sorry, I hit send too fast.
I want to use replacementString with a MultiWordOracleSuggestion. This
is not possible today, also not in RC 1.6.
I currently workaround the issue by implementing a SuggestOracle
embeds a MultiWordSuggestOracle. The implementation of
requestSuggestions delegates to the embedded MultiWordSuggestOracle in
the following way
...
private MultiWordSuggestOracle oracle ;
private HashMap<String,Suggestion> suggestions ;
private MyCallBack myCallBack ;
...
public void requestSuggestions(Request request, Callback callback) {
//delegate to myCallBack and intercept the responses
myCallBack.setOcb(callback) ;
oracle.requestSuggestions(request, myCallBack) ;
}
...
private class MyCallBack implements Callback {
private Callback ocb ;
public void setOcb(Callback ocb) {
this.ocb = ocb;
}
public void onSuggestionsReady(Request request, Response
response) {
// Create a new response
Response myResponse = new Response() ;
LinkedList<Suggestion> responses = new
LinkedList<Suggestion>() ;
//MultiWordSuggestOracle returns the original
suggestion as replacementString
// we use this as key to look upthe actual
suggestion that we want to provide
for(Suggestion suggestion : response.getSuggestions()) {
responses.add(suggestions.get(suggestion.getReplacementString
())) ;
}
myResponse.setSuggestions(responses) ;
ocb.onSuggestionsReady(request, myResponse) ;
}
}
....
This works, but it would be much easier if we could simply provide the
replacementStrings to the MultiWordSuggestOracle.
Issue 2695 actually submits this as an enhancement request. Its status
is "accepted. Any chance that this can make it into 1.6?
Thanks (not just for answers to this post but for the tremendous tool
that GWT is)
Danny
On 22 mrt, 20:56, Danny Goovaerts <[email protected]> wrote:
> I want to usereplacementString with Issue 2695
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---