protected @Nullable ExecutionEnvironment getEnvironment(@NotNull AnActionEvent event) {
    ExecutionEnvironment environment = event.getData(ExecutionDataKeys.EXECUTION_ENVIRONMENT);
    if (environment == null) {
      Project project = event.getProject();
      RunContentManager runContentManager = project == null ? null : RunContentManager.getInstanceIfCreated(project);
      RunContentDescriptor contentDescriptor = runContentManager == null ? null : runContentManager.getSelectedContent();
      if (contentDescriptor != null) {
        JComponent component = contentDescriptor.getComponent();
        if (component != null) {
          environment = ExecutionDataKeys.EXECUTION_ENVIRONMENT.getData(DataManager.getInstance().getDataContext(component));
        }
      }
    }
    return environment;
  }
protected @Nullable ExecutionEnvironment getEnvironment(@NotNull AnActionEvent event)