Class FileDialog
java.lang.Object
com.googlecode.lanterna.gui2.AbstractBasePane<Window>
com.googlecode.lanterna.gui2.AbstractWindow
com.googlecode.lanterna.gui2.dialogs.DialogWindow
com.googlecode.lanterna.gui2.dialogs.FileDialog
Dialog that allows the user to iterate the file system and pick file to open/save
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static classprivate classprivate classNested classes/interfaces inherited from class AbstractBasePane
AbstractBasePane.ContentHolderNested classes/interfaces inherited from interface Window
Window.Hint -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Fileprivate final ActionListBoxprivate final TextBoxprivate final ActionListBoxprivate final Buttonprivate Fileprivate final booleanFields inherited from class AbstractBasePane
contentHolder, interactableLookupMap -
Constructor Summary
ConstructorsConstructorDescriptionFileDialog(String title, String description, String actionLabel, TerminalSize dialogSize, boolean showHiddenFilesAndDirs, File selectedObject) Default constructor forFileDialog -
Method Summary
Modifier and TypeMethodDescriptionprivate voidreloadViews(File directory) showDialog(WindowBasedTextGUI textGUI) Opens the dialog by showing it on the GUI and doesn't return until the dialog has been closedMethods inherited from class AbstractWindow
addWindowListener, close, draw, fromGlobal, fromGlobalToContentRelative, fromGlobalToDecoratedRelative, getDecoratedSize, getHints, getPosition, getPostRenderer, getPreferredSize, getSize, getTextGUI, getTitle, handleInput, isVisible, removeWindowListener, setCloseWindowWithEscape, setContentOffset, setDecoratedSize, setFixedSize, setHints, setPosition, setSize, setTextGUI, setTitle, setVisible, setWindowPostRenderer, toGlobal, toGlobalFromContentRelative, toGlobalFromDecoratedRelative, waitUntilClosedMethods inherited from class AbstractBasePane
addBasePaneListener, getBasePaneListeners, getComponent, getCursorPosition, getFocusedInteractable, getMenuBar, getTheme, invalidate, isInvalid, removeBasePaneListener, setComponent, setEnableDirectionBasedMovements, setFocusedInteractable, setFocusedInteractable, setMenuBar, setStrictFocusChange, setThemeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BasePane
getTheme, setEnableDirectionBasedMovements, setStrictFocusChange, setThemeMethods inherited from interface Window
getBounds, getComponent, getCursorPosition, getFocusedInteractable, getMenuBar, invalidate, isInvalid, setComponent, setFocusedInteractable, setMenuBar
-
Field Details
-
fileListBox
-
directoryListBox
-
fileBox
-
okButton
-
showHiddenFilesAndDirs
private final boolean showHiddenFilesAndDirs -
directory
-
selectedFile
-
-
Constructor Details
-
FileDialog
public FileDialog(String title, String description, String actionLabel, TerminalSize dialogSize, boolean showHiddenFilesAndDirs, File selectedObject) Default constructor forFileDialog- Parameters:
title- Title of the dialogdescription- Description of the dialog, is displayed at the top of the content areaactionLabel- Label to use on the "confirm" button, for example "open" or "save"dialogSize- Rough estimation of how big you want the dialog to beshowHiddenFilesAndDirs- Iftrue, hidden files and directories will be visibleselectedObject- Initially selected file node
-
-
Method Details
-
showDialog
Opens the dialog by showing it on the GUI and doesn't return until the dialog has been closed- Overrides:
showDialogin classDialogWindow- Parameters:
textGUI- Text GUI to add the dialog to- Returns:
- The file which was selected in the dialog or
nullif the dialog was cancelled
-
reloadViews
-