public class BasicDirectoryModel extends javax.swing.AbstractListModel implements java.beans.PropertyChangeListener
| Constructor and Description |
|---|
BasicDirectoryModel(javax.swing.JFileChooser filechooser)
Creates a new BasicDirectoryModel object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.Object o)
Returns whether a given (File) object is included in the list.
|
void |
fireContentsChanged()
Fires a content change event.
|
java.util.Vector<java.io.File> |
getDirectories()
Returns a Vector of (java.io.File) objects containing
the directories in this list.
|
java.lang.Object |
getElementAt(int index)
Returns the (java.io.File) object at
an index in the list.
|
java.util.Vector<java.io.File> |
getFiles()
Returns a Vector of (java.io.File) objects containing
the files in this list.
|
int |
getSize()
Returns the size of the list, which only includes directories
if the JFileChooser is set to DIRECTORIES_ONLY.
|
int |
indexOf(java.lang.Object o)
Returns the index of an (java.io.File) object in the list.
|
void |
intervalAdded(javax.swing.event.ListDataEvent e)
Obsoleted method which does nothing.
|
void |
intervalRemoved(javax.swing.event.ListDataEvent e)
Obsoleted method which does nothing.
|
void |
invalidateFileCache()
Obsoleted method which does nothing.
|
protected boolean |
lt(java.io.File a,
java.io.File b)
Less than, determine the relative order in the list of two files
for sorting purposes.
|
void |
propertyChange(java.beans.PropertyChangeEvent e)
Listens for a property change; the change in file selection mode of the
associated JFileChooser.
|
boolean |
renameFile(java.io.File oldFile,
java.io.File newFile)
Renames a file - However, does not re-sort the list
or replace the old file with the new one in the list.
|
protected void |
sort(java.util.Vector<? extends java.io.File> v)
Sorts a Vector of File objects.
|
void |
validateFileCache()
Re-loads the list of files
|
public BasicDirectoryModel(javax.swing.JFileChooser filechooser)
filechooser - DOCUMENT ME!public boolean contains(java.lang.Object o)
o - - The file object to test.true if the list contains the given object.public void fireContentsChanged()
public java.util.Vector<java.io.File> getDirectories()
public java.lang.Object getElementAt(int index)
getElementAt in interface javax.swing.ListModelindex - The list indexpublic java.util.Vector<java.io.File> getFiles()
public int getSize()
getSize in interface javax.swing.ListModelpublic int indexOf(java.lang.Object o)
o - The object - normally a File.public void intervalAdded(javax.swing.event.ListDataEvent e)
public void intervalRemoved(javax.swing.event.ListDataEvent e)
public void invalidateFileCache()
protected boolean lt(java.io.File a, java.io.File b)
a - the first fileb - the second filetrue if a > b, false if a < b.public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenere - - A PropertyChangeEvent.public boolean renameFile(java.io.File oldFile, java.io.File newFile)
oldFile - The old filenewFile - The new file nametrue if the rename succeededprotected void sort(java.util.Vector<? extends java.io.File> v)
v - The Vector to sort.public void validateFileCache()