Public Member Functions | Private Attributes | List of all members
com.generalrobotix.ui.view.tdview.ExampleFileFilter Class Reference
Inheritance diagram for com.generalrobotix.ui.view.tdview.ExampleFileFilter:
Inheritance graph
[legend]

Public Member Functions

boolean accept (File f)
 
void addExtension (String extension)
 
 ExampleFileFilter ()
 
 ExampleFileFilter (String extension)
 
 ExampleFileFilter (String extension, String description)
 
 ExampleFileFilter (String[] filters)
 
 ExampleFileFilter (String[] filters, String description)
 
String getDescription ()
 
String getExtension (File f)
 
boolean isExtensionListInDescription ()
 
void setDescription (String description)
 
void setExtensionListInDescription (boolean b)
 

Private Attributes

String description = null
 
Hashtable< String, ExampleFileFilterfilters = null
 
String fullDescription = null
 
boolean useExtensionsInDescription = true
 

Detailed Description

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 Macinthosh. Case is ignored.

Example - create a new filter that filerts out all files but gif and jpg image files: proces JFileChooser chooser = new JFileChooser(); ExampleFileFilter filter = new ExampleFileFilter( new String{"gif", "jpg"}, "JPEG & GIF Images") chooser.addChoosableFileFilter(filter); chooser.showOpenDialog(this);

Version
1.9 04/23/99
Author
Jeff Dinkins

Definition at line 67 of file ExampleFileFilter.java.

Constructor & Destructor Documentation

com.generalrobotix.ui.view.tdview.ExampleFileFilter.ExampleFileFilter ( )
inline

Creates a file filter. If no filters are added, then all files are accepted.

See also
addExtension

Definition at line 83 of file ExampleFileFilter.java.

com.generalrobotix.ui.view.tdview.ExampleFileFilter.ExampleFileFilter ( String  extension)
inline

Creates a file filter that accepts files with the given extension. Example: new ExampleFileFilter("jpg");

See also
addExtension

Definition at line 93 of file ExampleFileFilter.java.

com.generalrobotix.ui.view.tdview.ExampleFileFilter.ExampleFileFilter ( String  extension,
String  description 
)
inline

Creates a file filter that accepts the given file type. Example: new ExampleFileFilter("jpg", "JPEG Image Images");

Note that the "." before the extension is not needed. If provided, it will be ignored.

See also
addExtension

Definition at line 106 of file ExampleFileFilter.java.

com.generalrobotix.ui.view.tdview.ExampleFileFilter.ExampleFileFilter ( String[]  filters)
inline

Creates a file filter from the given string array. Example: new ExampleFileFilter(String {"gif", "jpg"});

Note that the "." before the extension is not needed adn will be ignored.

See also
addExtension

Definition at line 121 of file ExampleFileFilter.java.

com.generalrobotix.ui.view.tdview.ExampleFileFilter.ExampleFileFilter ( String[]  filters,
String  description 
)
inline

Creates a file filter from the given string array and description. Example: new ExampleFileFilter(String {"gif", "jpg"}, "Gif and JPG Images");

Note that the "." before the extension is not needed and will be ignored.

See also
addExtension

Definition at line 133 of file ExampleFileFilter.java.

Member Function Documentation

boolean com.generalrobotix.ui.view.tdview.ExampleFileFilter.accept ( File  f)
inline

Return true if this file should be shown in the directory pane, false if it shouldn't.

Files that begin with "." are ignored.

See also
getExtension
FileFilter::accepts

Definition at line 151 of file ExampleFileFilter.java.

void com.generalrobotix.ui.view.tdview.ExampleFileFilter.addExtension ( String  extension)
inline

Adds a filetype "dot" extension to filter against.

For example: the following code will create a filter that filters out all files except those that end in ".jpg" and ".tif":

ExampleFileFilter filter = new ExampleFileFilter(); filter.addExtension("jpg"); filter.addExtension("tif");

Note that the "." before the extension is not needed and will be ignored.

Definition at line 193 of file ExampleFileFilter.java.

String com.generalrobotix.ui.view.tdview.ExampleFileFilter.getDescription ( )
inline

Returns the human readable description of this filter. For example: "JPEG and GIF Image Files (*.jpg, *.gif)"

See also
setDescription
setExtensionListInDescription
isExtensionListInDescription
FileFilter::getDescription

Definition at line 211 of file ExampleFileFilter.java.

String com.generalrobotix.ui.view.tdview.ExampleFileFilter.getExtension ( File  f)
inline

Return the extension portion of the file's name .

See also
getExtension
FileFilter::accept

Definition at line 170 of file ExampleFileFilter.java.

boolean com.generalrobotix.ui.view.tdview.ExampleFileFilter.isExtensionListInDescription ( )
inline

Returns whether the extension list (.jpg, .gif, etc) should show up in the human readable description.

Only relevent if a description was provided in the constructor or using setDescription();

See also
getDescription
setDescription
setExtensionListInDescription

Definition at line 271 of file ExampleFileFilter.java.

void com.generalrobotix.ui.view.tdview.ExampleFileFilter.setDescription ( String  description)
inline

Sets the human readable description of this filter. For example: filter.setDescription("Gif and JPG Images");

See also
setDescription
setExtensionListInDescription
isExtensionListInDescription

Definition at line 239 of file ExampleFileFilter.java.

void com.generalrobotix.ui.view.tdview.ExampleFileFilter.setExtensionListInDescription ( boolean  b)
inline

Determines whether the extension list (.jpg, .gif, etc) should show up in the human readable description.

Only relevent if a description was provided in the constructor or using setDescription();

See also
getDescription
setDescription
isExtensionListInDescription

Definition at line 255 of file ExampleFileFilter.java.

Member Data Documentation

String com.generalrobotix.ui.view.tdview.ExampleFileFilter.description = null
private

Definition at line 73 of file ExampleFileFilter.java.

Hashtable<String, ExampleFileFilter> com.generalrobotix.ui.view.tdview.ExampleFileFilter.filters = null
private

Definition at line 72 of file ExampleFileFilter.java.

String com.generalrobotix.ui.view.tdview.ExampleFileFilter.fullDescription = null
private

Definition at line 74 of file ExampleFileFilter.java.

boolean com.generalrobotix.ui.view.tdview.ExampleFileFilter.useExtensionsInDescription = true
private

Definition at line 75 of file ExampleFileFilter.java.


The documentation for this class was generated from the following file:


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat May 8 2021 02:42:44