javazoom.jlgui.player.amp.util

Class FileNameFilter

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 String
default_extension
protected String
description
protected java.util.List
extensions

Constructor Summary

FileNameFilter(String ext, String description)
Constructs the list of extensions out of a string of comma-separated elements, each of which represents one extension.
FileNameFilter(String ext, String description, boolean allowDir)

Method Summary

boolean
accept(File dir)
determines if the filename is an acceptable one.
String
getDefaultExtension()
Returns the default extension.
String
getDescription()
void
setDefaultExtension(String ext)

Field Details

allowDir

protected boolean allowDir

default_extension

protected String default_extension

description

protected String description

extensions

protected java.util.List extensions

Constructor Details

FileNameFilter

public FileNameFilter(String ext,
                      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(String ext,
                      String description,
                      boolean allowDir)

Method Details

accept

public boolean accept(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.
Parameters:
dir - the directory the file is in
Returns:
true if the filename has a valid extension, false otherwise

getDefaultExtension

public String getDefaultExtension()
Returns the default extension.
Returns:
the default extension

getDescription

public String getDescription()

setDefaultExtension

public void setDefaultExtension(String ext)

JavaZOOM 1999-2006