genopt.io
Class GenOptFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by genopt.io.GenOptFileFilter

public class GenOptFileFilter
extends javax.swing.filechooser.FileFilter

Object for filtering initialization files in the JFileChooser object

This project was carried out at:

and supported by

GenOpt Copyright (c) 1998-2011, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.

Version:
GenOpt(R) 3.1.0 (December 8, 2011)

Author:
Michael Wetter

Field Summary
private  java.lang.String des
          textual description of the files
(package private)  java.util.Hashtable<java.lang.String,GenOptFileFilter> fil
          the Hashtable with the filter entries
 
Constructor Summary
GenOptFileFilter()
          Constructor
GenOptFileFilter(java.lang.String extension, java.lang.String description)
          Constructor
 
Method Summary
 boolean accept(java.io.File f)
          returns true if a file is accepted for display, or false otherwise
 void addExtension(java.lang.String ext)
          adds an extension to this file filter
 java.lang.String getDescription()
          gets the human readable description
static java.lang.String getExtension(java.io.File f)
           
 void setDescription(java.lang.String description)
          adds the human readable description
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fil

java.util.Hashtable<java.lang.String,GenOptFileFilter> fil
the Hashtable with the filter entries


des

private java.lang.String des
textual description of the files

Constructor Detail

GenOptFileFilter

public GenOptFileFilter()
Constructor


GenOptFileFilter

public GenOptFileFilter(java.lang.String extension,
                        java.lang.String description)
Constructor

Parameters:
extension - file extension
description - file description
Method Detail

accept

public boolean accept(java.io.File f)
returns true if a file is accepted for display, or false otherwise

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
f - File to be checked
Returns:
true if it should be displayed, false otherwise

getExtension

public static java.lang.String getExtension(java.io.File f)

addExtension

public void addExtension(java.lang.String ext)
adds an extension to this file filter

Parameters:
ext - extension to be added

setDescription

public void setDescription(java.lang.String description)
adds the human readable description


getDescription

public java.lang.String getDescription()
gets the human readable description

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