|
VdexReload 1.1.3 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.filechooser.FileFilter
uk.ac.reload.dweezil.gui.ReloadFileFilter
A convenience implementation of FileFilter that filters out all files except for those type extensions that it knows about. Extensions are of the type ".foo", which is typically found on Windows and Unix boxes, but not on Macintosh. Case is ignored. Example - create a new filter that filters out all files but gif and jpg image files: JFileChooser chooser = new JFileChooser(); ToomolFileFilter filter = new ToomolFileFilter( new String{"gif", "jpg"}, "JPEG & GIF Images") chooser.addChoosableFileFilter(filter); chooser.showOpenDialog(this);
Constructor Summary | |
ReloadFileFilter()
Creates a file filter. |
|
ReloadFileFilter(java.lang.String extension)
Creates a file filter that accepts files with the given extension. |
|
ReloadFileFilter(java.lang.String[] filters)
Creates a file filter from the given string array. |
|
ReloadFileFilter(java.lang.String[] filters,
java.lang.String description)
Creates a file filter from the given string array and description. |
|
ReloadFileFilter(java.lang.String extension,
java.lang.String description)
Creates a file filter that accepts the given file type. |
Method Summary | |
boolean |
accept(java.io.File f)
Return true if this file should be shown in the directory pane, false if it shouldn't. |
void |
addExtension(java.lang.String extension)
Adds a filetype "dot" extension to filter against. |
java.lang.String |
getDescription()
Returns the human readable description of this filter. |
java.lang.String |
getExtension(java.io.File f)
Return the extension portion of the file's name . |
boolean |
isExtensionListInDescription()
Returns whether the extension list (.jpg, .gif, etc) should show up in the human readable description. |
void |
setDescription(java.lang.String description)
Sets the human readable description of this filter. |
void |
setExtensionListInDescription(boolean b)
Determines whether the extension list (.jpg, .gif, etc) should show up in the human readable description. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ReloadFileFilter()
addExtension(java.lang.String)
public ReloadFileFilter(java.lang.String extension)
extension
- the given file extensionaddExtension(java.lang.String)
public ReloadFileFilter(java.lang.String extension, java.lang.String description)
extension
- the given file extensiondescription
- the given file descriptionaddExtension(java.lang.String)
public ReloadFileFilter(java.lang.String[] filters)
filters
- the given string array from which a file filter is createdaddExtension(java.lang.String)
public ReloadFileFilter(java.lang.String[] filters, java.lang.String description)
filters
- the given string array from which a file filter is createddescription
- the given file descriptionaddExtension(java.lang.String)
Method Detail |
public boolean accept(java.io.File f)
f
- the given filegetExtension(java.io.File)
,
FileFilter.accept(java.io.File)
public java.lang.String getExtension(java.io.File f)
f
- the given filegetExtension(java.io.File)
,
FileFilter.accept(java.io.File)
public void addExtension(java.lang.String extension)
extension
- the given file extensionpublic java.lang.String getDescription()
setDescription(java.lang.String)
,
setExtensionListInDescription(boolean)
,
isExtensionListInDescription()
public void setDescription(java.lang.String description)
description
- the human readable description of this filtersetDescription(java.lang.String)
,
setExtensionListInDescription(boolean)
,
isExtensionListInDescription()
public void setExtensionListInDescription(boolean b)
b
- true if the extension list should be shown up in the human
readable description, false otherwisegetDescription()
,
setDescription(java.lang.String)
,
isExtensionListInDescription()
public boolean isExtensionListInDescription()
getDescription()
,
setDescription(java.lang.String)
,
setExtensionListInDescription(boolean)
|
VdexReload 1.1.3 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |