| java.lang.Object javax.swing.filechooser.FileView com.db.utils.BasicFileView
BasicFileView | public class BasicFileView extends FileView (Code) | | A convenience implementation of the FileView interface that
manages name, icon, traversable, and file type information.
This this implemention will work well with file systems that use
"dot" extensions to indicate file type. For example: "picture.gif"
as a gif image.
If the java.io.File ever contains some of this information, such as
file type, icon, and hidden file inforation, this implementation may
become obsolete. At minimum, it should be rewritten at that time to
use any new type information provided by java.io.File
Example:
JFileChooser chooser = new JFileChooser();
fileView = new BasicFileView();
fileView.putIcon("jpg", new ImageIcon("images/jpgIcon.jpg"));
fileView.putIcon("gif", new ImageIcon("images/gifIcon.gif"));
chooser.setFileView(fileView);
version: 1.11 12/03/01 author: Jeff Dinkins |
getExtension | public String getExtension(File f)(Code) | | Conveinience method that returnsa the "dot" extension for the
given file.
|
getIcon | public Icon getIcon(File f)(Code) | | Icon that reperesents this file. Default implementation returns
null. You might want to override this to return something more
interesting.
See Also: FileView.getIcon |
isHidden | public Boolean isHidden(File f)(Code) | | Whether the file is hidden or not. This implementation returns
true if the filename starts with a "."
See Also: FileView.isHidden |
isTraversable | public Boolean isTraversable(File f)(Code) | | Whether the directory is traversable or not. Generic implementation
returns true for all directories and special folders.
You might want to subtype BasicFileView to do somethimg more interesting,
such as recognize compound documents directories; in such a case you might
return a special icon for the diretory that makes it look like a regular
document, and return false for isTraversable to not allow users to
descend into the directory.
See Also: FileView.isTraversable |
putDescription | public void putDescription(File f, String fileDescription)(Code) | | Adds a human readable description of the file.
|
putIcon | public void putIcon(String extension, Icon icon)(Code) | | Adds an icon based on the file type "dot" extension
string, e.g: ".gif". Case is ignored.
|
putTypeDescription | public void putTypeDescription(String extension, String typeDescription)(Code) | | Adds a human readable type description for files. Based on "dot"
extension strings, e.g: ".gif". Case is ignored.
|
putTypeDescription | public void putTypeDescription(File f, String typeDescription)(Code) | | Adds a human readable type description for files of the type of
the passed in file. Based on "dot" extension strings, e.g: ".gif".
Case is ignored.
|
|
|