TV-Browser 3.3.3 API

util.ui
Class ExtensionFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by util.ui.ExtensionFileFilter
All Implemented Interfaces:
java.io.FilenameFilter

public class ExtensionFileFilter
extends javax.swing.filechooser.FileFilter
implements java.io.FilenameFilter

A file filter that allows to specify a set of extension for determining, whether a file should be shown.

Author:
Til Schneider, www.murfman.de

Constructor Summary
ExtensionFileFilter(java.lang.String[] extenstionList, java.lang.String name)
          Creates a new instance of ExtensionFileFilter.
ExtensionFileFilter(java.lang.String extension, java.lang.String name)
          Creates a new instance of ExtensionFileFilter.
 
Method Summary
 boolean accept(java.io.File file)
          Returns whether this given File is accepted by this filter.
 boolean accept(java.io.File dir, java.lang.String name)
          Returns whether this given File is accepted by this filter.
 java.lang.String getDescription()
          Gets the localized name of this filter.
 java.lang.String getExtension()
           
 java.lang.String toString()
          Gets the localized name of this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtensionFileFilter

public ExtensionFileFilter(java.lang.String extension,
                           java.lang.String name)
Creates a new instance of ExtensionFileFilter.

Parameters:
extension - The file extension this filter should let pass.
name - The localized name for this filter.

ExtensionFileFilter

public ExtensionFileFilter(java.lang.String[] extenstionList,
                           java.lang.String name)
Creates a new instance of ExtensionFileFilter.

Parameters:
extenstionList - The file extensions this filter should let pass.
name - The localized name for this filter.
Method Detail

toString

public java.lang.String toString()
Gets the localized name of this filter.

Overrides:
toString in class java.lang.Object
Returns:
the localized name of this filter.

accept

public boolean accept(java.io.File file)
Returns whether this given File is accepted by this filter.

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - The file to check.
Returns:
whether the specified file is accepted.

getDescription

public java.lang.String getDescription()
Gets the localized name of this filter.

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
the localized name of this filter.

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Returns whether this given File is accepted by this filter.

Specified by:
accept in interface java.io.FilenameFilter
Parameters:
dir - The directory of the file to check.
name - The name of the file to check.
Returns:
whether the specified file is accepted.

getExtension

public java.lang.String getExtension()

TV-Browser 3.3.3 API

TV-Browser 3.3.3, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)