private void hidePopup() {
    if (myPopupRef != null) {
      ListPopup popup = myPopupRef.get();
      if (popup != null && popup.isVisible()) {
        popup.cancel();
      }

      myPopupRef = null;
    }
  }
private void hidePopup()