jmri.util
Class FileChooserFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by jmri.util.FileChooserFilter
Direct Known Subclasses:
NoArchiveFileFilter

public class FileChooserFilter
extends FileFilter

Allow selection of possible files by their extension.

As a convenience, if no extension(s) are specified, all files pass.

Except in that case, files without extensions fail.

Author:
Alex Shepherd

Constructor Summary
FileChooserFilter(String pDescription)
           
 
Method Summary
 boolean accept(File f)
           
 void addExtension(String ext)
           
 String getDescription()
           
static String getFileExtension(File f)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileChooserFilter

public FileChooserFilter(String pDescription)
Method Detail

addExtension

public void addExtension(String ext)

getFileExtension

public static String getFileExtension(File f)

getDescription

public String getDescription()
Specified by:
getDescription in class FileFilter

accept

public boolean accept(File f)
Specified by:
accept in class FileFilter


Copyright © 1997 - 2010 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads