@Override
  public @Nullable PopupStep<?> onChosen(@NotNull PopupFactoryImpl.ActionItem item, boolean finalChoice, @Nullable InputEvent inputEvent) {
    if (!item.isEnabled()) return FINAL_CHOICE;
    AnAction action = item.getAction();
    if (action instanceof ActionGroup && (!finalChoice || !item.isPerformGroup())) {
      DataContext dataContext = mySubStepContextAdjuster.apply(myContext.get(), action);
      return getSubStep((ActionGroup)action, dataContext, myActionPlace, myPresentationFactory, myEnableMnemonics, true, myShowDisabledActions, null,
                        false, false, () -> dataContext, myPreselectActionCondition, -1);
    }
    else if (Utils.isKeepPopupOpen(item.getKeepPopupOnPerform(), inputEvent)) {
      performActionItem(item, inputEvent);
      return FINAL_CHOICE;
    }
    else {
      myFinalRunnable = () -> performActionItem(item, inputEvent);
      return FINAL_CHOICE;
    }
  }
@Override
  public @Nullable PopupStep<?> onChosen(@NotNull PopupFactoryImpl.ActionItem item, boolean finalChoice, @Nullable InputEvent inputEvent)