Class AwtDialogFileFilter
java.lang.Object
javax.swing.filechooser.FileFilter
jspecview.java.AwtDialogFileFilter
A implementation of the
FileFilter that filters out all files
except those with extensions that are added.- Author:
- Debbie-Ann Facey, Khari A. Bryan, Prof Robert J. Lancashire
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionIntialises aJSpecViewFileFilterAwtDialogFileFilter(String[] filters) Initialises theJSpecViewFileFilterwith an list of extensions to filterAwtDialogFileFilter(String[] filters, String description) Initialises theJSpecViewFileFilterwith an list of extensions to filter and a description of the filter -
Method Summary
Modifier and TypeMethodDescriptionbooleanImplementation of method from interfaceFileFilter.voidaddExtension(String extension) Adds an extension to the JSpecViewFileFilterReturns the JSpecViewFileFilter descriptiongetExtension(File f) Returns the extension of a filevoidsetDescription(String description) Sets the description for the JSpecViewFileFilter
-
Constructor Details
-
AwtDialogFileFilter
public AwtDialogFileFilter()Intialises aJSpecViewFileFilter -
AwtDialogFileFilter
Initialises theJSpecViewFileFilterwith an list of extensions to filter- Parameters:
filters- aStringof filters
-
AwtDialogFileFilter
-
-
Method Details
-
accept
Implementation of method from interfaceFileFilter.- Specified by:
acceptin classFileFilter- Parameters:
f- the the file to be filtered- Returns:
- true if the file should be shown, otherwise false
-
getExtension
-
addExtension
Adds an extension to the JSpecViewFileFilter- Parameters:
extension- the extension
-
getDescription
Returns the JSpecViewFileFilter description- Specified by:
getDescriptionin classFileFilter- Returns:
- the JSpecViewFileFilter description
-
setDescription
Sets the description for the JSpecViewFileFilter- Parameters:
description- the description
-