com.bluemarsh.jswat.action
Class JSwatFileFilter
java.lang.Object
|
+--javax.swing.filechooser.FileFilter
|
+--com.bluemarsh.jswat.action.JSwatFileFilter
- public class JSwatFileFilter
- extends javax.swing.filechooser.FileFilter
Class to implement a FileFilter to allow only supported
source files in the JFileChooser. Note that this FileFilter
is the com.sun.java.swing.filechooser.FileFilter and not
the java.io.FileFilter.
- Author:
- Marko van Dooren
Constructor Summary |
JSwatFileFilter(java.lang.String extension,
java.lang.String description)
Initialize a new JSwatFileFilter with the given extension
and description. |
Method Summary |
boolean |
accept(java.io.File pathname)
Tests whether or not the specified abstract pathname should
be included in a pathname list. |
java.lang.String |
getDescription()
Returns the description of this JSwatFileFilter. |
java.lang.String |
getExtension()
Return the extensions of this JSwatFileFilter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JSwatFileFilter
public JSwatFileFilter(java.lang.String extension,
java.lang.String description)
- Initialize a new JSwatFileFilter with the given extension
and description.
- Parameters:
extension
- the extension of the new JSwatFileFilter.description
- description for the file type of the new
JSwatFileFilter.
accept
public boolean accept(java.io.File pathname)
- Tests whether or not the specified abstract pathname should
be included in a pathname list.
- Overrides:
accept
in class javax.swing.filechooser.FileFilter
- Parameters:
pathname
- The pathname to be tested.- Returns:
- true if the pathname should be included.
getDescription
public java.lang.String getDescription()
- Returns the description of this JSwatFileFilter.
- Overrides:
getDescription
in class javax.swing.filechooser.FileFilter
- Returns:
- string representation of this JSwatFileFilter.
getExtension
public java.lang.String getExtension()
- Return the extensions of this JSwatFileFilter.