Searching classes dialog
Answered
Hello. I tried to write a dialog that allow select class. This is my code:
TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project)
.createWithInnerClassesScopeChooser(
"Choose an Entity",
GlobalSearchScope.allScope(project), new ClassFilter() {
@Override
public boolean isAccepted(PsiClass aClass) {
return true;
}
}, null);
chooser.showDialog();
final PsiClass selected = chooser.getSelected();
However I faced with two problems. First of them is there aren't any classes on the form:
And the second problem is the button OK is disabled:
Could you help me?
Please sign in to leave a comment.
Hi Sergey,
Do you have any classes in your project? Please note that a Java file not under source root is not a class.
Thank you!!! When I add source root, it really works!!!