Class FileDialogBuilder


public class FileDialogBuilder extends AbstractDialogBuilder<FileDialogBuilder,FileDialog>
Dialog builder for the FileDialog class, use this to create instances of that class and to customize them
  • Field Details

    • actionLabel

      private String actionLabel
    • suggestedSize

      private TerminalSize suggestedSize
    • selectedFile

      private File selectedFile
    • showHiddenDirectories

      private boolean showHiddenDirectories
  • Constructor Details

    • FileDialogBuilder

      public FileDialogBuilder()
      Default constructor
  • Method Details

    • buildDialog

      protected FileDialog buildDialog()
      Description copied from class: AbstractDialogBuilder
      Builds the dialog according to the builder implementation
      Specified by:
      buildDialog in class AbstractDialogBuilder<FileDialogBuilder,FileDialog>
      Returns:
      New dialog object
    • setActionLabel

      public FileDialogBuilder setActionLabel(String actionLabel)
      Defines the label to be but on the confirmation button (default: "ok"). You probably want to set this to LocalizedString.Save.toString() or LocalizedString.Open.toString()
      Parameters:
      actionLabel - Label to put on the confirmation button
      Returns:
      Itself
    • getActionLabel

      public String getActionLabel()
      Returns the label on the confirmation button
      Returns:
      Label on the confirmation button
    • setSuggestedSize

      public FileDialogBuilder setSuggestedSize(TerminalSize suggestedSize)
      Sets the suggested size for the file dialog, it won't have exactly this size but roughly. Default suggested size is 45x10.
      Parameters:
      suggestedSize - Suggested size for the file dialog
      Returns:
      Itself
    • getSuggestedSize

      public TerminalSize getSuggestedSize()
      Returns the suggested size for the file dialog
      Returns:
      Suggested size for the file dialog
    • setSelectedFile

      public FileDialogBuilder setSelectedFile(File selectedFile)
      Sets the file that is initially selected in the dialog
      Parameters:
      selectedFile - File that is initially selected in the dialog
      Returns:
      Itself
    • getSelectedFile

      public File getSelectedFile()
      Returns the file that is initially selected in the dialog
      Returns:
      File that is initially selected in the dialog
    • setShowHiddenDirectories

      public void setShowHiddenDirectories(boolean showHiddenDirectories)
      Sets if hidden files and directories should be visible in the dialog (default: false
      Parameters:
      showHiddenDirectories - If true then hidden files and directories will be visible
    • isShowHiddenDirectories

      public boolean isShowHiddenDirectories()
      Checks if hidden files and directories will be visible in the dialog
      Returns:
      If true then hidden files and directories will be visible
    • self

      protected FileDialogBuilder self()
      Description copied from class: AbstractDialogBuilder
      Helper method for casting this to type parameter B
      Specified by:
      self in class AbstractDialogBuilder<FileDialogBuilder,FileDialog>
      Returns:
      this as B