Package adams.terminal.dialog
Class DirectoryDialogBuilder
- java.lang.Object
-
- com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<DirectoryDialogBuilder,DirectoryDialog>
-
- adams.terminal.dialog.DirectoryDialogBuilder
-
public class DirectoryDialogBuilder extends com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<DirectoryDialogBuilder,DirectoryDialog>
Dialog builder for theDirectoryDialog
class, use this to create instances of that class and to customize them.- Author:
- Martin, FracPete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description DirectoryDialogBuilder()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DirectoryDialog
buildDialog()
String
getActionLabel()
Returns the label on the confirmation buttonFile
getSelectedDirectory()
Returns the directory that is initially selected in the dialogcom.googlecode.lanterna.TerminalSize
getSuggestedSize()
Returns the suggested size for the file dialogboolean
isShowHiddenDirectories()
Checks if hidden directories will be visible in the dialogprotected DirectoryDialogBuilder
self()
DirectoryDialogBuilder
setActionLabel(String actionLabel)
Defines the label to be but on the confirmation button (default: "ok").DirectoryDialogBuilder
setSelectedDirectory(File selectedDir)
Sets the directory that is initially selected in the dialogvoid
setShowHiddenDirectories(boolean showHiddenDirectories)
Sets if hidden directories should be visible in the dialog (default:false
DirectoryDialogBuilder
setSuggestedSize(com.googlecode.lanterna.TerminalSize suggestedSize)
Sets the suggested size for the file dialog, it won't have exactly this size but roughly.
-
-
-
Method Detail
-
buildDialog
protected DirectoryDialog buildDialog()
- Specified by:
buildDialog
in classcom.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<DirectoryDialogBuilder,DirectoryDialog>
-
setActionLabel
public DirectoryDialogBuilder setActionLabel(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 String getActionLabel()
Returns the label on the confirmation button- Returns:
- Label on the confirmation button
-
setSuggestedSize
public DirectoryDialogBuilder setSuggestedSize(com.googlecode.lanterna.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 com.googlecode.lanterna.TerminalSize getSuggestedSize()
Returns the suggested size for the file dialog- Returns:
- Suggested size for the file dialog
-
setSelectedDirectory
public DirectoryDialogBuilder setSelectedDirectory(File selectedDir)
Sets the directory that is initially selected in the dialog- Parameters:
selectedDir
- Directory that is initially selected in the dialog- Returns:
- Itself
-
getSelectedDirectory
public File getSelectedDirectory()
Returns the directory that is initially selected in the dialog- Returns:
- Directory that is initially selected in the dialog
-
setShowHiddenDirectories
public void setShowHiddenDirectories(boolean showHiddenDirectories)
Sets if hidden directories should be visible in the dialog (default:false
- Parameters:
showHiddenDirectories
- Iftrue
then hidden directories will be visible
-
isShowHiddenDirectories
public boolean isShowHiddenDirectories()
Checks if hidden directories will be visible in the dialog- Returns:
- If
true
then hidden directories will be visible
-
self
protected DirectoryDialogBuilder self()
- Specified by:
self
in classcom.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<DirectoryDialogBuilder,DirectoryDialog>
-
-