boolean (JList<? extends E> list, E value, ListPopupStep<Object> step, boolean isSelected, boolean hasNextIcon) { myButtonPane.removeAll(); GridBag gb = new GridBag().setDefaultFill(GridBagConstraints.BOTH) .setDefaultAnchor(GridBagConstraints.CENTER) .setDefaultWeightX(1.0) .setDefaultWeightY(1.0); boolean isSelectable = step.isSelectable(value); java.util.List<JComponent> extraButtons; if (!isSelectable) { extraButtons = Collections.emptyList(); } else { extraButtons = myInlineActionsSupport.getExtraButtons(list, value, isSelected); } if (!extraButtons.isEmpty()) { myButtonsSeparator.setVisible(true); extraButtons.forEach(comp -> myButtonPane.add(comp, gb.next())); Integer activeButtonIndex = myInlineActionsSupport.getActiveButtonIndex(list); // We ONLY need to update the tooltip if there's an active inline action button. // Otherwise, it's set earlier from the main action. // If there is an active button without a tooltip, we still need to set the tooltip // to null, otherwise it'll look ugly, as if the inline action button has the same // tooltip as the main action. if (activeButtonIndex != null) { myRendererComponent.setToolTipText(myInlineActionsSupport.getActiveExtraButtonToolTipText(list, value)); } } else if (!hasNextIcon && myInlineActionsSupport.hasExtraButtons(value)){ myButtonsSeparator.setVisible(false); myButtonPane.add(Box.createHorizontalStrut(InlineActionsUtilKt.buttonWidth()), gb.next()); } else { myButtonsSeparator.setVisible(false); myButtonPane.add(myNextStepLabel, gb.next()); } return !extraButtons.isEmpty(); }