private boolean updateExtraButtons(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);
    Integer activeButtonIndex;
    java.util.List<JComponent> extraButtons;
    if (!isSelectable) {
      activeButtonIndex = null;
      extraButtons = Collections.emptyList();
    }
    else {
      activeButtonIndex = myInlineActionsSupport.getActiveButtonIndex(list);
      extraButtons = myInlineActionsSupport.createExtraButtons(
        value, isSelected, !isSelected || activeButtonIndex == null ? -1 : activeButtonIndex);
    }

    if (!extraButtons.isEmpty()) {
      myButtonSeparator.setVisible(true);
      extraButtons.forEach(comp -> myButtonPane.add(comp, gb.next()));
      // 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 && activeButtonIndex < extraButtons.size()) {
        String text = myInlineActionsSupport.getToolTipText(value, activeButtonIndex);
        myRendererComponent.setToolTipText(text);
      }
    }
    else if (!hasNextIcon && myInlineActionsSupport.hasExtraButtons(value)){
      myButtonSeparator.setVisible(false);
      myButtonPane.add(Box.createHorizontalStrut(InlineActionsUtilKt.buttonWidth()), gb.next());
    }
    else {
      myButtonSeparator.setVisible(false);
      myButtonPane.add(myNextStepLabel, gb.next());
    }

    return !extraButtons.isEmpty();
  }
private boolean updateExtraButtons(JList<? extends E> list, E value, ListPopupStep<Object> step, boolean isSelected, boolean hasNextIcon)