void (@NotNull final AnActionEvent e) { final Project project = e.getProject(); LOG.assertTrue(project != null); final Editor editor = e.getData(CommonDataKeys.EDITOR); LOG.assertTrue(editor != null); LOG.assertTrue(myBundle != null); final CoverageEngine coverageEngine = myBundle.getCoverageEngine(); final Set<String> tests = new HashSet<>(); if (ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> tests.addAll(coverageEngine.getTestsForLine(project, myBundle, myClassFQName, myLineData.getLineNumber())), CoverageBundle.message("extract.information.about.tests"), false, project)) { //todo cache them? show nothing found message final String[] testNames = ArrayUtilRt.toStringArray(tests); Arrays.sort(testNames); if (testNames.length == 0) { HintManager.getInstance().showErrorHint(editor, CoverageBundle.message("hint.text.failed.to.load.covered.tests")); return; } final List<PsiElement> elements = coverageEngine.findTestsByNames(testNames, project); final ImplementationViewComponent component; final String title = CoverageBundle.message("popup.title.tests.covering.line", myClassFQName, myLineData.getLineNumber()); final ComponentPopupBuilder popupBuilder; if (!elements.isEmpty()) { Consumer<ImplementationViewComponent> processor = viewComponent -> viewComponent.showInUsageView(); component = new ImplementationViewComponent(ContainerUtil.map(elements, PsiImplementationViewElement::new), 0); component.setShowInFindWindowProcessor(processor); popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(component, component.getPreferredFocusableComponent()) .setDimensionServiceKey(project, "ShowTestsPopup", false) .addListener(new JBPopupListener() { @Override public void onClosed(@NotNull LightweightWindowEvent event) { component.cleanup(); } }); } else { component = null; @NonNls String testsPresentation = StringUtil.join(testNames, "<br/>").replace("_", "."); final JPanel panel = new PanelWithText(CoverageBundle.message("following.test.could.not.be.found.1", testNames.length, testsPresentation)); popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(panel, null); } final JBPopup popup = popupBuilder.setRequestFocusCondition(project, NotLookupOrSearchCondition.INSTANCE) .setProject(project) .setResizable(true) .setMovable(true) .setTitle(title) .createPopup(); popup.showInBestPositionFor(editor); if (component != null) { component.setHint(popup, title); } } }