|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.demo.JadiceDemoPreferences
public class JadiceDemoPreferences
This class provides some utility methods for the demo preferences. E.g. a method to load and store the list of recent files.
Weak listeners can be registered in cases where de-registration of listeners is not easily
possible (see addWeakPreferenceChangeListener(PreferenceChangeListener)
).
Auto-Flush mode: This class can automatically flush the preferences on a PreferenceChangeEvent (
see isAutoFlush()
/ setAutoFlush(boolean)
). By default, this feature is
disabled.
Field Summary | |
---|---|
static String |
PREF_KEY_RECENT_FILE
|
Method Summary | |
---|---|
static void |
addWeakPreferenceChangeListener(PreferenceChangeListener listener)
Adds a weak PreferenceChangeListener to get notified about preference changes. |
static Preferences |
getPreferences()
This is equivalent to |
static List<String> |
getRecentlyUsedFiles()
Returns a list containing the recently used files. |
static boolean |
isAutoFlush()
Check if auto-flush is enabled |
static void |
setAutoFlush(boolean autoFlush)
Sets the auto-flush to the desired value. |
static void |
updateRecentFileList(String currentFile)
Called when a new file has been opened. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PREF_KEY_RECENT_FILE
Method Detail |
---|
public static void addWeakPreferenceChangeListener(PreferenceChangeListener listener)
listener
- - the listener to weakly registerpublic static Preferences getPreferences()
Preferences.userNodeForPackage(JadiceDemoProperties.class)
public static boolean isAutoFlush()
public static void setAutoFlush(boolean autoFlush)
autoFlush
- public static void updateRecentFileList(String currentFile)
This method encapsulates the logic to store the list in the preferences.
currentFile
- - the file opened.public static List<String> getRecentlyUsedFiles()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |