private synchronized void initRunToolbarExecutorActions(@NotNull Executor executor, @NotNull ActionRuntimeRegistrar actionRegistrar) {
    if (ToolbarSettings.getInstance().isAvailable()) {
      RunToolbarProcess.getProcessesByExecutorId(executor.getId()).forEach(process -> {
        if (executor instanceof ExecutorGroup<?> executorGroup) {

          if (process.getShowInBar()) {
            ActionGroup wrappedAction = new RunToolbarExecutorGroupAction(
              new RunToolbarExecutorGroup(executorGroup, (ex) -> new RunToolbarGroupProcessAction(process, ex), process));
            Presentation presentation = wrappedAction.getTemplatePresentation();
            presentation.setIcon(executor.getIcon());
            presentation.setText(process.getName());
            presentation.setDescription(executor.getDescription());

            registerActionInGroup(actionRegistrar, process.getActionId(), wrappedAction, RunToolbarProcess.RUN_WIDGET_GROUP,
                                  runWidgetIdToAction);
          }
          else {
            RunToolbarAdditionActionsHolder holder = new RunToolbarAdditionActionsHolder(executorGroup, process);

            registerActionInGroup(actionRegistrar, RunToolbarAdditionActionsHolder.getAdditionActionId(process), holder.getAdditionAction(),
                                  process.getMoreActionSubGroupName(),
                                  runWidgetIdToAction);
            registerActionInGroup(actionRegistrar, RunToolbarAdditionActionsHolder.getAdditionActionChooserGroupId(process),
                                  holder.getMoreActionChooserGroup(), process.getMoreActionSubGroupName(),
                                  runWidgetIdToAction);
          }
        }
        else {
          if (!process.isTemporaryProcess() && process.getShowInBar()) {
            AnAction wrappedAction = new RunToolbarProcessAction(process, executor);
            AnAction wrappedMainAction = new RunToolbarProcessMainAction(process, executor);

            registerActionInGroup(actionRegistrar, process.getActionId(), wrappedAction, RunToolbarProcess.RUN_WIDGET_GROUP,
                                  runWidgetIdToAction);

            registerActionInGroup(actionRegistrar, process.getMainActionId(), wrappedMainAction, RunToolbarProcess.RUN_WIDGET_MAIN_GROUP,
                                  runWidgetIdToAction);
          }
        }
      });
    }
  }
private synchronized void initRunToolbarExecutorActions(@NotNull Executor executor, @NotNull ActionRuntimeRegistrar actionRegistrar)