javazoom.jlgui.player.amp.util
Class FileNameFilter
java.lang.Object
javax.swing.filechooser.FileFilter
javazoom.jlgui.player.amp.util.FileNameFilter
- All Implemented Interfaces:
- java.io.FileFilter
public class FileNameFilter
- extends javax.swing.filechooser.FileFilter
- implements java.io.FileFilter
FileName filter that works for both javax.swing.filechooser and java.io.
Constructor Summary |
FileNameFilter(java.lang.String ext,
java.lang.String description)
Constructs the list of extensions out of a string of comma-separated
elements, each of which represents one extension. |
FileNameFilter(java.lang.String ext,
java.lang.String description,
boolean allowDir)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
extensions
protected java.util.List extensions
default_extension
protected java.lang.String default_extension
description
protected java.lang.String description
allowDir
protected boolean allowDir
FileNameFilter
public FileNameFilter(java.lang.String ext,
java.lang.String description)
- Constructs the list of extensions out of a string of comma-separated
elements, each of which represents one extension.
- Parameters:
ext
- the list of comma-separated extensions
FileNameFilter
public FileNameFilter(java.lang.String ext,
java.lang.String description,
boolean allowDir)
accept
public boolean accept(java.io.File dir)
- determines if the filename is an acceptable one. If a
filename ends with one of the extensions the filter was
initialized with, then the function returns true. if not,
the function returns false.
- Specified by:
accept
in interface java.io.FileFilter
- Specified by:
accept
in class javax.swing.filechooser.FileFilter
- Parameters:
dir
- the directory the file is in
- Returns:
- true if the filename has a valid extension, false otherwise
getDefaultExtension
public java.lang.String getDefaultExtension()
- Returns the default extension.
- Returns:
- the default extension
setDefaultExtension
public void setDefaultExtension(java.lang.String ext)
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in class javax.swing.filechooser.FileFilter
JavaZOOM 1999-2006