public static @Nullable ActionGroup createToolbarCustomizationGroup(@NotNull ActionGroup actionGroup,
                                                                      String groupID,
                                                                      Ref<? extends Component> popupInvoker) {
    String groupName = getGroupName(actionGroup, groupID);
    if (groupName == null) {
      return null;
    }

    String actionID = "customize.toolbar." + groupID;
    DefaultActionGroup customizationGroup = new DefaultActionGroup(
      new MyDumbAction(actionID, IdeBundle.messagePointer("action.customizations.customize.action"), () -> AllIcons.General.GearPlain, event -> {
        Component src = popupInvoker.get();
        AnAction targetAction = src instanceof ActionButton ? ((ActionButton)src).getAction() : null;
        DialogWrapper dialogWrapper = createCustomizeGroupDialog(event.getProject(), groupID, groupName, targetAction);
        dialogWrapper.show();
      })
    );

    ActionManager actionManager = ActionManager.getInstance();
    AnAction rollbackAction = actionManager.getAction(ToolbarSettings.ROLLBACK_ACTION_ID);
    if (rollbackAction != null) {
      customizationGroup.add(rollbackAction);
    }

    customizationGroup.addAll((ActionGroup)actionManager.getAction("ToolbarPopupActions"));
    AnAction additionalActions = actionManager.getAction("ToolbarPopupActions." + groupID);
    if (additionalActions instanceof ActionGroup) {
      customizationGroup.add(additionalActions);
    }
    return customizationGroup;
  }
public static @Nullable ActionGroup createToolbarCustomizationGroup(@NotNull ActionGroup actionGroup,
                                                                      String groupID,
                                                                      Ref<? extends Component> popupInvoker)