kiyut.citra 3.7

kiyut.citra.io
Class DefaultFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by kiyut.citra.io.DefaultFileFilter
Direct Known Subclasses:
ImageFileFilter

public class DefaultFileFilter
extends FileFilter

Defaulft File Filter

Author:
Kiyut

Field Summary
protected  String description
           
protected  List<String> filters
           
protected  String fullDescription
           
protected static String HIDDEN_FILE
           
protected static String TYPE_UNKNOWN
           
protected  boolean useExtensionsInDescription
           
 
Constructor Summary
DefaultFileFilter()
           
 
Method Summary
 boolean accept(File f)
           
 void addExtension(String extension)
          Adds a filetype "dot" extension to filter against.
 String getDescription()
           Returns the human readable description of this filter.
 String getExtension(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(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
 

Field Detail

TYPE_UNKNOWN

protected static final String TYPE_UNKNOWN
See Also:
Constant Field Values

HIDDEN_FILE

protected static final String HIDDEN_FILE
See Also:
Constant Field Values

filters

protected List<String> filters

description

protected String description

fullDescription

protected String fullDescription

useExtensionsInDescription

protected boolean useExtensionsInDescription
Constructor Detail

DefaultFileFilter

public DefaultFileFilter()
Method Detail

accept

public boolean accept(File f)
Specified by:
accept in class FileFilter

getExtension

public String getExtension(File f)
Return the extension portion of the file's name .

See Also:
getExtension(java.io.File), accept(java.io.File)

addExtension

public void addExtension(String extension)
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.


getDescription

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

Specified by:
getDescription in class FileFilter
Returns:
description
See Also:
setDescription(java.lang.String), setExtensionListInDescription(boolean), isExtensionListInDescription()

setDescription

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

See Also:
setDescription(java.lang.String), setExtensionListInDescription(boolean), isExtensionListInDescription()

setExtensionListInDescription

public void setExtensionListInDescription(boolean b)
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(java.lang.String), isExtensionListInDescription()

isExtensionListInDescription

public boolean isExtensionListInDescription()
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(java.lang.String), setExtensionListInDescription(boolean)

kiyut.citra 3.7