hypercast.util
Class TypeBased_FileFilter

java.lang.Object
  |
  +--javax.swing.filechooser.FileFilter
        |
        +--hypercast.util.TypeBased_FileFilter

public class TypeBased_FileFilter
extends javax.swing.filechooser.FileFilter

This class implements a file filter in which file extensions are defined. It can be used by a file chooser to open a file with specified type or extension.


Constructor Summary
TypeBased_FileFilter()
          Constructor.
 
Method Summary
 boolean accept(java.io.File file)
          Check if the given file should be shown in the file chooser pane.
 void addFileType(java.lang.String fileType)
          Adds a file type (or file extension) into this filter.
 java.lang.String getDescription()
          Gets the description string on the file types of this filter.
 java.lang.String getFileType(java.io.File file)
          Return the type or extension portion of the file's name .
 void setDescription(java.lang.String description)
          Sets the description on the file types that is displayed in the file chooser pane to help user to choose files.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeBased_FileFilter

public TypeBased_FileFilter()
Constructor. If It creates a file filter that accepts all files (no filter).

Method Detail

accept

public boolean accept(java.io.File file)
Check if the given file should be shown in the file chooser pane. Return true if it is defined in this file filter; false otherwise.

Specified by:
accept in class javax.swing.filechooser.FileFilter

getDescription

public java.lang.String getDescription()
Gets the description string on the file types of this filter.

Specified by:
getDescription in class javax.swing.filechooser.FileFilter

getFileType

public java.lang.String getFileType(java.io.File file)
Return the type or extension portion of the file's name .


addFileType

public void addFileType(java.lang.String fileType)
Adds a file type (or file extension) into this filter.


setDescription

public void setDescription(java.lang.String description)
Sets the description on the file types that is displayed in the file chooser pane to help user to choose files.