public static @NotNull DialogWrapper createCustomizeGroupDialog(@Nullable Project project, @NotNull String groupID,
                                                                  @NlsContexts.DialogTitle String groupName, @Nullable AnAction targetAction) {
    ToolbarCustomizableActionsPanel panel = new ToolbarCustomizableActionsPanel(groupID, groupName);
    return new DialogWrapper(project, true) {
      {
        setTitle(IdeBundle.message("dialog.title.customize.0", groupName));
        init();
        setSize(600, 600);
      }

      @Override
      public @Nullable JComponent getPreferredFocusedComponent() {
        return panel.getPreferredFocusedComponent();
      }

      @Override
      protected @Nullable JComponent createCenterPanel() {
        panel.reset();
        String id = targetAction == null ? null : ActionManager.getInstance().getId(targetAction);
        if (id != null) {
          panel.selectAction(id);
        }
        return panel.getPanel();
      }

      @Override
      protected Action @NotNull [] createActions() {
        List<Action> actions = new ArrayList<>(Arrays.asList(super.createActions()));
        Action applyAction = new DialogWrapperAction(IdeBundle.message("dialog.apply")) {
          @Override
          protected void doAction(ActionEvent e) {
            apply();
            setEnabled(false);
          }
        };
        actions.add(applyAction);
        panel.setApplyAction(applyAction);

        return actions.toArray(Action[]::new);
      }

      private void apply() {
        try {
          panel.apply();
        }
        catch (ConfigurationException ex) {
          LOG.error(ex);
        }
      }

      @Override
      protected void doOKAction() {
        apply();
        close(OK_EXIT_CODE);
      }

      @Override
      public void doCancelAction() {
        panel.reset();
        super.doCancelAction();
      }
    };
  }
public static @NotNull DialogWrapper createCustomizeGroupDialog(@Nullable Project project, @NotNull String groupID,
                                                                  @NlsContexts.DialogTitle String groupName, @Nullable AnAction targetAction)