void (@NotNull AnActionEvent e) { final Presentation presentation = e.getPresentation(); presentation.setEnabledAndVisible(false); final DataContext dataContext = e.getDataContext(); final PsiElement[] psiElements = PlatformCoreDataKeys.PSI_ELEMENT_ARRAY.getData(dataContext); if (psiElements != null) { PsiElementProcessor.CollectElementsWithLimit<PsiElement> processor = new PsiElementProcessor.CollectElementsWithLimit<>(2); getPatternBasedProducer().collectTestMembers(psiElements, false, false, processor); Collection<PsiElement> collection = processor.getCollection(); if (collection.isEmpty()) return; final Project project = CommonDataKeys.PROJECT.getData(dataContext); if (project != null) { final List<T> foundConfigurations = collectPatternConfigurations(collection, project); if (!foundConfigurations.isEmpty()) { presentation.setEnabledAndVisible(true); if (foundConfigurations.size() == 1) { presentation.setText(ExecutionBundle.message("add.to.temp.suite.0", foundConfigurations.get(0).getName())); } } } } }