void (AnActionButton anActionButton) { final DataContext dataContext = DataManager.getInstance().getDataContext(list); final Project project = CommonDataKeys.PROJECT.getData(dataContext); if (project == null) { return; } final TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project) .createNoInnerClassesScopeChooser(chooserTitle, GlobalSearchScope.allScope(project), filter, null); chooser.showDialog(); final PsiClass selected = chooser.getSelected(); if (selected == null) { return; } final String qualifiedName = selected.getQualifiedName(); final DefaultListModel<String> model = (DefaultListModel<String>)list.getModel(); final int index = model.indexOf(qualifiedName); if (index < 0) { model.addElement(qualifiedName); collection.add(qualifiedName); } else { list.setSelectedIndex(index); } }