EDU.utwente.CoCompose.util
Class DirFileFilter

java.lang.Object
  extended byjavax.swing.filechooser.FileFilter
      extended byEDU.utwente.CoCompose.util.DirFileFilter
All Implemented Interfaces:
java.io.FileFilter

public class DirFileFilter
extends javax.swing.filechooser.FileFilter
implements java.io.FileFilter

FileFilter for filtering directories and files.

Version:
0.1.10, 22 July 2003
Author:
Dennis Wagelaar

Constructor Summary
DirFileFilter(java.lang.String endsWith)
          Constructs a DirFileFileFilter.
 
Method Summary
 boolean accept(java.io.File f)
          Whether the given file is accepted by this filter.
 boolean getAcceptDirs()
          Gets the acceptDirs attribute.
 boolean getAcceptFiles()
          Gets the acceptFiles attribute.
 java.lang.String getDescription()
          The description of this filter.
 java.lang.String getEndsWith()
          Gets the file extension to check on.
 void setAcceptDirs(boolean acceptDirs)
          Sets the acceptDirs attribute.
 void setAcceptFiles(boolean acceptFiles)
          Sets the acceptFiles attribute.
 void setEndsWith(java.lang.String endsWith)
          Sets the file extension to check on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirFileFilter

public DirFileFilter(java.lang.String endsWith)
Constructs a DirFileFileFilter.

Parameters:
endsWith - The file extension including dot (e.g. ".xml").
Method Detail

getAcceptDirs

public boolean getAcceptDirs()
Gets the acceptDirs attribute.

Returns:
Whether to accept directories.

setAcceptDirs

public void setAcceptDirs(boolean acceptDirs)
Sets the acceptDirs attribute.

Parameters:
acceptDirs - Whether to accept directories.

getAcceptFiles

public boolean getAcceptFiles()
Gets the acceptFiles attribute.

Returns:
Whether to accept XML files.

setAcceptFiles

public void setAcceptFiles(boolean acceptFiles)
Sets the acceptFiles attribute.

Parameters:
acceptFiles - Whether to accept XML files.

getEndsWith

public java.lang.String getEndsWith()
Gets the file extension to check on.

Returns:
The file extension including dot (e.g. ".xml").

setEndsWith

public void setEndsWith(java.lang.String endsWith)
Sets the file extension to check on.

Parameters:
endsWith - The file extension including dot (e.g. ".xml").

accept

public boolean accept(java.io.File f)
Whether the given file is accepted by this filter.

Specified by:
accept in interface java.io.FileFilter
Parameters:
f - The file/path to check.
Returns:
True if and only if the file f should be accepted.

getDescription

public java.lang.String getDescription()
The description of this filter.

Returns:
The description.