public class EZFileFilter extends FileFilter implements FileFilter, FilenameFilter
Constructor and Description |
---|
EZFileFilter()
Creates a file filter.
|
EZFileFilter(String extension)
Creates a file filter that accepts files with the given extension.
|
EZFileFilter(String[] filters)
Creates a file filter from the given string array.
|
EZFileFilter(String[] filters,
String description)
Creates a file filter from the given string array and description.
|
EZFileFilter(String extension,
String description)
Creates a file filter that accepts the given file type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(File f)
Returns true if this file should be shown in the directory panel,
false if it should not be shown.
|
boolean |
accept(File dir,
String name) |
void |
addExtension(String extension)
Adds a file extension to this filter.
|
String |
getDescription()
Returns the description of this filter.
|
static String |
getExtension(File f)
Returns the extension portion of the file name.
|
static String |
getWithoutExtension(File f)
Gets the file name without its extension.
|
boolean |
isExtensionListInDescription() |
void |
setDescription(String description)
Sets the description of this filter.
|
void |
setExtensionListInDescription(boolean b)
Figures out whether or not the extension list (.jpg, .gif, etc) should
show up in the description.
|
public EZFileFilter()
public EZFileFilter(String extension)
extension
- the file extension. Example: use jpg instead of .jpg .public EZFileFilter(String extension, String description)
public EZFileFilter(String[] filters)
public boolean accept(File f)
accept
in interface FileFilter
accept
in class FileFilter
public boolean accept(File dir, String name)
accept
in interface FilenameFilter
public static String getExtension(File f)
public static String getWithoutExtension(File f)
public void addExtension(String extension)
public String getDescription()
getDescription
in class FileFilter
public void setDescription(String description)
public void setExtensionListInDescription(boolean b)
public boolean isExtensionListInDescription()
Plealog Software - 2003-2017