- java.lang.Object
-
- javax.swing.filechooser.FileView
-
- javax.swing.plaf.basic.BasicFileChooserUI.BasicFileView
-
- Enclosing class:
- BasicFileChooserUI
protected class BasicFileChooserUI.BasicFileView extends FileView
A basic file view.
-
-
Constructor Summary
Constructors Constructor Description BasicFileView()
Constructs aBasicFileView
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cacheIcon(File f, Icon i)
Caches an icon for a file.void
clearIconCache()
Clears the icon cache.Icon
getCachedIcon(File f)
Returns the cached icon for the file.String
getDescription(File f)
A human readable description of the file.Icon
getIcon(File f)
The icon that represents this file in theJFileChooser
.String
getName(File f)
The name of the file.String
getTypeDescription(File f)
A human readable description of the type of the file.Boolean
isHidden(File f)
Returns whether or not a file is hidden.-
Methods inherited from class javax.swing.filechooser.FileView
isTraversable
-
-
-
-
Method Detail
-
clearIconCache
public void clearIconCache()
Clears the icon cache.
-
getName
public String getName(File f)
The name of the file. Normally this would be simplyf.getName()
.
-
getDescription
public String getDescription(File f)
A human readable description of the file. For example, a file named jag.jpg might have a description that read: "A JPEG image file of James Gosling's face".- Overrides:
getDescription
in classFileView
- Parameters:
f
- aFile
object- Returns:
- a
String
containing a description of the file ornull
if it is not available.
-
getTypeDescription
public String getTypeDescription(File f)
A human readable description of the type of the file. For example, ajpg
file might have a type description of: "A JPEG Compressed Image File"- Overrides:
getTypeDescription
in classFileView
- Parameters:
f
- aFile
object- Returns:
- a
String
containing a description of the type of the file ornull
if it is not available .
-
getCachedIcon
public Icon getCachedIcon(File f)
Returns the cached icon for the file.- Parameters:
f
- the file- Returns:
- the cached icon for the file
-
cacheIcon
public void cacheIcon(File f, Icon i)
Caches an icon for a file.- Parameters:
f
- the filei
- the icon
-
-