be.ugent.caagt.swirl.actions

Class ExtensionFileFilter


public class ExtensionFileFilter
extends FileFilter

Implements a Swing file filter that filters files on extensions.

Constructor Summary

ExtensionFileFilter(String extension, String description)
Creates a file filter which only allows files with the given extension.

Method Summary

boolean
accept(File file)
File
ensureExtension(File original)
Returns the given file with the extension of this filter added, if the file has no extension.
String
getDescription()

Constructor Details

ExtensionFileFilter

public ExtensionFileFilter(String extension,
                           String description)
Creates a file filter which only allows files with the given extension. (Case is ignored when doing the comparison.)
Parameters:
extension - Extension which is to be allowed
description - Description for this filter

Method Details

accept

public boolean accept(File file)

ensureExtension

public File ensureExtension(File original)
Returns the given file with the extension of this filter added, if the file has no extension.

getDescription

public String getDescription()