com.huguesjohnson.fileFilter
Class DirectoryFileFilter

java.lang.Object
  extended byjavax.swing.filechooser.FileFilter
      extended bycom.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)
          accept tests if a file fits the filter defined in the constructor.
 java.lang.String getDescription()
          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)
accept tests if a file fits the filter defined in the constructor.

Parameters:
file - file to check
Returns:
true if the file is a directory, false if it is not

getDescription

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

Returns:
description of files accepted by the current filter