void (ActionEvent e) { TreeClassChooser chooser = TreeClassChooserFactory.getInstance(myProject).createWithInnerClassesScopeChooser( RefactoringBundle.message("choose.destination.class"), GlobalSearchScope.projectScope(myProject), new ClassFilter() { @Override public boolean isAccepted(PsiClass aClass) { return aClass.getParent() instanceof PsiFile || aClass.hasModifierProperty(PsiModifier.STATIC); } }, null); final String targetClassName = getTargetClassName(); if (targetClassName != null) { final PsiClass aClass = JavaPsiFacade.getInstance(myProject).findClass(targetClassName, GlobalSearchScope.allScope(myProject)); if (aClass != null) { chooser.selectDirectory(aClass.getContainingFile().getContainingDirectory()); } else { chooser.selectDirectory(mySourceClass.getContainingFile().getContainingDirectory()); } } chooser.showDialog(); PsiClass aClass = chooser.getSelected(); if (aClass != null) { myTfTargetClassName.setText(aClass.getQualifiedName()); myMemberInfoModel.updateTargetClass(); } }