Package jmri.util

Class NoArchiveFileFilter


  • public class NoArchiveFileFilter
    extends javax.swing.filechooser.FileFilter
    File filter to suppress zip file archives.

    Java 1.6's FileChooser gets slow when it encounters large zip files. This filter skips them, while still allowing you to specify others, etc.

    • Constructor Summary

      Constructors 
      Constructor Description
      NoArchiveFileFilter()
      Create a filter that excludes .zip and .jar files.
      NoArchiveFileFilter​(java.lang.String description)
      Create a filter that excludes .zip and .jar files.
      NoArchiveFileFilter​(java.lang.String description, java.lang.String... extensions)
      Create a filter that filters for the specified extensions, excluding .zip and .jar files.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(java.io.File f)
      Do not display .zip or .jar files in file chooser.
      java.lang.String getDescription()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NoArchiveFileFilter

        public NoArchiveFileFilter()
        Create a filter that excludes .zip and .jar files.
      • NoArchiveFileFilter

        public NoArchiveFileFilter​(java.lang.String description)
        Create a filter that excludes .zip and .jar files.
        Parameters:
        description - The filter description presented in a file chooser
      • NoArchiveFileFilter

        public NoArchiveFileFilter​(java.lang.String description,
                                   java.lang.String... extensions)
        Create a filter that filters for the specified extensions, excluding .zip and .jar files.
        Parameters:
        description - The filter description presented in a file chooser
        extensions - The extensions to accept; if no extensions are passed, all files except archives are accepted; to accept a limited set of extensions and files without an extension, include an empty String as an extension
    • Method Detail

      • accept

        public boolean accept​(java.io.File f)
        Do not display .zip or .jar files in file chooser. Allows directories to be selected.
        Specified by:
        accept in class javax.swing.filechooser.FileFilter
      • getDescription

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