org.stringer
Class Preferences

java.lang.Object
  |
  +--org.stringer.util.AbstractPreferences
        |
        +--org.stringer.Preferences

public class Preferences
extends AbstractPreferences

Provides access to the global settings.

This class makes use of the singleton pattern.

If you hack around, make sure all pathes are returned with a trailing file separator and all values are initialized to something other than null.

Most important, keep all preferences sorted alphabetically everywhere.


Field Summary
private  long lastLaunchReleaseNr
          The release number of the last version of XNap that was launched prior to this session.
static int PREFS_VERSION
          The current version of the preferences file.
private static Preferences singleton
           
static java.lang.String STRINGER_FEEDS
           
static java.lang.String STRINGER_FILENAME
          The name of the preferences file used by Stringer
static java.lang.String STRINGER_HOME
           
 
Fields inherited from class org.stringer.util.AbstractPreferences
ARRAY_SEPARATOR, isDirtyFlag, logger, namespace, oldVersion, prefsFile, propertyChange, props, version
 
Constructor Summary
private Preferences(java.lang.String filename)
           
 
Method Summary
 void defaults()
          Sets the defaults.
 boolean getAutoVersionCheck()
           
 int getAvailableCount()
           
 java.lang.String getBackupDir()
           
 java.awt.Color getColor(java.lang.String key)
           
 java.lang.String getEmail()
           
 java.lang.String[] getExpandedRows()
           
 java.util.List getFeedSources()
           
 java.awt.Font getFont(java.lang.String key)
          Always returns a valid font.
 int getHorizontalDividerLocation()
           
 java.lang.String getHttpProxyHost()
           
 int getHttpProxyPort()
           
static Preferences getInstance()
          Returns the preferences.
 long getLastLaunchReleaseNr()
           
 long getLastUpdateCheck()
           
 int getMaxSwarmedConnects()
           
 java.lang.String getPassword()
           
 boolean getShowSplash()
           
 boolean getShowToolTips()
           
 java.lang.String getSocksProxyHost()
           
 int getSocksProxyPort()
           
 int getSubscribedCount()
           
 java.lang.String getSubscribedFeeds()
           
 boolean getUseEmacsKeyBindings()
           
 boolean getUseHttpProxy()
           
 java.lang.String getUsername()
           
 boolean getUseSocksProxy()
           
 boolean getUseViKeyBindings()
           
 int getVerticalDividerLocation()
           
 int getWindowHeight()
           
 int getWindowWidth()
           
 int getWindowX()
           
 int getWindowY()
           
 boolean isFirewalled()
           
 void read()
          Sets the preferences from the default preferences file.
 void setAutoVersionCheck(boolean newValue)
           
 void setAvailableCount(int count)
          set the total number of subscribed newsfeeds
 void setBackupDir(java.lang.String s)
           
 void setColor(java.lang.String key, java.awt.Color newValue)
           
 void setEmail(java.lang.String newValue)
           
 void setExpandedRows(java.lang.String s)
           
 void setFirewalled(boolean newValue)
           
 void setFont(java.lang.String key, java.awt.Font newValue)
           
 void setHorizontalDividerLocation(int newValue)
           
 void setHttpProxyHost(java.lang.String newValue)
           
 void setHttpProxyPort(int newValue)
           
 void setLastUpdateCheck(long newValue)
           
 void setPassword(java.lang.String newValue)
           
 void setShowSplash(boolean newValue)
           
 void setShowToolTips(boolean newValue)
           
 void setSocksProxyHost(java.lang.String newValue)
           
 void setSocksProxyPort(int newValue)
           
 void setSubscribedCount(int count)
          set the total number of subscribed newsfeeds
 void setSubscribedFeeds(java.lang.String s)
           
 void setUseEmacsKeyBindings(boolean newValue)
           
 void setUseHttpProxy(boolean newValue)
           
 void setUsername(java.lang.String newValue)
           
 void setUseSocksProxy(boolean newValue)
           
 void setUseViKeyBindings(boolean newValue)
           
 void setVerticalDividerLocation(int newValue)
           
 void setWindowHeight(int newValue)
           
 void setWindowWidth(int newValue)
           
 void setWindowX(int newValue)
           
 void setWindowY(int newValue)
           
 
Methods inherited from class org.stringer.util.AbstractPreferences
addPropertyChangeListener, addPropertyChangeListener, areObjectsEqual, areObjectsEqual, firePropertyChange, get, getBoolean, getFilename, getInt, getIntArray, getList, getLong, getOldVersion, getProperty, getStringArray, getVersion, read, removeProperty, removePropertyChangeListener, renameProperty, set, set, set, set, set, set, set, set, setDefault, setList, setProperty, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRINGER_FILENAME

public static final java.lang.String STRINGER_FILENAME
The name of the preferences file used by Stringer

See Also:
Constant Field Values

STRINGER_HOME

public static final java.lang.String STRINGER_HOME
See Also:
Constant Field Values

STRINGER_FEEDS

