void () { final JBPopup hint = myTextFieldPanel.getHint(); final Object element = getChosenElement(); if (hint != null) { if (element instanceof PsiElement) { myTextFieldPanel.updateHint((PsiElement)element); } else if (element instanceof DataProvider) { final Object o = ((DataProvider)element).getData(CommonDataKeys.PSI_ELEMENT.getName()); if (o instanceof PsiElement) { myTextFieldPanel.updateHint((PsiElement)o); } } } }