JAPI 0.9.0
Yet another Java API
API Documentation

net.sf.japi.util.filter.file
Class FilenameFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by net.sf.japi.util.filter.file.AbstractFileFilter
          extended by net.sf.japi.util.filter.file.FilenameFileFilter
All Implemented Interfaces:
FileFilter, Filter<File>

public final class FilenameFileFilter
extends AbstractFileFilter

Swing FileFilter implementation that filters files with specified names.

Author:
Christian Hujer
Todo:
find a convenient way for i18n/l10n of this class

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.japi.util.filter.Filter
Filter.Factory
 
Constructor Summary
FilenameFileFilter(boolean acceptDirectories, boolean negate, String description, String... names)
          Create a DFileFilter.
FilenameFileFilter(boolean acceptDirectories, String description, String... names)
          Create a DFileFilter.
 
Method Summary
 boolean accept(File pathname)
          Whether the given file is accepted by this filter.
 String getDescription()
          The description of this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilenameFileFilter

public FilenameFileFilter(boolean acceptDirectories,
                          String description,
                          String... names)
Create a DFileFilter. negate is set to false on this file filter.

Parameters:
acceptDirectories - pass true if this FileFilter should accept directories as well, false to deny directories
description - The description to use for swing
names - The names to accept

FilenameFileFilter

public FilenameFileFilter(boolean acceptDirectories,
                          boolean negate,
                          String description,
                          String... names)
Create a DFileFilter.

Parameters:
acceptDirectories - pass true if this FileFilter should accept directories as well, false to deny directories
negate - pass true if the names are to be negated, which means the filter will only accept files not names on one of the names; usually you want to pass false
description - The description to use for swing
names - The names to accept
Method Detail

getDescription

public String getDescription()
The description of this filter. For example: "JPG and GIF Images"

Specified by:
getDescription in class FileFilter
See Also:
FileView.getName(java.io.File)

accept

public boolean accept(File pathname)
Whether the given file is accepted by this filter.

Specified by:
accept in interface FileFilter
Specified by:
accept in interface Filter<File>
Specified by:
accept in class FileFilter
Parameters:
pathname - The abstract pathname to be tested
Returns:
true if and only if pathname should be included

JAPI
Yet another Java API
API Documentation

© 2005-2006 Christian Hujer. All rights reserved. See copyright