|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.tools.apputils.files.RecentFileTracker
RecentFileTracker caches recently accessed files into the the user's preferences and has accessors for getting the recent files and the most recent folder.
| Field Summary | |
protected static int |
DEFAULT_BUFFER_SIZE
|
protected java.lang.String |
PREFERENCE_ID
|
protected java.util.prefs.Preferences |
PREFS
|
protected int |
RECENT_URLS_BUFFER_SIZE
|
| Constructor Summary | |
RecentFileTracker(java.lang.Class preferenceNode,
java.lang.String preferenceID)
Constructor with a default buffer size of 10 |
|
RecentFileTracker(int bufferSize,
java.lang.Class preferenceNode,
java.lang.String preferenceID)
Constructor which generates the preferences from teh specified preference node |
|
RecentFileTracker(int bufferSize,
java.util.prefs.Preferences prefs,
java.lang.String preferenceID)
Primary constructor |
|
| Method Summary | |
javax.swing.JFileChooser |
applyRecentFolder(javax.swing.JFileChooser fileChooser)
Set the file chooser's current directory to the recent folder. |
void |
cacheURL(java.io.File file)
Cache the URL of the specified file. |
void |
cacheURL(java.lang.String urlSpec)
Cache the URL |
void |
cacheURL(java.net.URL url)
Cache the URL. |
void |
clearCache()
Clear the cache of the recent URL specs |
java.io.File |
getRecentFolder()
Get the folder corresponding to the most recently cached URL. |
java.lang.String |
getRecentFolderPath()
Get the folder path corresponding to the most recently cached URL. |
java.lang.String[] |
getRecentURLSpecs()
Get the array of URLs corresponding to recently registered URLs. |
protected static java.lang.String[] |
getTokens(java.lang.String string)
Parse a string into tokens where whitespace is the delimiter. |
protected static java.lang.String[] |
getTokens(java.lang.String string,
java.lang.String delim)
Parse a string into tokens with the specified delimiter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int DEFAULT_BUFFER_SIZE
protected final int RECENT_URLS_BUFFER_SIZE
protected final java.util.prefs.Preferences PREFS
protected final java.lang.String PREFERENCE_ID
| Constructor Detail |
public RecentFileTracker(int bufferSize,
java.util.prefs.Preferences prefs,
java.lang.String preferenceID)
bufferSize - the buffer size of the recent URL specs to cacheprefs - the preferences used to save the cache of recent URL specspreferenceID - the ID of the preference to save
public RecentFileTracker(int bufferSize,
java.lang.Class preferenceNode,
java.lang.String preferenceID)
bufferSize - the buffer size of the recent URL specs to cachepreferenceNode - the node used for saving the preferencepreferenceID - the ID of the preference to save
public RecentFileTracker(java.lang.Class preferenceNode,
java.lang.String preferenceID)
preferenceNode - the node used for saving the preferencepreferenceID - the ID of the preference to save| Method Detail |
public void clearCache()
public void cacheURL(java.io.File file)
file - the file whose URL is to be cached.public void cacheURL(java.net.URL url)
url - the URL to cache.public void cacheURL(java.lang.String urlSpec)
urlSpec - the URL Spec to cache.public java.lang.String[] getRecentURLSpecs()
public java.io.File getRecentFolder()
public java.lang.String getRecentFolderPath()
public javax.swing.JFileChooser applyRecentFolder(javax.swing.JFileChooser fileChooser)
fileChooser - the file chooser for which to set the current directory
protected static java.lang.String[] getTokens(java.lang.String string)
string - The string to parse.
protected static java.lang.String[] getTokens(java.lang.String string,
java.lang.String delim)
string - The string to parse.delim - The delimiter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||