Methods Summary |
---|
public boolean | contains(java.lang.Object o)
return fileCache.contains(o);
|
public void | fireContentsChanged()
// System.out.println("BasicDirectoryModel: firecontentschanged");
fireContentsChanged(this, 0, getSize()-1);
|
public java.util.Vector | getDirectories()
synchronized(fileCache) {
if (directories != null) {
return directories;
}
Vector fls = getFiles();
return directories;
}
|
public java.lang.Object | getElementAt(int index)
return fileCache.get(index);
|
public java.util.Vector | getFiles()
synchronized(fileCache) {
if (files != null) {
return files;
}
files = new Vector();
directories = new Vector();
directories.addElement(filechooser.getFileSystemView().createFileObject(
filechooser.getCurrentDirectory(), "..")
);
for (int i = 0; i < getSize(); i++) {
File f = (File)fileCache.get(i);
if (filechooser.isTraversable(f)) {
directories.add(f);
} else {
files.add(f);
}
}
return files;
}
|
public int | getSize()
return fileCache.size();
|
public int | indexOf(java.lang.Object o)
return fileCache.indexOf(o);
|
public void | intervalAdded(javax.swing.event.ListDataEvent e)Obsolete - not used.
|
public void | intervalRemoved(javax.swing.event.ListDataEvent e)Obsolete - not used.
|
public void | invalidateFileCache()Obsolete - not used.
|
protected boolean | lt(java.io.File a, java.io.File b)
// First ignore case when comparing
int diff = a.getName().toLowerCase().compareTo(b.getName().toLowerCase());
if (diff != 0) {
return diff < 0;
} else {
// May differ in case (e.g. "mail" vs. "Mail")
return a.getName().compareTo(b.getName()) < 0;
}
|
public void | propertyChange(java.beans.PropertyChangeEvent e)
String prop = e.getPropertyName();
if(prop == JFileChooser.DIRECTORY_CHANGED_PROPERTY ||
prop == JFileChooser.FILE_VIEW_CHANGED_PROPERTY ||
prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY ||
prop == JFileChooser.FILE_HIDING_CHANGED_PROPERTY ||
prop == JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY) {
validateFileCache();
}
|
public boolean | renameFile(java.io.File oldFile, java.io.File newFile)Renames a file in the underlying file system.
synchronized(fileCache) {
if (oldFile.renameTo(newFile)) {
validateFileCache();
return true;
}
return false;
}
|
protected void | sort(java.util.Vector v)
ShellFolder.sortFiles(v);
|
public void | validateFileCache()
File currentDirectory = filechooser.getCurrentDirectory();
if (currentDirectory == null) {
return;
}
if (loadThread != null) {
loadThread.interrupt();
loadThread.cancelRunnables();
}
fetchID++;
loadThread = new LoadFilesThread(currentDirectory, fetchID);
loadThread.start();
|