|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mov.prefs.PreferencesManager
public class PreferencesManager
The Preferences Manager contains a set of routines for loading and saving all preferences data for the application. Consolidating these routines in a single place allows us to maintain preferences namespace convention and also allows us to easily change the method of storage at a later date if desired.
If a save method first clears all preferences data from a node, it is imperative
that both the save and the equivalent load methods are synchronized
.
Otherwise there is the possibility the load call is called just after the
delete call which would nuke all the values. Perhaps all the methods
should be synchronized.
Nested Class Summary | |
---|---|
class |
PreferencesManager.DatabasePreferences
Database preferences fields. |
class |
PreferencesManager.DisplayPreferences
Display preferences fields. |
class |
PreferencesManager.IDQuoteSyncPreferences
Intra-day Quote Sync preferences fields. |
class |
PreferencesManager.ProxyPreferences
Web proxy preferences fields. |
Field Summary | |
---|---|
static int |
DATABASE
Indicates the quote source is accessing quotes in a database |
static int |
FILES
Deprecated. Indicates the quote source is accessing quotes in files. |
static int |
INTERNAL
Indicates the quote source is accessing the internal database |
static int |
SAMPLES
Indicates the quote source is using the inbuilt sample quotes. |
Method Summary | |
---|---|
static void |
deletePortfolio(java.lang.String name)
Delete the portfolio. |
static void |
deleteWatchScreen(java.lang.String name)
Delete the watch screen. |
static void |
flush()
Forces the preferences data to be saved to the backend store (e.g. disk). |
static java.util.HashMap |
getAnalyserPageSettings(java.lang.String key)
Load all saved user input in an Analyser Page. |
static PreferencesManager.DatabasePreferences |
getDatabaseSettings()
Load database settings. |
static java.lang.String |
getDefaultChart()
Load default chart setting. |
static java.lang.String |
getDirectoryLocation(java.lang.String dirtype)
Load the last directory used when importing quote files. |
static PreferencesManager.DisplayPreferences |
getDisplaySettings()
Load display settings. |
static boolean |
getHasGPLAcceptance()
Return whether we require the user to explicitly accept the GPL license. |
static PreferencesManager.IDQuoteSyncPreferences |
getIDQuoteSyncPreferences()
Load intra-day quote sync module preferences. |
static java.lang.String |
getInternalFileName()
Load the file name to store the internal database. |
static java.lang.String |
getLanguageCode()
Load language setting. |
static int |
getLastPreferencesPage()
Load the last preferences page visited. |
static int |
getMaxDecimalDigits()
Load user interface setting. |
static int |
getMaximumCachedQuotes()
Load the cache's maximum number of quotes. |
static int |
getMinDecimalDigits()
Load user interface setting. |
static Portfolio |
getPortfolio(java.lang.String portfolioName)
Load the portfolio with the given name. |
static java.util.List |
getPortfolioNames()
Return a list of the names of all the portfolios. |
static PreferencesManager.ProxyPreferences |
getProxySettings()
Load proxy settings. |
static int |
getQuoteSource()
Get quote source setting. |
static java.util.List |
getStoredExpressions()
Load the list of all stored expressions. |
static java.util.List |
getStoredMacros()
Load the list of all registered macros. |
static java.util.prefs.Preferences |
getUserNode(java.lang.String node)
Fetches the desired user node, based at the base branch |
static java.lang.String |
getUserNotes(java.lang.String symbol)
|
static WatchScreen |
getWatchScreen(java.lang.String name)
Load the watch screen with the given name. |
static java.util.List |
getWatchScreenNames()
Return a list of the names of all the watch screens. |
static void |
putAnalyserPageSettings(java.lang.String key,
java.util.HashMap settings)
Save all user input in an Analyser Page. |
static void |
putDatabaseSettings(PreferencesManager.DatabasePreferences databasePreferences)
Save database settings. |
static void |
putDefaultChart(java.lang.String defaultChart)
Save default chart setting. |
static void |
putDirectoryLocation(java.lang.String dirtype,
java.lang.String directory)
Save the directory used to import quote files. |
static void |
putDisplaySettings(PreferencesManager.DisplayPreferences displayPreferences)
Save display settings. |
static void |
putHasGPLAcceptance()
Set that the user has been shown the GPL and has accepted it. |
static void |
putIDQuoteSyncPreferences(PreferencesManager.IDQuoteSyncPreferences idQuoteSyncPreferences)
Save intra-day quote sync module preferences. |
static void |
putLanguageCode(java.lang.String languageCode)
Save language setting. |
static void |
putLastPreferencesPage(int page)
Save last preferences page visited. |
static void |
putMaxDecimalDigits(java.lang.String maxDecimalDigits)
Save user interface setting. |
static void |
putMaximumCachedQuotes(int maximumCachedQuotes)
Save the cache's maximum number of quotes. |
static void |
putMinDecimalDigits(java.lang.String minDecimalDigits)
Save user interface setting. |
static void |
putPortfolio(Portfolio portfolio)
Save the portfolio. |
static void |
putProxySettings(PreferencesManager.ProxyPreferences proxyPreferences)
Save proxy settings. |
static void |
putQuoteSource(int quoteSource)
Set quote source setting. |
static void |
putStoredExpressions(java.util.List storedExpressions)
Save the list of all stored expressions. |
static void |
putStoredMacros(java.util.List stored_macros)
Save the list of all registered macros. |
static void |
putUserNotes(java.lang.String symbol,
java.lang.String text)
|
static void |
putWatchScreen(WatchScreen watchScreen)
Save the watch screen. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int SAMPLES
public static int FILES
public static int DATABASE
public static int INTERNAL
Method Detail |
---|
public static void flush()
public static java.util.prefs.Preferences getUserNode(java.lang.String node)
base
branch
node
- the path to the node to be fetchedpublic static boolean getHasGPLAcceptance()
true
if the user needs to explicitly accept the GPLpublic static void putHasGPLAcceptance()
public static java.lang.String getDirectoryLocation(java.lang.String dirtype)
dirtype
- the directory type (e.g. macros, importer, etc)
public static void putDirectoryLocation(java.lang.String dirtype, java.lang.String directory)
dirtype
- the directory type (e.g. macros, importer, etc)directory
- the directory.public static java.util.List getStoredExpressions()
StoredExpression
public static void putStoredExpressions(java.util.List storedExpressions)
storedExpressions
- the stored expressions.StoredExpression
public static java.util.List getStoredMacros()
StoredMacro
public static void putStoredMacros(java.util.List stored_macros)
stored_macros
- the registered macros.StoredMacro
public static void putUserNotes(java.lang.String symbol, java.lang.String text)
public static java.lang.String getUserNotes(java.lang.String symbol)
public static java.util.HashMap getAnalyserPageSettings(java.lang.String key)
key
- a key which identifies which page settings to load.
AnalyserPage
public static void putAnalyserPageSettings(java.lang.String key, java.util.HashMap settings)
key
- a key which identifies which page settings to save.settings
- the settings to save.AnalyserPage
public static int getLastPreferencesPage()
public static void putLastPreferencesPage(int page)
page
- index of the last preferences page visited.public static int getMaximumCachedQuotes()
public static void putMaximumCachedQuotes(int maximumCachedQuotes)
maximumCachedQuotes
- the maximum number of quotes.public static java.util.List getWatchScreenNames()
public static WatchScreen getWatchScreen(java.lang.String name)
name
- the name of the watch screen to load.
public static void putWatchScreen(WatchScreen watchScreen)
watchScreen
- the watch screen.public static void deleteWatchScreen(java.lang.String name)
name
- the watch screen name.public static java.util.List getPortfolioNames()
public static void deletePortfolio(java.lang.String name)
name
- the portfolio name.public static Portfolio getPortfolio(java.lang.String portfolioName) throws PreferencesException
portoflioName
- the name of the portfolio to load.
PreferencesException
- if there was an error loading the portfolio.public static void putPortfolio(Portfolio portfolio) throws PreferencesException
portfolio
- the portfolio.
PreferencesException
- if there was an error saving the portfolio.public static PreferencesManager.ProxyPreferences getProxySettings()
public static void putProxySettings(PreferencesManager.ProxyPreferences proxyPreferences)
proxyPreferences
- the new proxy preferences.public static java.lang.String getLanguageCode()
null
if there is no language
setting saved in preferences.
public static void putLanguageCode(java.lang.String languageCode)
languageCode
- ISO Language Codepublic static int getMinDecimalDigits()
public static void putMinDecimalDigits(java.lang.String minDecimalDigits)
minDecimalDigits
- the minimum decimal digits to be displayedpublic static int getMaxDecimalDigits()
public static void putMaxDecimalDigits(java.lang.String maxDecimalDigits)
maxDecimalDigits
- the maximum decimal digits to be displayedpublic static java.lang.String getDefaultChart()
public static void putDefaultChart(java.lang.String defaultChart)
defaultChart
- the chart to be displayedpublic static int getQuoteSource()
DATABASE
, FILES
or SAMPLES
.public static void putQuoteSource(int quoteSource)
quoteSource
- the quote source, one of DATABASE
, INTERNAL
or
SAMPLES
.public static PreferencesManager.DatabasePreferences getDatabaseSettings()
public static void putDatabaseSettings(PreferencesManager.DatabasePreferences databasePreferences)
databasePreferences
- the new database preferences.public static java.lang.String getInternalFileName()
public static PreferencesManager.DisplayPreferences getDisplaySettings()
public static void putDisplaySettings(PreferencesManager.DisplayPreferences displayPreferences)
displayPreferences
- the new display preferences.public static PreferencesManager.IDQuoteSyncPreferences getIDQuoteSyncPreferences()
IDQuoteSyncModule
public static void putIDQuoteSyncPreferences(PreferencesManager.IDQuoteSyncPreferences idQuoteSyncPreferences)
idQuoteSyncPreferences
- the preferences.IDQuoteSyncModule
|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |