private ExecutorActionStatus setupActionStatus(@NotNull AnActionEvent e,
                                                 Project project,
                                                 RunnerAndConfigurationSettings selectedSettings,
                                                 Presentation presentation) {
    // We can consider to add spinning to the inlined run actions. But there is a problem with redrawing
    ExecutorActionStatus status = ExecutorActionStatus.NORMAL;
    if (ActionPlaces.NEW_UI_RUN_TOOLBAR.equals(e.getPlace())) {
      RunStatusHistory startHistory = RunStatusHistory.getInstance(project);

      boolean isLoading = startHistory.firstOrNull(selectedSettings, it -> (it.getExecutorId().equals(myExecutor.getId()) &&
                                                                            it.getState() == RunState.SCHEDULED)) != null;
      if (isLoading) {
        status = ExecutorActionStatus.LOADING;
        SpinningProgressIcon spinningIcon = presentation.getClientProperty(spinningIconKey);
        if (spinningIcon == null) {
          spinningIcon = new SpinningProgressIcon();
          spinningIcon.setIconColor(JBUI.CurrentTheme.RunWidget.ICON_COLOR);
          presentation.putClientProperty(spinningIconKey, spinningIcon);
        }
        presentation.setDisabledIcon(spinningIcon);
      }
      else {
        if (!getRunningDescriptors(project, selectedSettings).isEmpty()) {
          status = ExecutorActionStatus.RUNNING;
        }
        presentation.putClientProperty(spinningIconKey, null);
        presentation.setDisabledIcon(null);
      }
    }
    return status;
  }
private ExecutorActionStatus setupActionStatus(@NotNull AnActionEvent e,
                                                 Project project,
                                                 RunnerAndConfigurationSettings selectedSettings,
                                                 Presentation presentation)