monitor
Class XmlFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by monitor.XmlFileFilter

public class XmlFileFilter
extends javax.swing.filechooser.FileFilter

A FileFilter for the JFileChoosers: accepts xml file (.xml) only

Author:
Marco Furlan

Constructor Summary
XmlFileFilter()
           
 
Method Summary
 boolean accept(java.io.File f)
          Says whether a given file is allowed.
 java.lang.String getDescription()
          Gets the description for the text files
 java.lang.String getExtension(java.io.File f)
          Returns the extension of a given file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlFileFilter

public XmlFileFilter()
Method Detail

accept

public boolean accept(java.io.File f)
Says whether a given file is allowed. All directories and xml files (.xml) only are allowed

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
f - the file
Returns:
true if the file is allowed

getExtension

public java.lang.String getExtension(java.io.File f)
Returns the extension of a given file

Parameters:
f - the file
Returns:
the extension

getDescription

public java.lang.String getDescription()
Gets the description for the text files

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
the description