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();
}
Aggregations