Class FileDialog

  • 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 Detail

      • fileBox

        private final TextBox fileBox
      • okButton

        private final Button okButton
      • showHiddenFilesAndDirs

        private final boolean showHiddenFilesAndDirs
      • directory

        private java.io.File directory
      • selectedFile

        private java.io.File selectedFile
    • Constructor Detail

      • FileDialog

        public FileDialog​(java.lang.String title,
                          java.lang.String description,
                          java.lang.String actionLabel,
                          TerminalSize dialogSize,
                          boolean showHiddenFilesAndDirs,
                          java.io.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 Detail

      • showDialog

        public java.io.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​(java.io.File directory)