FullView.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:google-apis-explorer 作者:
@UiHandler("searchBox")
void searchBoxEnter(KeyDownEvent event) {
  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
    SuggestionDisplay suggestionDisplay = searchBox.getSuggestionDisplay();

    // This should always be true unless GWT changes the type of the suggestion generated by the
    // SuggestBox. It is too complicated and nasty to switch out the SuggestBox suggestion display
    // factory, so we're left with this type safety check and broken functionality if GWT changes.
    Preconditions.checkState(suggestionDisplay instanceof DefaultSuggestionDisplay);

    // At this point this should always be true.
    if (suggestionDisplay instanceof DefaultSuggestionDisplay) {
      DefaultSuggestionDisplay suggestions = (DefaultSuggestionDisplay) suggestionDisplay;
      if (!suggestions.isSuggestionListShowing()) {
        presenter.handleSearch(searchBox.getValue());
      }
    }
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号