@Override public boolean test(Book book) { return book.getBookCategory().equals(bookCategory) && !book.isLocked(); } });
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); } }
/** * If the user has chosen to remember the book (by type) then set the * current book for that type. * * @param book the current Book */ public static void setCurrentBook(Book book) { BookCategory type = book.getBookCategory(); if (type.equals(BookCategory.BIBLE) && isCurrentBible()) { currentBible = book; } }
public Book getDefaultStrongsHebrewDictionary() { // default to StrongsRealHebrew or StrongsHebrew String[] preferredBooks = {"StrongsRealHebrew", "StrongsHebrew"}; for (String prefBook : preferredBooks) { Book strongs = Books.installed().getBook(prefBook); if (strongs!=null) { return strongs; } } return Defaults.getHebrewDefinitions(); }
/** * 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); } }
/** prefer the Real alternatives to the default versions because they contain the native Greek Hebrew words */ public Book getDefaultStrongsGreekDictionary() { // default to StrongsRealGreek or StrongsGreek String[] preferredBooks = {"StrongsRealGreek", "StrongsGreek"}; for (String prefBook : preferredBooks) { Book strongs = Books.installed().getBook(prefBook); if (strongs!=null) { return strongs; } } return Defaults.getGreekDefinitions(); }
public void bookAdded(BooksEvent ev) { Book book = ev.getBook(); checkPreferable(book); refreshBooks(); }
/** * Uninstall a book. * * @param book * the book to delete * @throws BookException */ public void deleteBook(Book book) throws BookException { // Actually do the delete // This should be a call on installer. // This will also remove the book from the list of installed books. book.getDriver().delete(book); }
/** * A filter that accepts everything that's not a Bible or a Commentary, when * commentaries are listed with Bibles. * * @return the desired filter */ public static BookFilter getNonBibles() { if (commentariesWithBibles) { return both(new NotBookCategoryFilter(BookCategory.BIBLE), new NotBookCategoryFilter(BookCategory.COMMENTARY)); } return new NotBookCategoryFilter(BookCategory.BIBLE); }
/** * A filter that accepts everything that implements Bible or Commentary, * when commentaries are listed with Bibles. * * @return the desired filter */ public static BookFilter getBibles() { if (commentariesWithBibles) { return either(new BookCategoryFilter(BookCategory.BIBLE), new BookCategoryFilter(BookCategory.COMMENTARY)); } return new BookCategoryFilter(BookCategory.BIBLE); }
/** * Unset the default daily devotional. */ protected static void unsetDailyDevotional() { dailyDevotionalDeft.unsetDefault(); }
/** * A filter that accepts everything that is a Greek Parse/Morphology * Dictionary * * @return the desired filter */ public static BookFilter getGreekParse() { return new BookFeatureFilter(FeatureType.GREEK_PARSE); }
/** * @return the default Bible */ public static Book getBible() { return bibleDeft.getDefault(); }
/** * @return the name of the default dictionary */ public static String getDictionaryByName() { return dictionaryDeft.getDefaultName(); }
/** * Set the default Book conditionally. It has to satisfy the filter and the * book must not currently be set. * * @param newBook * The version to use as default. */ public void setDefaultConditionally(Book newBook) { if (book == null) { setDefault(newBook); } }
/** * A filter that accepts everything that implements Dictionary * * @return the desired filter */ public static BookFilter getDictionaries() { return new BookCategoryFilter(BookCategory.DICTIONARY); }
public boolean test(Book book) { BookCategory bookCategory = book.getBookCategory(); if (book.isLocked()) { return false; } else { return bookCategory.equals(BookCategory.BIBLE) || bookCategory.equals(BookCategory.COMMENTARY) || bookCategory.equals(BookCategory.DICTIONARY) || bookCategory.equals(BookCategory.GENERAL_BOOK) || bookCategory.equals(BookCategory.MAPS); } } }
/** * Unset the default Greek Strong's Numbers dictionary. */ protected static void unsetGreekDefinitions() { greekDefinitionsDeft.unsetDefault(); }
/** * A filter that accepts everything that is a Hebrew Parse/Morphology * Dictionary * * @return the desired filter */ public static BookFilter getHebrewParse() { return new BookFeatureFilter(FeatureType.HEBREW_PARSE); }