void (ActionEvent e) { final Project project = mySourceMethod.getProject(); final GlobalSearchScope scope = GlobalSearchScope.allScope(project); final TreeJavaClassChooserDialog chooser = new TreeJavaClassChooserDialog(RefactorJBundle.message("select.wrapper.class"), project, scope, null, null); final String classText = existingClassField.getText(); final PsiClass currentClass = JavaPsiFacade.getInstance(project).findClass(classText, GlobalSearchScope.allScope(project)); if (currentClass != null) { chooser.select(currentClass); } chooser.show(); final PsiClass selectedClass = chooser.getSelected(); if (selectedClass != null) { final String className = selectedClass.getQualifiedName(); existingClassField.setText(className); RecentsManager.getInstance(myProject).registerRecentEntry(EXISTING_KEY, className); } }