@Override
  public void update(@NotNull AnActionEvent event) {
    Presentation presentation = event.getPresentation();
    ExecutionEnvironment environment = getEnvironment(event);
    if (environment != null) {
      RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings();
      RunConfiguration configuration = settings == null ? null : settings.getConfiguration();
      if (configuration != null &&
          RunDashboardManager.getInstance(configuration.getProject()).isShowInDashboard(configuration) &&
          (ActionPlaces.RUNNER_TOOLBAR.equals(event.getPlace()) || ActionPlaces.DEBUGGER_TOOLBAR.equals(event.getPlace()))) {
        presentation.setEnabledAndVisible(false);
        return;
      }

      presentation.setText(ExecutionBundle.messagePointer("rerun.configuration.action.name",
                                                          StringUtil.escapeMnemonics(environment.getRunProfile().getName())));
      Icon rerunIcon = ExperimentalUI.isNewUI() ? environment.getExecutor().getRerunIcon() : environment.getExecutor().getIcon();
      boolean isRestart = ActionPlaces.TOUCHBAR_GENERAL.equals(event.getPlace()) || ExecutionManagerImpl.isProcessRunning(getDescriptor(event));
      presentation.setIcon(isRestart && !ExperimentalUI.isNewUI() ? AllIcons.Actions.Restart : rerunIcon);
      presentation.setEnabled(isEnabled(event));
      return;
    }

    presentation.setEnabledAndVisible(false);
  }
@Override
  public void update(@NotNull AnActionEvent event)