Interface FileSelectionDialogBuilder

All Superinterfaces:
DialogBuilder<FileSelectionDialogBuilder>

public interface FileSelectionDialogBuilder extends DialogBuilder<FileSelectionDialogBuilder>
A builder for a file/directory selection dialog
  • Method Details

    • startDirectory

      FileSelectionDialogBuilder startDirectory(String startDirectory)
      Parameters:
      startDirectory - the start directory
      Returns:
      this builder instance
    • selectStartDirectory

      FileSelectionDialogBuilder selectStartDirectory(boolean selectStartDirectory)
      Parameters:
      selectStartDirectory - if true and a start directory is specified it is selected by default initially, false by default
      Returns:
      this builder instance
    • confirmOverwrite

      FileSelectionDialogBuilder confirmOverwrite(boolean confirmOverwrite)
      Parameters:
      confirmOverwrite - specifies whether overwriting a file should be confirmed, true by default
      Returns:
      this builder instance
    • fileFilter

      FileSelectionDialogBuilder fileFilter(FileFilter fileFilter)
      Parameters:
      fileFilter - the file filter to add, only applicable to file selection
      Returns:
      this builder instance
    • selectFile

      File selectFile()
      Returns:
      the selected file
      Throws:
      CancelException - in case the user cancels
    • selectFiles

      List<File> selectFiles()
      Returns:
      the selected files
      Throws:
      CancelException - in case the user cancels
    • selectDirectory

      File selectDirectory()
      Returns:
      the selected directory
      Throws:
      CancelException - in case the user cancels
    • selectDirectories

      List<File> selectDirectories()
      Returns:
      the selected directories
      Throws:
      CancelException - in case the user cancels
    • selectFileOrDirectory

      File selectFileOrDirectory()
      Returns:
      the selected file or directory
      Throws:
      CancelException - in case the user cancels
    • selectFilesOrDirectories

      List<File> selectFilesOrDirectories()
      Returns:
      a List containing the selected files, contains at least one file
      Throws:
      CancelException - in case the user cancels or no files are selected
    • selectFileToSave

      File selectFileToSave()
      Returns:
      the selected file
      Throws:
      CancelException - in case the user cancels
    • selectFileToSave

      File selectFileToSave(String defaultFileName)
      Parameters:
      defaultFileName - the default file name
      Returns:
      the selected file
      Throws:
      CancelException - in case the user cancels