org.norvelle.textcite
Class PreferenceManager

java.lang.Object
  extended by org.norvelle.textcite.PreferenceManager

public class PreferenceManager
extends java.lang.Object

PreferenceManager: A Facade interface for setting and retrieving the various TextCite user preferences. We centralize all interaction with the Preferences store here, in order to avoid spreading the responsibility for setting defaults all around the application. All default preferences are set here; in addition, only those preferences made available here are valid.

Author:
Erik Norvelle

Field Summary
protected  java.util.prefs.Preferences prefs
           
 
Constructor Summary
PreferenceManager()
          Create an instance of the Preference Manager, using the Java Preference API for storage.
 
Method Summary
 boolean getAllowUsagePings()
          Returns the user preference as to whether TextCite is allowed to send usage info.
 boolean getCheckForUpdates()
          Returns the user preference as to whether TextCite should check for updates on the Web.
 java.awt.Font getCitationDisplayFont()
          Get currently selected default Citation display font.
 java.lang.String getCustomReferenceGeneratorTemplate()
           
 java.lang.String getDefaultDirectory()
          Return the default directory for saving and loading CiteBooks
 java.lang.String getDefaultLocale()
           
 java.lang.String getDefaultReferenceGenerator()
           
 java.lang.String getExportDirectory()
          Return the default directory for exports
 java.lang.String getFontSampleText()
           
 int getNumberOfBackups()
          Returns the user preference as to how many backups to make automatically.
 boolean getPerformBackups()
          Returns the user preference as to how many backups to make automatically.
 java.lang.String getRecentDocument(int docNum)
          Get the Nth recent document
 boolean getShowTip()
          Returns the user preference as to whether to show the tip of the day.
 int getUniqueInstanceId()
          Get the unique identifier for this instance of TextCite
 void save()
          Save all prefs to the backing store.
 void setAllowUsagePings(boolean l)
          Sets the user preference as to whether TextCite is allowed to send usage info.
 void setCheckForUpdates(boolean l)
          Sets the user preference as to whether TextCite should check for updates on the Web.
 void setCitationDisplayFont(java.awt.Font f)
          Sets the user preference as to whether to show the tip of the day.
 void setCustomReferenceGeneratorTemplate(java.lang.String l)
           
 void setDefaultDirectory(java.lang.String d)
          Set the default directory for saving and loading CiteBooks
 void setDefaultLocale(java.lang.String l)
           
 void setDefaultReferenceGenerator(java.lang.String l)
           
 void setExportDirectory(java.lang.String d)
          Set the default directory for exports
 void setFontSampleText(java.lang.String l)
           
 void setNumberOfBackups(int l)
          Sets the user preference as to how many backups to make automatically.
 void setPerformBackups(boolean l)
          Sets the user preference as to how many backups to make automatically.
 void setRecentDocument(int docNum, java.lang.String name)
          Set the Nth recent document
 void setShowTip(boolean l)
          Sets the user preference as to whether to show the tip of the day.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefs

protected java.util.prefs.Preferences prefs
Constructor Detail

PreferenceManager

public PreferenceManager()
Create an instance of the Preference Manager, using the Java Preference API for storage.

Method Detail

save

public void save()
Save all prefs to the backing store.


getDefaultDirectory

public java.lang.String getDefaultDirectory()
Return the default directory for saving and loading CiteBooks


setDefaultDirectory

public void setDefaultDirectory(java.lang.String d)
Set the default directory for saving and loading CiteBooks


getExportDirectory

public java.lang.String getExportDirectory()
Return the default directory for exports


setExportDirectory

public void setExportDirectory(java.lang.String d)
Set the default directory for exports


getDefaultLocale

public java.lang.String getDefaultLocale()

setDefaultLocale

public void setDefaultLocale(java.lang.String l)

getCustomReferenceGeneratorTemplate

public java.lang.String getCustomReferenceGeneratorTemplate()

setCustomReferenceGeneratorTemplate

public void setCustomReferenceGeneratorTemplate(java.lang.String l)

getDefaultReferenceGenerator

public java.lang.String getDefaultReferenceGenerator()

setDefaultReferenceGenerator

public void setDefaultReferenceGenerator(java.lang.String l)

getCheckForUpdates

public boolean getCheckForUpdates()
Returns the user preference as to whether TextCite should check for updates on the Web.


setCheckForUpdates

public void setCheckForUpdates(boolean l)
Sets the user preference as to whether TextCite should check for updates on the Web.


getAllowUsagePings

public boolean getAllowUsagePings()
Returns the user preference as to whether TextCite is allowed to send usage info.


setAllowUsagePings

public void setAllowUsagePings(boolean l)
Sets the user preference as to whether TextCite is allowed to send usage info.


getNumberOfBackups

public int getNumberOfBackups()
Returns the user preference as to how many backups to make automatically.


setNumberOfBackups

public void setNumberOfBackups(int l)
Sets the user preference as to how many backups to make automatically.


getPerformBackups

public boolean getPerformBackups()
Returns the user preference as to how many backups to make automatically.


setPerformBackups

public void setPerformBackups(boolean l)
Sets the user preference as to how many backups to make automatically.


getShowTip

public boolean getShowTip()
Returns the user preference as to whether to show the tip of the day.


setShowTip

public void setShowTip(boolean l)
Sets the user preference as to whether to show the tip of the day.


getCitationDisplayFont

public java.awt.Font getCitationDisplayFont()
Get currently selected default Citation display font.


setCitationDisplayFont

public void setCitationDisplayFont(java.awt.Font f)
Sets the user preference as to whether to show the tip of the day.


getFontSampleText

public java.lang.String getFontSampleText()

setFontSampleText

public void setFontSampleText(java.lang.String l)

getUniqueInstanceId

public int getUniqueInstanceId()
Get the unique identifier for this instance of TextCite


getRecentDocument

public java.lang.String getRecentDocument(int docNum)
Get the Nth recent document


setRecentDocument

public void setRecentDocument(int docNum,
                              java.lang.String name)
Set the Nth recent document