- java.lang.Object
-
- com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<FileDialogBuilder,FileDialog>
-
- com.googlecode.lanterna.gui2.dialogs.FileDialogBuilder
-
public class FileDialogBuilder extends AbstractDialogBuilder<FileDialogBuilder,FileDialog>
Dialog builder for theFileDialogclass, use this to create instances of that class and to customize them
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringactionLabelprivate java.io.FileselectedFileprivate booleanshowHiddenDirectoriesprivate TerminalSizesuggestedSize-
Fields inherited from class com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder
description, extraWindowHints, title
-
-
Constructor Summary
Constructors Constructor Description FileDialogBuilder()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FileDialogbuildDialog()Builds the dialog according to the builder implementationjava.lang.StringgetActionLabel()Returns the label on the confirmation buttonjava.io.FilegetSelectedFile()Returns the file that is initially selected in the dialogTerminalSizegetSuggestedSize()Returns the suggested size for the file dialogbooleanisShowHiddenDirectories()Checks if hidden files and directories will be visible in the dialogprotected FileDialogBuilderself()Helper method for casting this totypeparameterBFileDialogBuildersetActionLabel(java.lang.String actionLabel)Defines the label to be but on the confirmation button (default: "ok").FileDialogBuildersetSelectedFile(java.io.File selectedFile)Sets the file that is initially selected in the dialogvoidsetShowHiddenDirectories(boolean showHiddenDirectories)Sets if hidden files and directories should be visible in the dialog (default:falseFileDialogBuildersetSuggestedSize(TerminalSize suggestedSize)Sets the suggested size for the file dialog, it won't have exactly this size but roughly.-
Methods inherited from class com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder
build, getDescription, getExtraWindowHints, getTitle, setDescription, setExtraWindowHints, setTitle
-
-
-
-
Field Detail
-
actionLabel
private java.lang.String actionLabel
-
suggestedSize
private TerminalSize suggestedSize
-
selectedFile
private java.io.File selectedFile
-
showHiddenDirectories
private boolean showHiddenDirectories
-
-
Method Detail
-
buildDialog
protected FileDialog buildDialog()
Description copied from class:AbstractDialogBuilderBuilds the dialog according to the builder implementation- Specified by:
buildDialogin classAbstractDialogBuilder<FileDialogBuilder,FileDialog>- Returns:
- New dialog object
-
setActionLabel
public FileDialogBuilder setActionLabel(java.lang.String actionLabel)
Defines the label to be but on the confirmation button (default: "ok"). You probably want to set this toLocalizedString.Save.toString()orLocalizedString.Open.toString()- Parameters:
actionLabel- Label to put on the confirmation button- Returns:
- Itself
-
getActionLabel
public java.lang.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(java.io.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 java.io.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- Iftruethen 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
truethen hidden files and directories will be visible
-
self
protected FileDialogBuilder self()
Description copied from class:AbstractDialogBuilderHelper method for casting this totypeparameterB- Specified by:
selfin classAbstractDialogBuilder<FileDialogBuilder,FileDialog>- Returns:
thisasB
-
-