javazoom.jlgui.player.amp.util
Class FileNameFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by 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.


Field Summary
protected  boolean allowDir
           
protected  java.lang.String default_extension
           
protected  java.lang.String description
           
protected  java.util.List extensions
           
 
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)
           
 
Method Summary
 boolean accept(java.io.File dir)
          determines if the filename is an acceptable one.
 java.lang.String getDefaultExtension()
          Returns the default extension.
 java.lang.String getDescription()
           
 void setDefaultExtension(java.lang.String ext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extensions

protected java.util.List extensions

default_extension

protected java.lang.String default_extension

description

protected java.lang.String description

allowDir

protected boolean allowDir
Constructor Detail

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)
Method Detail

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