void () { final FrameworkLibraryVersion version = getSelectedVersion(); boolean sourcesCheckboxEnabled; boolean javadocCheckboxEnabled; if (version == null) { sourcesCheckboxEnabled = javadocCheckboxEnabled = false; } else { final List<DownloadableLibraryFileDescription> descriptions = getSelectedDownloads(version); sourcesCheckboxEnabled = haveAdditionalDownloads(descriptions, AdditionalDownloadType.SOURCES); javadocCheckboxEnabled = haveAdditionalDownloads(descriptions, AdditionalDownloadType.DOCUMENTATION); } setEnabled(myDownloadSourcesCheckBox, sourcesCheckboxEnabled); setEnabled(myDownloadJavadocsCheckBox, javadocCheckboxEnabled); }