ui.util
Class FileExtensionFilter

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

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


Constructor Summary
FileExtensionFilter(java.lang.String extension)
           
FileExtensionFilter(java.lang.String extension, java.lang.String description)
           
 
Method Summary
 boolean accept(java.io.File file)
           
 boolean accept(java.io.File file, java.lang.String extension)
           
 java.lang.String getDescription()
           
 java.lang.String getDottedExtension()
          This method just adds a DOT to the extension and returns it.
 java.lang.String getExtension()
           
 void setDescription(java.lang.String description)
           
 boolean validExtension(java.lang.String extension)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileExtensionFilter

public FileExtensionFilter(java.lang.String extension)
Parameters:
extension - The file's extension;

FileExtensionFilter

public FileExtensionFilter(java.lang.String extension,
                           java.lang.String description)
Parameters:
extension - The file's extension;
description - The file extension's description.
Method Detail

accept

public boolean accept(java.io.File file,
                      java.lang.String extension)
Specified by:
accept in interface java.io.FilenameFilter

validExtension

public boolean validExtension(java.lang.String extension)

getExtension

public java.lang.String getExtension()
Returns:
Returns the extension.

getDottedExtension

public java.lang.String getDottedExtension()
This method just adds a DOT to the extension and returns it.

Returns:
Returns the dotted extension, eg. ".jpeg" or ".xml".

accept

public boolean accept(java.io.File file)
Specified by:
accept in class javax.swing.filechooser.FileFilter

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in class javax.swing.filechooser.FileFilter

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - The description to set.


Copyright © 2006 SF.net. All Rights Reserved.