public class FileFilter
extends javax.swing.filechooser.FileFilter
implements java.io.FilenameFilter, java.io.FileFilter
Modifier and Type | Field and Description |
---|---|
private boolean |
acceptDirectory
Indicates if directories are accepted
|
private boolean |
acceptHidden
Indicates if hidden files are accepted
|
private boolean |
acceptVirtualLink
Indicates if virtual links are accepted
|
private java.util.ArrayList<java.lang.String> |
extentions
Filtered extentions
|
private java.lang.String |
information
Filter informations
|
private java.io.FileFilter |
secondFileFilter
Second filter
|
Constructor and Description |
---|
FileFilter()
Constructs FileFilter
|
FileFilter(boolean acceptHidden,
boolean acceptVirtualLink)
Create a new instance of FileFilter
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File file)
Indicates if a file pass this filter
|
boolean |
accept(java.io.File dir,
java.lang.String name)
Indicates if a file pass this filter
|
void |
addExtension(java.lang.String extention)
Add an extention in the filter
|
static FileFilter |
createFilterForImage()
Create filter initialize to filter images
|
static FileFilter |
createFilterForImage(boolean acceptHidden,
boolean acceptVirtualLink)
Create a filter for image
|
java.lang.String |
filter()
Filter string
|
java.lang.String |
getDescription()
Filter description
|
java.lang.String |
getExtention(int index)
Get an extention in the filter
|
java.lang.String |
getInformation()
Return information
|
java.io.FileFilter |
getSecondFileFilter()
Return secondFileFilter
|
boolean |
isAcceptDirectory()
Indicates if directories are accepted
|
boolean |
isAnExtentionFiltered(java.lang.String extention)
Indicates if an extention is filter
|
boolean |
isFiltered(java.lang.String fileName)
Indicates if a file is filter
|
int |
numberOfExtentions()
Number of extentions
|
void |
removeExtention(java.lang.String extention)
Remove an extention
|
void |
setAcceptDirectory(boolean acceptDirectory)
Change the accept directories value
|
void |
setInformation(java.lang.String information)
Modify information
|
void |
setSecondFileFilter(java.io.FileFilter secondFileFilter)
Modify secondFileFilter
|
private boolean acceptDirectory
private final boolean acceptHidden
private final boolean acceptVirtualLink
private final java.util.ArrayList<java.lang.String> extentions
private java.lang.String information
private java.io.FileFilter secondFileFilter
public FileFilter()
public FileFilter(boolean acceptHidden, boolean acceptVirtualLink)
acceptHidden
- Indicates if hidden files are acceptedacceptVirtualLink
- Indicates if virtual links files are acceptedpublic static FileFilter createFilterForImage()
public static FileFilter createFilterForImage(boolean acceptHidden, boolean acceptVirtualLink)
acceptHidden
- Indicates if hidden files are acceptedacceptVirtualLink
- Indicates if virtual links are acceptedpublic boolean accept(java.io.File file)
accept
in interface java.io.FileFilter
accept
in class javax.swing.filechooser.FileFilter
file
- File testtrue
if the file passFileFilter.accept(java.io.File)
public boolean accept(java.io.File dir, java.lang.String name)
accept
in interface java.io.FilenameFilter
dir
- Directory pathname
- File nametrue
if the file pass this filterFilenameFilter.accept(java.io.File, java.lang.String)
public void addExtension(java.lang.String extention)
extention
- Extention addedpublic java.lang.String filter()
public java.lang.String getDescription()
getDescription
in class javax.swing.filechooser.FileFilter
FileFilter.getDescription()
public java.lang.String getExtention(int index)
index
- Extention indexpublic java.lang.String getInformation()
public java.io.FileFilter getSecondFileFilter()
public boolean isAcceptDirectory()
true
if directories are acceptedpublic boolean isAnExtentionFiltered(java.lang.String extention)
extention
- Extention testtrue
if the extention is filterpublic boolean isFiltered(java.lang.String fileName)
fileName
- File nametrue
if the file is filterpublic int numberOfExtentions()
public void removeExtention(java.lang.String extention)
extention
- Extension to removepublic void setAcceptDirectory(boolean acceptDirectory)
acceptDirectory
- Accept or not directoriespublic void setInformation(java.lang.String information)
information
- New information valuepublic void setSecondFileFilter(java.io.FileFilter secondFileFilter)
secondFileFilter
- New secondFileFilter value