void (ListSelectionEvent event) { myOptionsCheckBox.setEnabled(myPackages.getSelectedIndex() >= 0); myVersionCheckBox.setEnabled(myPackages.getSelectedIndex() >= 0); myOptionsCheckBox.setSelected(false); myVersionCheckBox.setSelected(false); myVersionComboBox.setEnabled(false); myOptionsField.setEnabled(false); myDescriptionTextArea.setText(IdeBundle.message("loading.in.progress")); final Object pyPackage = myPackages.getSelectedValue(); if (pyPackage instanceof RepoPackage) { final String packageName = ((RepoPackage)pyPackage).getName(); mySelectedPackageName = packageName; myVersionComboBox.removeAllItems(); if (myVersionCheckBox.isEnabled()) { myController.fetchPackageVersions(packageName, new CatchingConsumer<>() { @Override public void consume(final List<@NlsSafe String> releases) { ApplicationManager.getApplication().invokeLater(() -> { if (myPackages.getSelectedValue() == pyPackage) { myVersionComboBox.removeAllItems(); for (@NlsSafe String release : releases) { myVersionComboBox.addItem(release); } } }, ModalityState.any()); } @Override public void consume(Exception e) { LOG.info("Error retrieving releases", e); } }); } myInstallButton.setEnabled(!myCurrentlyInstalling.contains(packageName)); myController.fetchPackageDetails(packageName, new CatchingConsumer<@Nls String, Exception>() { @Override public void consume(final @Nls String details) { UIUtil.invokeLaterIfNeeded(() -> { if (myPackages.getSelectedValue() == pyPackage) { myDescriptionTextArea.setText(details); myDescriptionTextArea.setCaretPosition(0); }/* else { do nothing, because other package gets selected }*/ }); } @Override public void consume(Exception exception) { UIUtil.invokeLaterIfNeeded(() -> myDescriptionTextArea.setText(IdeBundle.message("no.information.available"))); LOG.info("Error retrieving package details", exception); } }); } else { myInstallButton.setEnabled(false); myDescriptionTextArea.setText(""); } }