org.crosswire.jsword.book
Class Defaults

java.lang.Object
  extended by org.crosswire.jsword.book.Defaults

public final class Defaults
extends Object

Handles the current default Books.

Author:
Joe Walker [joe at eireneh dot com]
See Also:
for license details. The copyright to this program is held by it's authors.

Nested Class Summary
(package private) static class Defaults.DefaultsBookListener
          To keep us up to date with changes in the available Books
 
Field Summary
private static String BIBLE_KEY
           
private static DefaultBook bibleDeft
          The default Bible
private static String COMMENTARY_KEY
           
private static DefaultBook commentaryDeft
          The default Commentary
private static Book currentBible
          The current bible being tracked.
private static String DAILY_DEVOTIONALS_KEY
           
private static DefaultBook dailyDevotionalDeft
          The default DailyDevotional
private static String DICTIONARY_KEY
           
private static DefaultBook dictionaryDeft
          The default Dictionary
private static String GREEKDEF_KEY
           
private static DefaultBook greekDefinitionsDeft
          The default Greek Definitions Dictinary.
private static String GREEKPARSE_KEY
           
private static DefaultBook greekParseDeft
          The default Greek Parse Dictinary.
private static String HEBREWDEF_KEY
           
private static DefaultBook hebrewDefinitionsDeft
          The default Hebrew Definitions Dictionary.
private static String HEBREWPARSE_KEY
           
private static DefaultBook hebrewParseDeft
          The default Hebrew Parse Dictinary.
private static boolean trackBible
          Indicates whether the last book of each type is used next time.
 
Constructor Summary
private Defaults()
          Prevent construction
 
Method Summary
protected static void checkAllPreferable()
          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 checkPreferable(Book book)
          Determine whether this Book become the default.
static Book getBible()
           
static String getBibleByName()
           
static Book getCommentary()
           
static String getCommentaryByName()
           
static Book getCurrentBible()
           
static Book getDailyDevotional()
           
static String getDailyDevotionalByName()
           
protected static DefaultBook getDefaultBible()
           
protected static DefaultBook getDefaultCommentary()
           
protected static DefaultBook getDefaultDailyDevotional()
           
protected static DefaultBook getDefaultDictionary()
           
protected static DefaultBook getDefaultGreekDefinitions()
           
protected static DefaultBook getDefaultGreekParse()
           
protected static DefaultBook getDefaultHebrewDefinitions()
           
protected static DefaultBook getDefaultHebrewParse()
           
static Book getDictionary()
           
static String getDictionaryByName()
           
static Book getGreekDefinitions()
           
static String getGreekDefinitionsByName()
           
static Book getGreekParse()
           
static String getGreekParseByName()
           
static Book getHebrewDefinitions()
           
static String getHebrewDefinitionsByName()
           
static Book getHebrewParse()
           
static String getHebrewParseByName()
           
private static String[] getNameArray(BookFilter filter)
          Convert a filter into an array of names of Books that pass the filter.
static boolean isCurrentBible()
          Determine whether the getBible should return the current Bible or the user's chosen default.
static void refreshBooks()
           
static void setBible(Book book)
           
static void setBibleByName(String name)
           
static void setCommentary(Book book)
           
static void setCommentaryByName(String name)
           
static void setCurrentBible(boolean current)
          Establish whether the getBible should return the current Bible or the user's chosen default.
static void setCurrentBook(Book book)
          If the user has chosen to remember the book (by type) then set the current book for that type.
static void setDailyDevotional(Book book)
           
static void setDailyDevotionalByName(String name)
           
static void setDictionary(Book book)
           
static void setDictionaryByName(String name)
           
static void setGreekDefinitions(Book book)
           
static void setGreekDefinitionsByName(String name)
           
static void setGreekParse(Book book)
           
static void setGreekParseByName(String name)
           
static void setHebrewDefinitions(Book book)
           
static void setHebrewDefinitionsByName(String name)
           
static void setHebrewParse(Book book)
           
static void setHebrewParseByName(String name)
           
protected static void unsetBible()
           
protected static void unsetCommentary()
           
protected static void unsetDailyDevotional()
           
protected static void unsetDictionary()
           
protected static void unsetGreekDefinitions()
           
protected static void unsetGreekParse()
           
protected static void unsetHebrewDefinitions()
           
protected static void unsetHebrewParse()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BIBLE_KEY

private static final String BIBLE_KEY
See Also:
Constant Field Values

COMMENTARY_KEY

private static final String COMMENTARY_KEY
See Also:
Constant Field Values

DICTIONARY_KEY

private static final String DICTIONARY_KEY
See Also:
Constant Field Values

DAILY_DEVOTIONALS_KEY

private static final String DAILY_DEVOTIONALS_KEY
See Also:
Constant Field Values

GREEKDEF_KEY

private static final String GREEKDEF_KEY
See Also:
Constant Field Values

HEBREWDEF_KEY

private static final String HEBREWDEF_KEY
See Also:
Constant Field Values

GREEKPARSE_KEY

private static final String GREEKPARSE_KEY
See Also:
Constant Field Values

HEBREWPARSE_KEY

