class RepositoryConnectController implements IConnectedRepositoryInstance {

  public boolean deleteRepository( String name ) {
    RepositoriesMeta repositoriesMeta = getRepositoriesMeta();
    RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( name );
    int index = repositoriesMeta.indexOfRepository( repositoryMeta );
    if ( index != -1 ) {
      repositoriesMeta.removeRepository( index );
      save();
      Spoon spoon = spoonSupplier.get();
      Runnable execute = () -> {
        if ( spoon.getRepositoryName() != null && spoon.getRepositoryName().equals( repositoryMeta.getName() ) ) {
          spoon.closeRepository();
          setConnectedRepository( null );
        }
        fireListeners();
      };
      if ( spoon.getShell() != null ) {
        spoon.getShell().getDisplay().asyncExec( execute );
      } else {
        execute.run();
      }
    }
    return true;
  }

  public  RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier );
  public  RepositoryConnectController();

}