Class MultipleFileChooserPanel

    • Field Detail

      • m_FileChooser

        protected BaseFileChooser m_FileChooser
        the JFileChooser for selecting files.
      • m_FileChooserTitle

        protected String m_FileChooserTitle
        the title to use for the filechooser.
      • m_FileChooserTitleDefault

        protected String m_FileChooserTitleDefault
        the default filechooser title.
      • m_UseAbsolutePath

        protected boolean m_UseAbsolutePath
        whether to use absolute path rather than placeholders.
    • Constructor Detail

      • MultipleFileChooserPanel

        public MultipleFileChooserPanel()
        Initializes the panel with no file.
      • MultipleFileChooserPanel

        public MultipleFileChooserPanel​(String path)
        Initializes the panel with the given filename.
        Parameters:
        path - the filename to use
      • MultipleFileChooserPanel

        public MultipleFileChooserPanel​(String[] paths)
        Initializes the panel with the given filenames.
        Parameters:
        paths - the filenames to use
      • MultipleFileChooserPanel

        public MultipleFileChooserPanel​(File path)
        Initializes the panel with the given filename.
        Parameters:
        path - the filename to use
      • MultipleFileChooserPanel

        public MultipleFileChooserPanel​(File[] paths)
        Initializes the panel with the given filenames.
        Parameters:
        paths - the filenames to use
    • Method Detail

      • setFileChooserTitle

        public void setFileChooserTitle​(String value)
        Sets the title for the filechooser.
        Parameters:
        value - the title, null or empty string for default
      • getFileChooserTitle

        public String getFileChooserTitle()
        Returns the tile for the filechooser.
        Returns:
        the title, empty string for default
      • doChoose

        protected File[] doChoose()
        Performs the actual choosing of an object.
        Specified by:
        doChoose in class AbstractChooserPanel<File[]>
        Returns:
        the chosen objects or null if none chosen
      • toString

        public String toString​(File[] value,
                               boolean useAbsolutePath)
        Converts the value into its string representation.
        Parameters:
        value - the value to convert
        useAbsolutePath - whether to use the absolute path
        Returns:
        the generated string
      • toString

        protected String toString​(File[] value)
        Converts the value into its string representation.
        Specified by:
        toString in class AbstractChooserPanel<File[]>
        Parameters:
        value - the value to convert
        Returns:
        the generated string
      • fromString

        protected File[] fromString​(String value)
        Converts the string representation into its object representation.
        Specified by:
        fromString in class AbstractChooserPanel<File[]>
        Parameters:
        value - the string value to convert
        Returns:
        the generated object
      • isValid

        protected boolean isValid​(String value)
        Checks whether the string value is valid and can be parsed.
        Overrides:
        isValid in class AbstractChooserPanel<File[]>
        Parameters:
        value - the value to check
        Returns:
        true if valid
      • setUseAbsolutePath

        public void setUseAbsolutePath​(boolean value)
        Sets whether to use absolute paths.
        Specified by:
        setUseAbsolutePath in interface AbsolutePathSupporter
        Parameters:
        value - if true if absolute paths
      • getUseAbsolutePath

        public boolean getUseAbsolutePath()
        Returns whether to use absolute paths.
        Specified by:
        getUseAbsolutePath in interface AbsolutePathSupporter
        Returns:
        true if absolute paths
      • addChoosableFileFilter

        public void addChoosableFileFilter​(FileFilter value)
        Adds the given file filter to the filechooser.
        Parameters:
        value - the file filter to add
      • removeChoosableFileFilter

        public void removeChoosableFileFilter​(FileFilter value)
        Removes the specified file filter from the filechooser.
        Parameters:
        value - the file filter to remove
      • removeChoosableFileFilters

        public void removeChoosableFileFilters()
        Removes all file filters from the filechooser.
      • getChoosableFileFilters

        public FileFilter[] getChoosableFileFilters()
        Returns all choosable file filters.
        Returns:
        the current file filters
      • setAcceptAllFileFilterUsed

        public void setAcceptAllFileFilterUsed​(boolean value)
        Sets whether the "accept all files" filter is used.
        Parameters:
        value - if true then the filter will be used
      • isAcceptAllFileFilterUsed

        public boolean isAcceptAllFileFilterUsed()
        Returns whether the "accept all files" filter is used.
        Returns:
        true if the filter is used
      • setFileFilter

        public void setFileFilter​(FileFilter value)
        Sets the active file filter.
        Parameters:
        value - the file filter to select
      • getFileFilter

        public FileFilter getFileFilter()
        Returns the active file filter.
        Returns:
        the current file filter
      • setAutoAppendExtension

        public void setAutoAppendExtension​(boolean value)
        Sets whether to automatically append the currently selected file extension or the default one (if All-Filter is used).
        Parameters:
        value - if true, then the file extension will be added automatically
      • getAutoAppendExtension

        public boolean getAutoAppendExtension()
        Returns whether to automatically append the currently selected file extension or the default one (if All-Filter is used).
        Returns:
        true if the file extension will be added automatically
      • setDefaultExtension

        public void setDefaultExtension​(String value)
        Sets the default extension. Is used if m_AutoAppendExtension is true and the All-Filter is selected.
        Parameters:
        value - the extension (without dot), use null to unset
      • getDefaultExtension

        public String getDefaultExtension()
        Returns the default extension. Is used if m_AutoAppendExtension is true and the All-Filter is selected.
        Returns:
        the extension, can be null
      • setCurrentDirectory

        public void setCurrentDirectory​(File value)
        Sets the current directory to use for the file chooser.
        Parameters:
        value - the current directory
      • getCurrentDirectory

        public File getCurrentDirectory()
        Returns the current directory in use by the file chooser.
        Returns:
        the current directory
      • setCurrent

        public boolean setCurrent​(File[] value)
        Sets the current value.
        Overrides:
        setCurrent in class AbstractChooserPanel<File[]>
        Parameters:
        value - the value to use, can be null
        Returns:
        true if successfully set
      • toFiles

        protected static File[] toFiles​(String[] paths)
        Turns the string array into a Files one.
        Parameters:
        paths - the strings to convert
        Returns:
        the generated files