@Override protected void doOKAction() { this.processDoNotAskOnOk(0); if (this.getOKAction().isEnabled()) { List<RRepository> enabled = Lists.newArrayList(); for (int i = 0; i < myList.getItemsCount(); i++) { if (myList.isItemSelected(i)) { final Object item = myList.getItemAt(i); enabled.add((RRepository) item); } } myController.setCRANMirror(currentCRANMirror); myController.setRepositories(enabled); this.close(0); } }
private void reloadList() { myList.clear(); final List<RDefaultRepository> repositories = myController.getDefaultRepositories(); RPackageService service = RPackageService.getInstance(); for (RDefaultRepository repository : repositories) { myList.addItem( repository, repository.getUrl(), service.enabledRepositories.contains(repository.getUrl())); } for (String repository : service.userRepositories) { myList.addItem(repository, repository, true); } }