LibraryCompositionSettings () { if (mySettings == null) return null; final Choice option = myButtonEnumModel.getSelected(); mySettings.setDownloadLibraries(option == Choice.DOWNLOAD); final Object item = myExistingLibraryComboBox.getSelectedItem(); if (option == Choice.USE_LIBRARY && item instanceof ExistingLibraryEditor) { mySettings.setSelectedExistingLibrary(((ExistingLibraryEditor)item).getLibrary()); } else { mySettings.setSelectedExistingLibrary(null); } if (option == Choice.USE_LIBRARY && item instanceof NewLibraryEditor) { mySettings.setNewLibraryEditor((NewLibraryEditor)item); } else { mySettings.setNewLibraryEditor(null); } mySettings.setLibraryProvider(option == Choice.USE_FROM_PROVIDER ? myLibraryProvider : null); return mySettings; }