|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pietschy.command.file.DefaultRecentFileListModel
public class DefaultRecentFileListModel
Default implementation of RecentFileListModel. This implementation provides
convenience methods for saving and loading the list from a Preferences node.
store(Preferences),
load(Preferences)| Constructor Summary | |
|---|---|
DefaultRecentFileListModel()
Creates a new empty instance. |
|
DefaultRecentFileListModel(java.util.Collection<java.io.File> files)
Creates a new instance initialised with the specified list of files. |
|
DefaultRecentFileListModel(java.io.File[] files)
Creates a new instance initialised with the specified list of files. |
|
| Method Summary | |
|---|---|
void |
add(java.io.File file)
Adds the specified file to the model. |
void |
addAll(java.util.Collection<? extends java.io.File> files)
Adds all files in the specified collection to the list. |
void |
addAll(java.io.File[] files)
Adds all files in the specified array to the list. |
void |
addFileListModelListener(RecentFileListModeListener listener)
Adds the specified listener to the model. |
java.util.List<java.io.File> |
asList()
Returns the model contents as a list. |
void |
clear()
Removes all files from the model. |
boolean |
contains(java.io.File file)
Checks if this model contains the specified file. |
protected void |
fireContentsChanged()
Notifies listeners that the model has changed. |
java.io.File |
get(int i)
Gets the file at the specified index. |
protected int |
indexOf(java.io.File file)
Checks the index of the specified file. |
void |
load(java.util.prefs.Preferences prefs)
Loads the list of files from the specified preference node. |
void |
load(java.util.prefs.Preferences prefs,
boolean includeNonExistentFiles)
Loads the list of files from the specified preference node. |
void |
remove(java.io.File file)
Removes the specified file from the model. |
void |
removeAll(java.util.Collection<? extends java.io.File> collection)
Removes all of the specified files from the model. |
void |
removeFileListModelListener(RecentFileListModeListener listener)
Removes the specified listener from the model. |
int |
size()
Gets the number of files in the model. |
void |
store(java.util.prefs.Preferences prefs)
Stores the list of files to the specified preference node. |
void |
store(java.util.prefs.Preferences prefs,
boolean includeNonExistentFiles)
Stores the list of files to the specified preference node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultRecentFileListModel(java.util.Collection<java.io.File> files)
files - the files to use.public DefaultRecentFileListModel(java.io.File[] files)
files - the files to use.public DefaultRecentFileListModel()
| Method Detail |
|---|
public int size()
size in interface RecentFileListModelpublic java.io.File get(int i)
get in interface RecentFileListModeli - the index.
public boolean contains(java.io.File file)
file - the file to check.
true if the model contains the file, false otherwise.protected int indexOf(java.io.File file)
file - the file to check.
public void add(java.io.File file)
file - the file to add.public void addAll(java.io.File[] files)
files - the array of files to add.public void addAll(java.util.Collection<? extends java.io.File> files)
files - the collection of files to add.public void remove(java.io.File file)
file - the file to remove.public void removeAll(java.util.Collection<? extends java.io.File> collection)
collection - the collection of files to remove.public void clear()
clear in interface RecentFileListModelpublic java.util.List<java.io.File> asList()
public void addFileListModelListener(RecentFileListModeListener listener)
addFileListModelListener in interface RecentFileListModellistener - the listener to add.public void removeFileListModelListener(RecentFileListModeListener listener)
removeFileListModelListener in interface RecentFileListModellistener - the listener to remove.protected void fireContentsChanged()
public void store(java.util.prefs.Preferences prefs)
throws java.util.prefs.BackingStoreException
prefs - the preference node in which to save the groups file list.
java.util.prefs.BackingStoreException - if the store operation fails.load(Preferences, boolean)
public void store(java.util.prefs.Preferences prefs,
boolean includeNonExistentFiles)
throws java.util.prefs.BackingStoreException
prefs - the preference node in which to save the groups file list.includeNonExistentFiles - true to store files that no longer
exists, false to only store existings files.
java.util.prefs.BackingStoreException - if the store operation fails.load(Preferences, boolean)public void load(java.util.prefs.Preferences prefs)
prefs - the preference node in which to retrieve the groups file list.store(Preferences, boolean)
public void load(java.util.prefs.Preferences prefs,
boolean includeNonExistentFiles)
prefs - the preference node in which to retrieve the groups file list.includeNonExistentFiles - true to load files that no longer
exists, false to only load existings files.store(Preferences, boolean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||