|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.filechooser.FileView | +--puzzled.dialogs.PSFileView
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 ExampleFileView(); fileView.putIcon("jpg", new ImageIcon("images/jpgIcon.jpg")); fileView.putIcon("gif", new ImageIcon("images/gifIcon.gif")); chooser.setFileView(fileView); Modified for Powerflow by Frédéric Demers & Guillaume Gilbert on 21 Nov 98
Constructor Summary | |
PSFileView()
|
Method Summary | |
java.lang.String |
getDescription(java.io.File f)
A human readable description of the file. |
java.lang.String |
getExtension(java.io.File f)
Conveinience method that returnsa the "dot" extension for the given file. |
javax.swing.Icon |
getIcon(java.io.File f)
Icon that reperesents this file. |
java.lang.String |
getName(java.io.File f)
The name of the file. |
java.lang.String |
getTypeDescription(java.io.File f)
A human readable description of the type of the file. |
java.lang.Boolean |
isHidden(java.io.File f)
Whether the file is hidden or not. |
java.lang.Boolean |
isTraversable(java.io.File f)
Whether the directory is traversable or not. |
void |
putDescription(java.io.File f,
java.lang.String fileDescription)
Adds a human readable description of the file. |
void |
putIcon(java.lang.String extension,
javax.swing.Icon icon)
Adds an icon based on the file type "dot" extension string, e.g: ".gif". |
void |
putTypeDescription(java.io.File f,
java.lang.String typeDescription)
Adds a human readable type description for files of the type of the passed in file. |
void |
putTypeDescription(java.lang.String extension,
java.lang.String typeDescription)
Adds a human readable type description for files. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PSFileView()
Method Detail |
public java.lang.String getName(java.io.File f)
getName
in class javax.swing.filechooser.FileView
getName(java.io.File)
public void putDescription(java.io.File f, java.lang.String fileDescription)
public java.lang.String getDescription(java.io.File f)
getDescription
in class javax.swing.filechooser.FileView
getDescription(java.io.File)
public void putTypeDescription(java.lang.String extension, java.lang.String typeDescription)
public void putTypeDescription(java.io.File f, java.lang.String typeDescription)
public java.lang.String getTypeDescription(java.io.File f)
getTypeDescription
in class javax.swing.filechooser.FileView
getTypeDescription(java.io.File)
public java.lang.String getExtension(java.io.File f)
public void putIcon(java.lang.String extension, javax.swing.Icon icon)
public javax.swing.Icon getIcon(java.io.File f)
getIcon
in class javax.swing.filechooser.FileView
getIcon(java.io.File)
public java.lang.Boolean isHidden(java.io.File f)
isHidden(java.io.File)
public java.lang.Boolean isTraversable(java.io.File f)
isTraversable
in class javax.swing.filechooser.FileView
isTraversable(java.io.File)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |