Class TLcyFileTypeDescriptor


public class TLcyFileTypeDescriptor extends ALcyFileTypeDescriptor
Implementation of ALcyFileTypeDescriptor that allows a list of valid extensions. A filename is accepted if it ends with one of the extensions, the default extension is the first given extension, and the displayname is appended with (*.ext1, *.ext2, ... )
  • Constructor Details

    • TLcyFileTypeDescriptor

      public TLcyFileTypeDescriptor(String aDisplayName, String[] aExtensions)
      Creates a new TLcyFileTypeDescriptor with the given display name and extensions.
      aDisplayName - The display name for this descriptor.
      aExtensions - The list of valid extensions, where the first extension is used as the default extension. The extensions do not include the dot (.)
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Returns the previously set display name appended with (*.ext1, *.ext2, ..., *.extN) where ext1 ... extN are the associated extensions.
      Specified by:
      getDisplayName in class ALcyFileTypeDescriptor
      The display name appended with the known extensions.
    • setDisplayName

      public void setDisplayName(String aDisplayName)
      Sets the display name to be used.
      aDisplayName - The new display name.
    • getExtensionCount

      public int getExtensionCount()
      Returns the number of associated extensions.
      the number of associated extensions.
    • getDefaultExtension

      public String getDefaultExtension()
      Returns the first extension of the associated list of extensions.
      Specified by:
      getDefaultExtension in class ALcyFileTypeDescriptor
      the first extension of the associated list of extensions.
    • getExtension

      public String getExtension(int aIndex)
      Returns the extension at the given index.
      aIndex - The index to retrieve the extension for.
      The extension at index aIndex.
    • includes

      public boolean includes(String aFileName)
      Returns true if the given filename ends with '.ext1' or '.ext2' or ... or '.extN'. Where ext1 ... extN are the associated extensions.
      Specified by:
      includes in class ALcyFileTypeDescriptor
      aFileName - The filename to test.
      True if the filename is correct, false otherwise.