Search in sources :

Example 1 with SimpleRepositorySource

use of com.android.repository.api.SimpleRepositorySource in project android by JetBrains.

the class SourcesTableModel method createSource.

/**
   * Creates a new source with the given URL and display name.
   */
private void createSource(@NotNull String url, @Nullable String uiName) {
    RepositorySourceProvider userSourceProvider = getUserSourceProvider();
    // we know it won't be null since otherwise we shouldn't have been editable
    assert userSourceProvider != null;
    // TODO: we shouldn't have to specify the allowed sources here, since they're already specified in the provider.
    RepositorySource newSource = new SimpleRepositorySource(url, uiName, true, ImmutableList.of(AndroidSdkHandler.getAddonModule(), AndroidSdkHandler.getSysImgModule(), RepoManager.getCommonModule()), userSourceProvider);
    userSourceProvider.addSource(newSource);
    refreshUi();
}
Also used : SimpleRepositorySource(com.android.repository.api.SimpleRepositorySource) RepositorySource(com.android.repository.api.RepositorySource) RepositorySourceProvider(com.android.repository.api.RepositorySourceProvider) SimpleRepositorySource(com.android.repository.api.SimpleRepositorySource)

Aggregations

RepositorySource (com.android.repository.api.RepositorySource)1 RepositorySourceProvider (com.android.repository.api.RepositorySourceProvider)1 SimpleRepositorySource (com.android.repository.api.SimpleRepositorySource)1