String () { switch (myButtonEnumModel.getSelected()) { case DOWNLOAD -> { LibraryDownloadSettings settings = mySettings.getDownloadSettings(); if (settings != null) { return settings.getVersion().getVersionNumber(); } } case USE_LIBRARY -> { LibraryEditor item = myLibraryComboBoxModel.getSelectedItem(); if (item instanceof ExistingLibraryEditor) { return item.getName(); } } default -> { return null; } } return null; }