All Implemented Interfaces:
BasePane, Composite, Window

public class FileDialog extends DialogWindow
Dialog that allows the user to iterate the file system and pick file to open/save
  • Field Details

    • fileListBox

      private final ActionListBox fileListBox
    • directoryListBox

      private final ActionListBox directoryListBox
    • fileBox

      private final TextBox fileBox
    • okButton

      private final Button okButton
    • showHiddenFilesAndDirs

      private final boolean showHiddenFilesAndDirs
    • directory

      private File directory
    • selectedFile

      private File selectedFile
  • Constructor Details

    • FileDialog

      public FileDialog(String title, String description, String actionLabel, TerminalSize dialogSize, boolean showHiddenFilesAndDirs, File selectedObject)
      Default constructor for FileDialog
      Parameters:
      title - Title of the dialog
      description - Description of the dialog, is displayed at the top of the content area
      actionLabel - Label to use on the "confirm" button, for example "open" or "save"
      dialogSize - Rough estimation of how big you want the dialog to be
      showHiddenFilesAndDirs - If true, hidden files and directories will be visible
      selectedObject - Initially selected file node
  • Method Details

    • showDialog

      public File showDialog(WindowBasedTextGUI textGUI)
      Opens the dialog by showing it on the GUI and doesn't return until the dialog has been closed
      Overrides:
      showDialog in class DialogWindow
      Parameters:
      textGUI - Text GUI to add the dialog to
      Returns:
      The file which was selected in the dialog or null if the dialog was cancelled
    • reloadViews

      private void reloadViews(File directory)