com.jaxfront.swing.ui.editor
Class XMLFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by com.jaxfront.swing.ui.editor.XMLFilter
All Implemented Interfaces:
java.io.FileFilter

public class XMLFilter
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 xml-files. For example:

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

Version:
1.60
See Also:
FileFilter

Constructor Summary
XMLFilter()
          Creates an instance of XMLFilter
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLFilter

public XMLFilter()
Creates an instance of XMLFilter

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:
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)