javax.swing.plaf.basic
Class BasicDirectoryModel
- EventListener, ListModel, PropertyChangeListener, Serializable
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.
boolean | contains(Object o) - Returns whether a given (File) object is included in the list.
|
void | fireContentsChanged() - Fires a content change event.
|
Vector | 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 | 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(File> v) - Sorts a Vector of File objects.
|
void | validateFileCache() - Re-loads the list of files
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
contains
public boolean contains(Object o)
Returns whether a given (File) object is included in the list.
o
- - The file object to test.
true
if the list contains the given object.
getDirectories
public Vector getDirectories()
Returns a Vector of (java.io.File) objects containing
the directories in this list.
getFiles
public Vector getFiles()
Returns a Vector of (java.io.File) objects containing
the files in this list.
getSize
public int getSize()
Returns the size of the list, which only includes directories
if the JFileChooser is set to DIRECTORIES_ONLY.
Otherwise, both directories and files are included in the count.
- getSize in interface ListModel
indexOf
public int indexOf(Object o)
Returns the index of an (java.io.File) object in the list.
o
- The object - normally a File.
- the index of that object, or -1 if it is not in the list.
lt
protected boolean lt(File a,
File b)
Less than, determine the relative order in the list of two files
for sorting purposes.
The order is: directories <32files, and thereafter alphabetically,
using the default locale collation.
a
- the first fileb
- the second file
true
if a > b, false
if a <32b.
renameFile
public 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.
oldFile
- The old filenewFile
- The new file name
true
if the rename succeeded
sort
protected void sort(File> v)
Sorts a Vector of File objects.
BasicDirectoryModel.java --
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.