use of com.google.gwt.user.client.ui.SuggestBox.DefaultSuggestionDisplay in project gerrit by GerritCodeReview.
the class HintTextBox method onKey.
private void onKey(int key) {
if (key == KeyCodes.KEY_ESCAPE) {
setText(prevText);
Widget p = getParent();
if (p instanceof SuggestBox) {
// Since the text was changed, ensure that the SuggestBox is
// aware of this change so that it will refresh properly on
// the next keystroke. Without this, if the first keystroke
// recreates the same string as before ESC was pressed, the
// SuggestBox will think that the string has not changed, and
// it will not yet provide any Suggestions.
((SuggestBox) p).showSuggestionList();
// The suggestion list lingers if we don't hide it.
((DefaultSuggestionDisplay) ((SuggestBox) p).getSuggestionDisplay()).hideSuggestions();
}
setFocus(false);
}
}
Aggregations