|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.filechooser.FileFilter
biggests.utils.FileFilterExtension
public class FileFilterExtension
Title: File Filter by extension.
Description: Defines a file filter which filters the files which are shown to and can be selected by the user in a file chooser dialog. Valid files are chosen according to a pecific file extension.
Copyright: Copyright (C) 2007 Joana Gonçalves This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
| Constructor Summary | |
|---|---|
FileFilterExtension(java.lang.String extension)
Creates a new extension file filter, to filter files based on their extensions. |
|
| Method Summary | |
|---|---|
boolean |
accept(java.io.File file)
Checks if a certain file is acceptable under the filter conditions. |
java.lang.String |
checkAndAddFileExtension(java.lang.String filePath)
Checks if filePath has the required file
extension on it. |
java.lang.String |
getDescription()
Returns the description of this file filter. |
java.lang.String |
getValidFileExtension()
Returns this file filter valid file extension. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileFilterExtension(java.lang.String extension)
throws java.lang.Exception
extension - the String file extension to be filtered
java.lang.Exception - when the file extension is not valid| Method Detail |
|---|
public boolean accept(java.io.File file)
true if file is accepted, or
false otherwise.
accept in class javax.swing.filechooser.FileFilterfile - the File to check
boolean which is true if the file
is accepted or false otherwisepublic java.lang.String getDescription()
getDescription in class javax.swing.filechooser.FileFilterString description of this file filterpublic java.lang.String getValidFileExtension()
String valid file extension for this file filterpublic java.lang.String checkAndAddFileExtension(java.lang.String filePath)
filePath has the required file
extension on it. If not, adds the file extension to the
path and returns the new path.
filePath - String the file path to check
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||