Class FileBrowserSheet

    • Constructor Detail

      • FileBrowserSheet

        public FileBrowserSheet()
        Creates a new FileBrowserSheet

        Note that this version set by default mode to open and user home as root folder.

      • FileBrowserSheet

        public FileBrowserSheet​(FileBrowserSheet.Mode mode)
        Creates a new FileBrowserSheet

        Note that this version set by default the user home as root folder.

        Parameters:
        mode - The mode for opening the sheet.
        See Also:
        FileBrowserSheet.Mode
      • FileBrowserSheet

        public FileBrowserSheet​(java.lang.String rootFolder)
        Creates a new FileBrowserSheet

        Note that this version of the constructor can be used when a custom root folder has to be set, and uses the default mode.

        Parameters:
        rootFolder - The root folder full name.
      • FileBrowserSheet

        public FileBrowserSheet​(FileBrowserSheet.Mode mode,
                                java.lang.String rootFolder)
        Creates a new FileBrowserSheet

        Note that this version of the constructor must be used when a custom root folder has to be set.

        Parameters:
        mode - The mode for opening the sheet.
        rootFolder - The root folder full name.
        See Also:
        FileBrowserSheet.Mode
    • Method Detail

      • getRootDirectory

        public java.io.File getRootDirectory()
      • setRootFolder

        public void setRootFolder​(java.lang.String rootFolder)
        Set the root folder but without firing events.
        Parameters:
        rootFolder - The new root directory to browse.
        Throws:
        java.lang.IllegalArgumentException - if the folder argument is null.
      • setRootDirectory

        public void setRootDirectory​(java.io.File rootDirectory)
      • getSelectedFile

        public java.io.File getSelectedFile()
        When in single-select mode, returns the currently selected file.
        Returns:
        The currently selected file or null if nothing is selected.
        Throws:
        java.lang.IllegalStateException - if not in single-select mode.
      • setSelectedFile

        public void setSelectedFile​(java.io.File file)
        Sets the selection to a single file.
        Parameters:
        file - The single file to be selected or null to select nothing.
      • getSelectedFiles

        public ImmutableList<java.io.File> getSelectedFiles()
        Returns the currently selected files.
        Returns:
        An immutable list containing the currently selected files. Note that the returned list is a wrapper around the actual selection, not a copy. Any changes made to the selection state will be reflected in the list, but events will not be fired.
      • setSelectedFiles

        public Sequence<java.io.File> setSelectedFiles​(Sequence<java.io.File> selectedFiles)
        Sets the selected files.
        Parameters:
        selectedFiles - The files to select.
        Returns:
        The files that were selected, with duplicates eliminated.
        Throws:
        java.lang.IllegalArgumentException - if the selected files sequence is null or if the sequence is longer than one file and multi-select is not enabled, or if any entry is the sequence is null or whose parent is not the current root directory.
      • clearSelection

        public void clearSelection()
        Clears the selection.
      • getDisabledFileFilter

        public Filter<java.io.File> getDisabledFileFilter()
      • setDisabledFileFilter

        public void setDisabledFileFilter​(Filter<java.io.File> disabledFileFilter)