void (JComboBox<VersionView> component, String messageKey, Disposable parentDisposable) { new ComponentValidator(parentDisposable) .withValidator(() -> { VersionView selectedItem = (VersionView) component.getSelectedItem(); if (selectedItem == null) return null; LanguageOrApiVersion version = selectedItem.getVersion(); if (version.isUnsupported()) { return new ValidationInfo(KotlinBaseCompilerConfigurationUiBundle.message(messageKey, version.getVersionString()), component); } return null; }).installOn(component); component.addActionListener(e -> ComponentValidator.getInstance(component).ifPresent(ComponentValidator::revalidate)); }