Component (JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { if (value instanceof PopupFactoryImpl.ActionItem item) { AnAction action = item.getAction(); if (action instanceof LastAction lastAction) { Presentation presentation = action.getTemplatePresentation(); JBLabel label = new JBLabel(presentation.getIcon()); label.setBorder(JBUI.Borders.emptyRight(JBUI.CurrentTheme.ActionsList.elementIconGap() - 2)); JPanel panel = new OpaquePanel(new BorderLayout(), isSelected ? JBUI.CurrentTheme.ManagedIde.MENU_ITEM_HOVER : JBUI.CurrentTheme.Advertiser.background()) { @Override public AccessibleContext getAccessibleContext() { return label.getAccessibleContext(); } }; float leftRightInset = JBUI.CurrentTheme.Popup.Selection.LEFT_RIGHT_INSET.getUnscaled(); Insets innerInsets = ((JBInsets)JBUI.CurrentTheme.Popup.Selection.innerInsets()).getUnscaled(); panel.setBorder(JBUI.Borders.empty(12, (int)(leftRightInset + innerInsets.left), 12, 14)); JPanel iconPanel = new NonOpaquePanel(new BorderLayout()); iconPanel.add(label, BorderLayout.NORTH); panel.add(iconPanel, BorderLayout.WEST); JPanel lines = new NonOpaquePanel(new BorderLayout(0, JBUI.scale(2))); //noinspection DialogTitleCapitalization lines.add(new JBLabel(presentation.getText()), BorderLayout.NORTH); //noinspection DialogTitleCapitalization JLabel secondLine = new JBLabel(lastAction.getSecondText()); secondLine.setForeground(JBUI.CurrentTheme.Advertiser.foreground()); lines.add(secondLine, BorderLayout.SOUTH); panel.add(lines); if (index > 0) { //noinspection unchecked PopupFactoryImpl.ActionItem prevIndex = ((ListPopupStep<PopupFactoryImpl.ActionItem>)getStep()).getValues().get(index - 1); AnAction prevAction = prevIndex.getAction(); if (!(prevAction instanceof LastAction)) { JPanel wrapper = new OpaquePanel(new BorderLayout(), list.getBackground()) { @Override public AccessibleContext getAccessibleContext() { return label.getAccessibleContext(); } }; wrapper.setBorder(JBUI.Borders.emptyTop(JBUI.CurrentTheme.Popup.bodyBottomInsetNoAd())); wrapper.add(panel); return wrapper; } } return panel; } } return renderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); }