class RunConfigurationDelegate {

  public void create() {
    List<String> names = configurationManager.getNames();
    String name = BaseMessages.getString( PKG, "RunConfigurationPopupMenuExtension.Configuration.Default" ) + " ";
    int index = 1;
    while ( names.contains( name + String.valueOf( index ) ) ) {
      index++;
    }
    name = name + String.valueOf( index );
    DefaultRunConfiguration defaultRunConfiguration = new DefaultRunConfiguration();
    defaultRunConfiguration.setName( name );

    RunConfigurationDialog dialog =
      new RunConfigurationDialog( spoonSupplier.get().getShell(), configurationManager, defaultRunConfiguration );
    RunConfiguration savedRunConfiguration = dialog.open();

    if ( savedRunConfiguration != null ) {
      configurationManager.save( savedRunConfiguration );
      spoonSupplier.get().refreshTree();
    }
  }

  public  RunConfigurationDelegate( RunConfigurationService configurationManager );

}