JAPI 0_6-alpha-2
Yet another Java API
API Documentation

net.sf.japi.swing
Class EndingFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by net.sf.japi.swing.EndingFileFilter

public class EndingFileFilter
extends FileFilter

Swing FileFilter implementation that filters files with specified endings.

Author:
Christian Hujer
Todo:
find a convenient way for i18n/l10n of this class, option to ignore case, provide regex file filter which checks against multiple regular expressions

Constructor Summary
EndingFileFilter(boolean acceptDirectories, boolean negate, String description, String... endings)
          Create an EndingFileFilter.
EndingFileFilter(boolean acceptDirectories, String description, String... endings)
          Create an EndingFileFilter.
 
Method Summary
 boolean accept(File file)
          
 String getDescription()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndingFileFilter

public EndingFileFilter(boolean acceptDirectories,
                        String description,
                        String... endings)
Create an EndingFileFilter. 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
endings - The endings to accept, including their period Example: new EndingFileFilter(false, "jpeg image files", ".jpg", ".jpeg", ".jfif")

EndingFileFilter

public EndingFileFilter(boolean acceptDirectories,
                        boolean negate,
                        String description,
                        String... endings)
Create an EndingFileFilter.

Parameters:
acceptDirectories - pass true if this FileFilter should accept directories as well, false to deny directories
negate - pass true if the endings are to be negated, which means the filter will only accept files not ending on one of the endings; usually you want to pass false
description - The description to use for swing
endings - The endings to accept, including their period Example: new EndingFileFilter(false, true, "all files but jpeg image files", ".jpg", ".jpeg", ".jfif")
Method Detail

getDescription

public final String getDescription()

Specified by:
getDescription in class FileFilter

accept

public boolean accept(File file)

Specified by:
accept in class FileFilter

JAPI
Yet another Java API
API Documentation

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