Class EresseaFileFilter


  • public class EresseaFileFilter
    extends javax.swing.filechooser.FileFilter
    A FileFilter extension for Eressea file types
    • Constructor Summary

      Constructors 
      Constructor Description
      EresseaFileFilter​(int flag)
      Creates a new EresseaFileFilter object.
      EresseaFileFilter​(java.lang.String ext, java.lang.String desc)
      Creates a new EresseaFileFilter object.
      EresseaFileFilter​(java.util.List<java.lang.String> ext, java.lang.String desc)
      Creates a new EresseaFileFilter object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(java.io.File f)
      Returns true iff this file is accepted by this filter.
      java.io.File addExtension​(java.io.File aFile)
      Append an appropriate extension to a file.
      java.lang.String getDescription()
      Returns the current description.
      protected java.lang.String getDescription​(int flag)
      Returns the description for the flag.
      int getType()  
      • Methods inherited from class java.lang.Object

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

      • TXT_FILTER

        @Deprecated
        public static final int TXT_FILTER
        Deprecated.
        replaced by TXT_ORDERS_FILTER
        Selects .txt-files
        See Also:
        Constant Field Values
      • ALLCR_FILTER

        public static final int ALLCR_FILTER
        Selects .cr, .zip, .gz, and .bz2-files
        See Also:
        Constant Field Values
      • ALLCR_COMPRESSED_FILTER

        public static final int ALLCR_COMPRESSED_FILTER
        Selects .zip, .gz, and .bz2-files (but not .cr)
        See Also:
        Constant Field Values
      • TXT_ORDERS_FILTER

        public static final int TXT_ORDERS_FILTER
        Selects .txt-files
        See Also:
        Constant Field Values
      • ANY_TXT_FILTER

        public static final int ANY_TXT_FILTER
        Selects .txt-files
        See Also:
        Constant Field Values
      • description

        protected java.lang.String description
      • flag

        protected int flag
    • Constructor Detail

      • EresseaFileFilter

        public EresseaFileFilter​(int flag)
        Creates a new EresseaFileFilter object.
        Parameters:
        flag - One of the FILTER-flags
      • EresseaFileFilter

        public EresseaFileFilter​(java.lang.String ext,
                                 java.lang.String desc)
        Creates a new EresseaFileFilter object.
        Parameters:
        ext - Only files with this extension will be accepted by this filter
        desc - A description to identify for this filter
      • EresseaFileFilter

        public EresseaFileFilter​(java.util.List<java.lang.String> ext,
                                 java.lang.String desc)
        Creates a new EresseaFileFilter object.
        Parameters:
        ext - A List of Strings. Only files with these extensions will be accepted by this filter
        desc - A description to identify for this filter
    • Method Detail

      • addExtension

        public java.io.File addExtension​(java.io.File aFile)
        Append an appropriate extension to a file.
        Parameters:
        aFile -
        Returns:
        A File with the filename extended by the current extension
      • accept

        public boolean accept​(java.io.File f)
        Returns true iff this file is accepted by this filter.
        Specified by:
        accept in class javax.swing.filechooser.FileFilter
        Parameters:
        f - Any File
        Returns:
        true iff this file is accepted
      • getDescription

        public java.lang.String getDescription()
        Returns the current description.
        Specified by:
        getDescription in class javax.swing.filechooser.FileFilter
        Returns:
        The description of this filter
      • getDescription

        protected java.lang.String getDescription​(int flag)
        Returns the description for the flag.
        Parameters:
        flag -
        Returns:
        The appropriate description
      • getType

        public int getType()
        Returns:
        the appropriate FILTER_... flag if this filter is one of the default types.