fr.ove.utils
Class GenericFileFilter

java.lang.Object
  extended byjavax.swing.filechooser.FileFilter
      extended byfr.ove.utils.GenericFileFilter

public class GenericFileFilter
extends javax.swing.filechooser.FileFilter

A file filter for the specified extension.


Constructor Summary
GenericFileFilter()
          The default constructor.
GenericFileFilter(java.lang.String type, java.lang.String extension)
          The constructor.
 
Method Summary
 boolean accept(java.io.File file)
          Whether the given file is accepted by this filter.
 java.lang.String getDescription()
          The description of this filter.
 java.lang.String getExtension()
          Gets the file extension.
 java.lang.String getType()
          Gets the file type.
 void setExtension(java.lang.String extension)
          Sets the file extension.
 void setType(java.lang.String type)
          Sets the file type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericFileFilter

public GenericFileFilter()
The default constructor. Builds a text files (with a txt extension) filter.


GenericFileFilter

public GenericFileFilter(java.lang.String type,
                         java.lang.String extension)
The constructor.

Parameters:
type - the file type (e.g. Text, JPEG, etc).
extension - the file extension (e.g. txt, jpeg, etc).
Method Detail

setType

public void setType(java.lang.String type)
Sets the file type.

Parameters:
type - the file type (e.g. Text, JPEG, etc).

getType

public java.lang.String getType()
Gets the file type.


setExtension

public void setExtension(java.lang.String extension)
Sets the file extension.

Parameters:
extension - the file extension (e.g. txt, jpeg, etc);

getExtension

public java.lang.String getExtension()
Gets the file extension.


accept

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

Parameters:
file - the given file.

getDescription

public java.lang.String getDescription()
The description of this filter.



Copyright © 1999-2007 Universit?© de Nice Sophia-Antipolis, I3S, Ove SARL, DFKI and Universit?§t des Saarlandes. All Rights Reserved.