net.sf.ext.helliker.id3
Class MP3FileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by net.sf.ext.helliker.id3.MP3FileFilter
All Implemented Interfaces:
java.io.FileFilter

public class MP3FileFilter
extends javax.swing.filechooser.FileFilter
implements java.io.FileFilter

This FileFilter only accepts files with a ".mp3" extension.

Version History:
2.0 - by gruni
-Slight optimization of getDescription()
-Fixed Bug #562622
2.0beta1 by gruni
-now developed by Andreas Grunewald
-Fully rewritten Code
-extends javax.swing.filechooser.FileFilter
1.2 - 2001.1019 by helliker
-All set for release.

Version:
2.0
Author:
Andreas Grunewald

Constructor Summary
MP3FileFilter()
          Create a default MP3FileFilter.
MP3FileFilter(boolean allowDirectories)
          Create an MP3FileFilter.
 
Method Summary
 boolean accept(java.io.File file)
          Determines whether or not the file is an mp3 file.
 java.lang.String getDescription()
          Returns the Name of the Filter for use in the Chooser Dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MP3FileFilter

public MP3FileFilter()
Create a default MP3FileFilter. The allowDirectories field will default to false.


MP3FileFilter

public MP3FileFilter(boolean allowDirectories)
Create an MP3FileFilter. If allowDirectories is true, then this filter will accept directories as well as mp3 files. If it is false then only mp3 files will be accepted.

Parameters:
allowDirectories - whether or not to accept directories
Method Detail

accept

public boolean accept(java.io.File file)
Determines whether or not the file is an mp3 file. If the file is a directory, whether or not is accepted depends upon the allowDirectories flag passed to the constructor.

Specified by:
accept in interface java.io.FileFilter
Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - the file to test
Returns:
true if this file or directory should be accepted

getDescription

public java.lang.String getDescription()
Returns the Name of the Filter for use in the Chooser Dialog

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
The Description of the Filter