void () { if (libs.isEmpty()) { HintManager.getInstance().showInformationHint(editor, JavaBundle.message("find.jar.hint.text.no.libraries.found.for.fqn", fqn)); } else { JBList<@NlsSafe String> libNames = new JBList<>(ContainerUtil.sorted(libs.keySet())); libNames.installCellRenderer(o -> new JLabel(o, PlatformIcons.JAR_ICON, SwingConstants.LEFT)); if (libs.size() == 1) { String jarName = libs.keySet().iterator().next(); String url = libs.get(jarName); initiateDownload(url, jarName, editor.getProject()); } else { JBPopupFactory.getInstance() .createListPopupBuilder(libNames) .setTitle(JavaBundle.message("popup.title.select.a.jar.file")) .setItemChosenCallback(() -> { String jarName = libNames.getSelectedValue(); String url = libs.get(jarName); if (url != null) { initiateDownload(url, jarName, editor.getProject()); } }) .createPopup().showInBestPositionFor(editor); } } }