private static final String HEBREWPARSE_KEY
See Also:
Constant Field Values

trackBible

private static boolean trackBible
Indicates whether the last book of each type is used next time.


currentBible

private static Book currentBible
The current bible being tracked.


bibleDeft

private static DefaultBook bibleDeft
The default Bible


commentaryDeft

private static DefaultBook commentaryDeft
The default Commentary


dailyDevotionalDeft

private static DefaultBook dailyDevotionalDeft
The default DailyDevotional


dictionaryDeft

private static DefaultBook dictionaryDeft
The default Dictionary


greekParseDeft

private static DefaultBook greekParseDeft
The default Greek Parse Dictinary.


hebrewParseDeft

private static DefaultBook hebrewParseDeft
The default Hebrew Parse Dictinary.


greekDefinitionsDeft

private static DefaultBook greekDefinitionsDeft
The default Greek Definitions Dictinary.


hebrewDefinitionsDeft

private static DefaultBook hebrewDefinitionsDeft
The default Hebrew Definitions Dictionary.

Constructor Detail

Defaults

private Defaults()
Prevent construction

Method Detail

isCurrentBible

public static boolean isCurrentBible()
Determine whether the getBible should return the current Bible or the user's chosen default.

Returns:
true if the bible tracks the user's selection

setCurrentBible

public static void setCurrentBible(boolean current)
Establish whether the getBible should return the current Bible or the user's chosen default.

Parameters:
current -

setCurrentBook

public static void setCurrentBook(Book book)
If the user has chosen to remember the book (by type) then set the current book for that type.

Parameters:
book -

getCurrentBible

public static Book getCurrentBible()

setBible

public static void setBible(Book book)

unsetBible

protected static void unsetBible()

getBible

public static Book getBible()

getBibleByName

public static String getBibleByName()

setBibleByName

public static void setBibleByName(String name)

setCommentary

public static void setCommentary(Book book)

unsetCommentary

protected static void unsetCommentary()

getCommentary

public static Book getCommentary()

getCommentaryByName

public static String getCommentaryByName()

setCommentaryByName

public static void setCommentaryByName(String name)

setDictionary

public static void setDictionary(Book book)

unsetDictionary

protected static void unsetDictionary()

getDictionary

public static Book getDictionary()

getDictionaryByName

public static String getDictionaryByName()

setDictionaryByName

public static void setDictionaryByName(String name)

setDailyDevotional

public static void setDailyDevotional(Book book)

unsetDailyDevotional

protected static void unsetDailyDevotional()

getDailyDevotional

public static Book getDailyDevotional()

getDailyDevotionalByName

public static String getDailyDevotionalByName()

setDailyDevotionalByName

public static void setDailyDevotionalByName(String name)

setGreekDefinitions

public static void setGreekDefinitions(Book book)

unsetGreekDefinitions

protected static void unsetGreekDefinitions()

getGreekDefinitions

public static Book getGreekDefinitions()

getGreekDefinitionsByName

public static String getGreekDefinitionsByName()

setGreekDefinitionsByName

public static void setGreekDefinitionsByName(String name)

setHebrewDefinitions

public static void setHebrewDefinitions(Book book)

unsetHebrewDefinitions

protected static void unsetHebrewDefinitions()

getHebrewDefinitions

public static Book getHebrewDefinitions()

getHebrewDefinitionsByName

public static String getHebrewDefinitionsByName()

setHebrewDefinitionsByName

public static void setHebrewDefinitionsByName(String name)

setGreekParse

public static void setGreekParse(Book book)

unsetGreekParse

protected static void unsetGreekParse()

getGreekParse

public static Book getGreekParse()

getGreekParseByName

public static String getGreekParseByName()

setGreekParseByName

public static void setGreekParseByName(String name)

setHebrewParse

public static void setHebrewParse(Book book)

unsetHebrewParse

protected static void unsetHebrewParse()

getHebrewParse

public static Book getHebrewParse()

getHebrewParseByName

public static String getHebrewParseByName()

setHebrewParseByName

public static void setHebrewParseByName(String name)

getDefaultBible

protected static DefaultBook getDefaultBible()

getDefaultCommentary

protected static DefaultBook getDefaultCommentary()

getDefaultDictionary

protected static DefaultBook getDefaultDictionary()

getDefaultDailyDevotional

protected static DefaultBook getDefaultDailyDevotional()

getDefaultGreekDefinitions

protected static DefaultBook getDefaultGreekDefinitions()

getDefaultHebrewDefinitions

protected static DefaultBook getDefaultHebrewDefinitions()

getDefaultGreekParse

protected static DefaultBook getDefaultGreekParse()

getDefaultHebrewParse

protected static DefaultBook getDefaultHebrewParse()

refreshBooks

public static void refreshBooks()

checkAllPreferable

protected static void checkAllPreferable()
Go through all of the current books checking to see if we need to replace the current defaults with one of these.


checkPreferable

protected static void checkPreferable(Book book)
Determine whether this Book become the default. It should, only if there is not one.


getNameArray

private static String[] getNameArray(BookFilter filter)
Convert a filter into an array of names of Books that pass the filter.


Copyright ยจ 2003-2007