public static final java.lang.String STRINGER_FEEDS
See Also:
Constant Field Values

PREFS_VERSION

public static final int PREFS_VERSION
The current version of the preferences file. Increase this, if keys are renamed or removed.

See Also:
Constant Field Values

singleton

private static Preferences singleton

lastLaunchReleaseNr

private long lastLaunchReleaseNr
The release number of the last version of XNap that was launched prior to this session.

Constructor Detail

Preferences

private Preferences(java.lang.String filename)
Method Detail

getInstance

public static Preferences getInstance()
Returns the preferences. This should be called at an early stage.


read

public void read()
Sets the preferences from the default preferences file.

Overrides:
read in class AbstractPreferences

defaults

public void defaults()
Sets the defaults. Preferences that are already set are not overwritten.


getAutoVersionCheck

public boolean getAutoVersionCheck()

setAutoVersionCheck

public void setAutoVersionCheck(boolean newValue)

getFeedSources

public java.util.List getFeedSources()

getColor

public java.awt.Color getColor(java.lang.String key)
Overrides:
getColor in class AbstractPreferences

setColor

public void setColor(java.lang.String key,
                     java.awt.Color newValue)

setExpandedRows

public void setExpandedRows(java.lang.String s)

getExpandedRows

public java.lang.String[] getExpandedRows()

getEmail

public java.lang.String getEmail()

setEmail

public void setEmail(java.lang.String newValue)

getSubscribedFeeds

public java.lang.String getSubscribedFeeds()

setSubscribedFeeds

public void setSubscribedFeeds(java.lang.String s)

getAvailableCount

public int getAvailableCount()
Returns:
the total number of subscribed newsfeeds

setAvailableCount

public void setAvailableCount(int count)
set the total number of subscribed newsfeeds


getSubscribedCount

public int getSubscribedCount()
Returns:
the total number of subscribed newsfeeds

setSubscribedCount

public void setSubscribedCount(int count)
set the total number of subscribed newsfeeds


getBackupDir

public java.lang.String getBackupDir()

setBackupDir

public void setBackupDir(java.lang.String s)

getFont

public java.awt.Font getFont(java.lang.String key)
Description copied from class: AbstractPreferences
Always returns a valid font.

Overrides:
getFont in class AbstractPreferences

setFont

public void setFont(java.lang.String key,
                    java.awt.Font newValue)

isFirewalled

public boolean isFirewalled()

setFirewalled

public void setFirewalled(boolean newValue)

getHttpProxyHost

public java.lang.String getHttpProxyHost()

setHttpProxyHost

public void setHttpProxyHost(java.lang.String newValue)

getHttpProxyPort

public int getHttpProxyPort()

setHttpProxyPort

public void setHttpProxyPort(int newValue)

getLastLaunchReleaseNr

public long getLastLaunchReleaseNr()

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String newValue)

getLastUpdateCheck

public long getLastUpdateCheck()

setLastUpdateCheck

public void setLastUpdateCheck(long newValue)

getShowSplash

public boolean getShowSplash()

setShowSplash

public void setShowSplash(boolean newValue)

getShowToolTips

public boolean getShowToolTips()

setShowToolTips

public void setShowToolTips(boolean newValue)

getMaxSwarmedConnects

public int getMaxSwarmedConnects()

getSocksProxyHost

public java.lang.String getSocksProxyHost()

setSocksProxyHost

public void setSocksProxyHost(java.lang.String newValue)

getSocksProxyPort

public int getSocksProxyPort()

setSocksProxyPort

public void setSocksProxyPort(int newValue)

getVerticalDividerLocation

public int getVerticalDividerLocation()

setVerticalDividerLocation

public void setVerticalDividerLocation(int newValue)

getHorizontalDividerLocation

public int getHorizontalDividerLocation()

setHorizontalDividerLocation

public void setHorizontalDividerLocation(int newValue)

getUseEmacsKeyBindings

public boolean getUseEmacsKeyBindings()

setUseEmacsKeyBindings

public void setUseEmacsKeyBindings(boolean newValue)

getUseViKeyBindings

public boolean getUseViKeyBindings()

setUseViKeyBindings

public void setUseViKeyBindings(boolean newValue)

getUsername

public java.lang.String getUsername()

setUsername

public void setUsername(java.lang.String newValue)

getUseHttpProxy

public boolean getUseHttpProxy()

setUseHttpProxy

public void setUseHttpProxy(boolean newValue)

getUseSocksProxy

public boolean getUseSocksProxy()

setUseSocksProxy

public void setUseSocksProxy(boolean newValue)

getWindowHeight

public int getWindowHeight()

setWindowHeight

public void setWindowHeight(int newValue)

getWindowWidth

public int getWindowWidth()

setWindowWidth

public void setWindowWidth(int newValue)

getWindowX

public int getWindowX()

setWindowX

public void setWindowX(int newValue)

getWindowY

public int getWindowY()

setWindowY

public void setWindowY(int newValue)


Copyright © R. Kevin Cole. All Rights Reserved.