com.jaxfront.core.util.io
Class FileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by com.jaxfront.core.util.io.FileFilter
All Implemented Interfaces:
java.io.FileFilter

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

A FileFilter, once implemented, can be set on a File to keep unwanted files from appearing in the directory listing. As the name suggest this class would list only xsd-files. For example:

    File file = new File();
    File[] files = file.lastFile(new XSDFilter());
 
Note that this class can also be used for open dialog or save dialog

Version:
1.60
See Also:
FileFilter

Constructor Summary
FileFilter(java.lang.String suffix, java.lang.String description)
          Creates an instance of XSDFilter
FileFilter(java.lang.String suffix, java.lang.String description, boolean acceptsDirectory)
           
 
Method Summary
 boolean accept(java.io.File f)
          Returns Whether the given file is accepted by this filter.
 java.lang.String getDescription()
          The description of this filter.
 java.lang.String getSuffix()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileFilter

public FileFilter(java.lang.String suffix,
                  java.lang.String description)
Creates an instance of XSDFilter


FileFilter

public FileFilter(java.lang.String suffix,
                  java.lang.String description,
                  boolean acceptsDirectory)
Method Detail

accept

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

Specified by:
accept in interface java.io.FileFilter
Specified by:
accept in class javax.swing.filechooser.FileFilter
Returns:
boolean true, if the given file is accepted by this filter

getDescription

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

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

getSuffix

public java.lang.String getSuffix()