private ChooseRunConfigurationPopup.ItemWrapper<Void> createNewWrapper(final AnActionButton button) {
    return new ChooseRunConfigurationPopup.ItemWrapper<>(null) {
      @Override
      public Icon getIcon() {
        return IconUtil.getAddIcon();
      }

      @Override
      public String getText() {
        return UIUtil.removeMnemonic(ExecutionBundle.message("add.new.run.configuration.action2.name"));
      }

      @Override
      public void perform(final @NotNull Project project, final @NotNull Executor executor, @NotNull DataContext context) {
        final RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(project);
        List<ConfigurationType> typesToShow =
          ContainerUtil.filter(ConfigurationType.CONFIGURATION_TYPE_EP.getExtensionList(), configurationType -> {
            ConfigurationFactory factory = runManager.getFactory(configurationType, null);
            return factory != null &&
                   ProgramRunner.getRunner(executor.getId(), runManager.getConfigurationTemplate(factory).getConfiguration()) != null;
          });
        final JBPopup popup = NewRunConfigurationPopup.createAddPopup(project, typesToShow, "",
                                                                      factory -> ApplicationManager.getApplication().invokeLater(() -> {
                                                                        final EditConfigurationsDialog dialog =
                                                                          new EditConfigurationsDialog(project, factory);
                                                                        if (dialog.showAndGet()) {
                                                                          ApplicationManager.getApplication().invokeLater(() -> {
                                                                            RunnerAndConfigurationSettings configuration =
                                                                              RunManager.getInstance(project).getSelectedConfiguration();
                                                                            if (configuration != null) {
                                                                              addConfiguration(configuration);
                                                                            }
                                                                          }, project.getDisposed());
                                                                        }
                                                                      }, project.getDisposed()), null, null, false);
        showPopup(button, popup);
      }

      @Override
      public boolean available(Executor executor) {
        return true;
      }
    };
  }
private ChooseRunConfigurationPopup.ItemWrapper<Void> createNewWrapper(final AnActionButton button)