|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.AbstractListModel
javax.swing.plaf.basic.BasicDirectoryModel
public class BasicDirectoryModel
Implements an AbstractListModel for directories where the source of the files is a JFileChooser object. This class is used for sorting and ordering the file list in a JFileChooser L&F object.
| Field Summary |
|---|
| Fields inherited from class javax.swing.AbstractListModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
BasicDirectoryModel(JFileChooser filechooser)
Creates a new BasicDirectoryModel object. |
|
| Method Summary | |
|---|---|
boolean |
contains(Object o)
Returns whether a given (File) object is included in the list. |
void |
fireContentsChanged()
Fires a content change event. |
Vector<File> |
getDirectories()
Returns a Vector of (java.io.File) objects containing the directories in this list. |
Object |
getElementAt(int index)
Returns the (java.io.File) object at an index in the list. |
Vector<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(Object o)
Returns the index of an (java.io.File) object in the list. |
void |
intervalAdded(ListDataEvent e)
Obsoleted method which does nothing. |
void |
intervalRemoved(ListDataEvent e)
Obsoleted method which does nothing. |
void |
invalidateFileCache()
Obsoleted method which does nothing. |
protected boolean |
lt(File a,
File b)
Less than, determine the relative order in the list of two files for sorting purposes. |
void |
propertyChange(PropertyChangeEvent e)
Listens for a property change; the change in file selection mode of the associated JFileChooser. |
boolean |
renameFile(File oldFile,
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(Vector<? extends File> v)
Sorts a Vector of File objects. |
void |
validateFileCache()
Re-loads the list of files |
| Methods inherited from class javax.swing.AbstractListModel |
|---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BasicDirectoryModel(JFileChooser filechooser)
filechooser - DOCUMENT ME!| Method Detail |
|---|
public boolean contains(Object o)
o - - The file object to test.
true if the list contains the given object.public void fireContentsChanged()
public Vector<File> getDirectories()
public Object getElementAt(int index)
getElementAt in interface ListModelindex - The list index
public Vector<File> getFiles()
public int getSize()
getSize in interface ListModelpublic int indexOf(Object o)
o - The object - normally a File.
public void intervalAdded(ListDataEvent e)
public void intervalRemoved(ListDataEvent e)
public void invalidateFileCache()
protected boolean lt(File a,
File b)
a - the first fileb - the second file
true if a > b, false if a < b.public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenere - - A PropertyChangeEvent.
public boolean renameFile(File oldFile,
File newFile)
oldFile - The old filenewFile - The new file name
true if the rename succeededprotected void sort(Vector<? extends File> v)
v - The Vector to sort.public void validateFileCache()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||