public class GenOptFileFilter
extends javax.swing.filechooser.FileFilter
This project was carried out at:
and supported byGenOpt Copyright (c) 1998-2021, 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.
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
GenOptFileFilter()
Constructor
|
GenOptFileFilter(java.lang.String extension,
java.lang.String description)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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
|
java.util.Hashtable<java.lang.String,GenOptFileFilter> fil
private java.lang.String des
public GenOptFileFilter()
public GenOptFileFilter(java.lang.String extension, java.lang.String description)
extension
- file extensiondescription
- file descriptionpublic boolean accept(java.io.File f)
true
if a file is accepted for display,
or false
otherwiseaccept
in class javax.swing.filechooser.FileFilter
f
- File to be checkedtrue
if it should be displayed,
false
otherwisepublic static java.lang.String getExtension(java.io.File f)
public void addExtension(java.lang.String ext)
ext
- extension to be addedpublic void setDescription(java.lang.String description)
public java.lang.String getDescription()
getDescription
in class javax.swing.filechooser.FileFilter