private void updateSelection(Object element, String selectedText) {
      if (element != null) {
        selectElement(element, selectedText);
        mySearchField.setForeground(FOREGROUND_COLOR);
      }
      else {
        mySearchField.setForeground(ERROR_FOREGROUND_COLOR);
      }
      if (mySearchPopup != null) {
        mySearchPopup.setSize(mySearchPopup.getPreferredSize());
        mySearchPopup.validate();
      }

      if (myFiringCallback) return;
      myFiringCallback = true;
      try {
        fireStateChanged();
      }
      finally {
        myFiringCallback = false;
      }
    }
private void updateSelection(Object element, String selectedText)