JHotDraw 7.4.1

org.jhotdraw.io
Class ExtensionFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by org.jhotdraw.io.ExtensionFileFilter

public class ExtensionFileFilter
extends javax.swing.filechooser.FileFilter

Filters files by their extensions.

Version:
$Id: ExtensionFileFilter.java 604 2010-01-09 12:00:29Z rawcoder $
Author:
Werner Randelshofer

Constructor Summary
ExtensionFileFilter(java.lang.String description, java.lang.String extension)
          Creates a new instance.
ExtensionFileFilter(java.lang.String description, java.lang.String[] extensions)
          Creates a new instance.
 
Method Summary
 boolean accept(java.io.File pathname)
           
 java.lang.String getDescription()
           
 java.util.Set<java.lang.String> getExtensions()
          Returns an unmodifiable set with the filename extensions.
 java.io.File makeAcceptable(java.io.File pathname)
          Appends the extension to the filename, in case it is missing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionFileFilter

public ExtensionFileFilter(java.lang.String description,
                           java.lang.String extension)
Creates a new instance.

Parameters:
description - A human readable description.
extension - The filename extension. This will be converted to lower-case by this method.

ExtensionFileFilter

public ExtensionFileFilter(java.lang.String description,
                           java.lang.String[] extensions)
Creates a new instance.

Parameters:
description - A human readable description.
extensions - The filename extensions. These will be converted to lower-case by this method.
Method Detail

getExtensions

public java.util.Set<java.lang.String> getExtensions()
Returns an unmodifiable set with the filename extensions. All extensions are lower case.


accept

public boolean accept(java.io.File pathname)
Specified by:
accept in class javax.swing.filechooser.FileFilter

makeAcceptable

public java.io.File makeAcceptable(java.io.File pathname)
Appends the extension to the filename, in case it is missing.


getDescription

public java.lang.String getDescription()
Specified by:
getDescription in class javax.swing.filechooser.FileFilter

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.