public void bookAdded(BooksEvent ev) { Book book = ev.getBook(); checkPreferable(book); refreshBooks(); }
public void bookRemoved(BooksEvent ev) { Book book = ev.getBook(); getDefaultBible().unsetDefaultConditionally(book); getDefaultCommentary().unsetDefaultConditionally(book); getDefaultDailyDevotional().unsetDefaultConditionally(book); getDefaultDictionary().unsetDefaultConditionally(book); getDefaultGreekDefinitions().unsetDefaultConditionally(book); getDefaultGreekParse().unsetDefaultConditionally(book); getDefaultHebrewDefinitions().unsetDefaultConditionally(book); getDefaultHebrewParse().unsetDefaultConditionally(book); } }
/** * Go through all of the current books checking to see if we need to replace * the current defaults with one of these. */ protected static void checkAllPreferable() { for (Book book : Books.installed().getBooks()) { checkPreferable(book); } }
/** * Create book lists for every type of book. */ public static void refreshBooks() { // Create the array of Bibles Map<Book, String> bnames = getBookMap(BookFilters.getOnlyBibles()); ChoiceFactory.getDataMap().put(BIBLE_KEY, bnames); // Create the array of Commentaries Map<Book, String> cnames = getBookMap(BookFilters.getCommentaries()); ChoiceFactory.getDataMap().put(COMMENTARY_KEY, cnames); // Create the array of Dictionaries Map<Book, String> dnames = getBookMap(BookFilters.getDictionaries()); ChoiceFactory.getDataMap().put(DICTIONARY_KEY, dnames); // Create the array of DailyDevotionals Map<Book, String> rnames = getBookMap(BookFilters.getDailyDevotionals()); ChoiceFactory.getDataMap().put(DAILY_DEVOTIONALS_KEY, rnames); // Create the array of Dictionaries Map<Book, String> greekDef = getBookMap(BookFilters.getGreekDefinitions()); ChoiceFactory.getDataMap().put(GREEKDEF_KEY, greekDef); // Create the array of Dictionaries Map<Book, String> hebrewDef = getBookMap(BookFilters.getHebrewDefinitions()); ChoiceFactory.getDataMap().put(HEBREWDEF_KEY, hebrewDef); // Create the array of Dictionaries Map<Book, String> greekParse = getBookMap(BookFilters.getGreekParse()); ChoiceFactory.getDataMap().put(GREEKPARSE_KEY, greekParse); // Create the array of Dictionaries Map<Book, String> hebrewParse = getBookMap(BookFilters.getHebrewParse()); ChoiceFactory.getDataMap().put(HEBREWPARSE_KEY, hebrewParse); }