void () { //todo leak via not shown dialog? ChooseByNamePopup popup = ChooseByNamePopup.createPopup(myProject, createChooseByNameModel(), getContext()); popup.invoke(new ChooseByNamePopupComponent.Callback() { @Override public void elementChosen(Object element) { mySelectedClass = (T)element; ((Navigatable)element).navigate(true); } }, getModalityState(), true); }