void (MouseEvent e, PsiElement __) { //list.setFixedCellHeight(UIUtil.LIST_FIXED_CELL_HEIGHT); // TODO[jetzajac]: do we need it? IPopupChooserBuilder<LineMarkerInfo<?>> builder = JBPopupFactory.getInstance().createPopupChooserBuilder(myInfos); builder.setRenderer(new SelectionAwareListCellRenderer<>(dom -> { Icon icon = null; GutterIconRenderer renderer = dom.createGutterRenderer(); if (renderer != null) { Icon originalIcon = renderer.getIcon(); icon = IconUtil.scale(originalIcon, null, JBUIScale.scale(16.0f) / originalIcon.getIconWidth()); } var elementPresentation = ReadAction.compute(() -> { PsiElement element = dom.getElement(); if (element == null) { return IdeBundle.message("node.structureview.invalid"); } else if (dom instanceof MergeableLineMarkerInfo) { return ((MergeableLineMarkerInfo<?>)dom).getElementPresentation(element); } else { return element.getText(); } }); String text = StringUtil.first(elementPresentation, 100, true).replace('\n', ' '); JBLabel label = new JBLabel(text, icon, SwingConstants.LEFT); label.setBorder(JBUI.Borders.empty(2)); return label; })); builder.setItemChosenCallback(value -> { //noinspection unchecked GutterIconNavigationHandler<PsiElement> handler = (GutterIconNavigationHandler<PsiElement>)value.getNavigationHandler(); if (handler != null) { handler.navigate(e, value.getElement()); } }).createPopup().show(new RelativePoint(e)); }