void (final ActionEvent e) { final String className = myEditorTextField.getText(); final PsiClass aClass = FormEditingUtil.findClassToBind(myComponent.getModule(), className); final Project project = myComponent.getProject(); final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex(); final TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project).createWithInnerClassesScopeChooser( UIDesignerBundle.message("title.choose.class.to.bind"), GlobalSearchScope.projectScope(project), new ClassFilter() { // we need show classes from the sources roots only @Override public boolean isAccepted(final PsiClass aClass) { final VirtualFile vFile = aClass.getContainingFile().getVirtualFile(); return vFile != null && fileIndex.isUnderSourceRootOfType(vFile, JavaModuleSourceRootTypes.SOURCES); } }, aClass ); chooser.showDialog(); final PsiClass result = chooser.getSelected(); if (result != null) { setEditorText(result.getQualifiedName()); } // todo[anton] make it via providing proper parent IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(myEditorTextField, true)); }