|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.talvi.puffinplot.RecentFileList
public class RecentFileList
RecentFileList manages a list of file-sets. It is intended to be used to manage a collection of recently used files for convenient re-opening by a user. Note that each item in the list can comprise multiple files. The length of the list is currently hard-wired to 8, though this would be trivial to change if necessary.
RecentFileList loads and saves its data to a Preferences
object, using the keys of the form recentFileX, where X is a non-negative
integer less than the maximum number of file-sets.
| Constructor Summary | |
|---|---|
RecentFileList(java.util.prefs.Preferences prefs)
Creates a new file list, reading data (if any) from the supplied Preferences object. |
|
| Method Summary | |
|---|---|
void |
add(java.util.List<java.io.File> files)
Adds a new file-set to the top of the list. |
java.util.List<java.io.File> |
getFilesAndReorder(int index)
Returns a specified file-set and moves it to the top of the list. |
java.lang.String[] |
getFilesetNames()
Gets a list containing the names of the file-sets in the file list. |
void |
save(java.util.prefs.Preferences prefs)
Saves the recent file list to the specified Preferences object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RecentFileList(java.util.prefs.Preferences prefs)
Preferences object. If any recentFile0 (and so on)
keys are absent, no error is raised, and the corresponding slots
in the file list are left empty.
prefs - the preferences object from which the read file list
data| Method Detail |
|---|
public void save(java.util.prefs.Preferences prefs)
prefs - the Preferences to which to save the recent file listpublic java.lang.String[] getFilesetNames()
public java.util.List<java.io.File> getFilesAndReorder(int index)
index - the index of a file-set within the list
public void add(java.util.List<java.io.File> files)
files - the files to be added (as a single file-set) to the list
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||