javax.swing.plaf.basic

Class BasicFileChooserUI.BasicFileView

protected class BasicFileChooserUI.BasicFileView extends FileView

Provides presentation information about files and directories.
Field Summary
protected Hashtable<File,Icon>iconCache
Storage for cached icons.
Constructor Summary
BasicFileView()
Creates a new instance.
Method Summary
voidcacheIcon(File f, Icon i)
Adds an icon to the cache, associating it with the given file/directory.
voidclearIconCache()
Clears the icon cache.
IcongetCachedIcon(File f)
Retrieves the icon associated with the specified file/directory, if there is one.
StringgetDescription(File f)
Returns a description of the given file/directory.
IcongetIcon(File f)
Returns an icon appropriate for the given file or directory.
StringgetName(File f)
Returns the name for the given file/directory.
StringgetTypeDescription(File f)
Returns a localised description for the type of file/directory.
BooleanisHidden(File f)
Returns {@link Boolean#TRUE} if the given file/directory is hidden, and {@link Boolean#FALSE} otherwise.

Field Detail

iconCache

protected Hashtable<File,Icon> iconCache
Storage for cached icons.

Constructor Detail

BasicFileView

public BasicFileView()
Creates a new instance.

Method Detail

cacheIcon

public void cacheIcon(File f, Icon i)
Adds an icon to the cache, associating it with the given file/directory.

Parameters: f the file/directory. i the icon.

clearIconCache

public void clearIconCache()
Clears the icon cache.

getCachedIcon

public Icon getCachedIcon(File f)
Retrieves the icon associated with the specified file/directory, if there is one.

Parameters: f the file/directory.

Returns: The cached icon (or null).

getDescription

public String getDescription(File f)
Returns a description of the given file/directory. In this implementation, the description is the same as the name returned by {@link #getName(File)}.

Parameters: f the file/directory.

Returns: A description of the given file/directory.

getIcon

public Icon getIcon(File f)
Returns an icon appropriate for the given file or directory.

Parameters: f the file/directory.

Returns: An icon.

getName

public String getName(File f)
Returns the name for the given file/directory.

Parameters: f the file/directory.

Returns: The name of the file/directory.

getTypeDescription

public String getTypeDescription(File f)
Returns a localised description for the type of file/directory.

Parameters: f the file/directory.

Returns: A type description for the given file/directory.

isHidden

public Boolean isHidden(File f)
Returns {@link Boolean#TRUE} if the given file/directory is hidden, and {@link Boolean#FALSE} otherwise.

Parameters: f the file/directory.

Returns: {@link Boolean#TRUE} or {@link Boolean#FALSE}.