com.huguesjohnson.fileFilter
Class DirectoryFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by com.huguesjohnson.fileFilter.DirectoryFileFilter

public class DirectoryFileFilter
extends javax.swing.filechooser.FileFilter

DirectoryFileFilter - Filter to only accept directories in a JFileChooser JFileChooser has an option to only accept directories but it does not populate the description combo box

Author:
Hugues Johnson

Constructor Summary
DirectoryFileFilter()
          Creates a new instance of DirectoryFileFilter.
 
Method Summary
 boolean accept(java.io.File file)
          Tests if a file fits the filter defined in the constructor.
 java.lang.String getDescription()
          Returns the description of file accepted by the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryFileFilter

public DirectoryFileFilter()
Creates a new instance of DirectoryFileFilter.

Method Detail

accept

public boolean accept(java.io.File file)
Tests if a file fits the filter defined in the constructor.

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - The file to check.
Returns:
True if the file is a directory, false if it is not.

getDescription

public java.lang.String getDescription()
Returns the description of file accepted by the filter.

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
Description of files accepted by the current filter.