Module com.googlecode.lanterna
Class TextInputDialogBuilder
java.lang.Object
com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<TextInputDialogBuilder,TextInputDialog>
com.googlecode.lanterna.gui2.dialogs.TextInputDialogBuilder
public class TextInputDialogBuilder
extends AbstractDialogBuilder<TextInputDialogBuilder,TextInputDialog>
Dialog builder for the
TextInputDialog
class, use this to create instances of that class and to customize
them-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private boolean
private TerminalSize
private TextInputDialogResultValidator
Fields inherited from class com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder
description, extraWindowHints, title
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TextInputDialog
Builds the dialog according to the builder implementationReturns the initial content the dialog will haveReturns the size of the text box the dialog will haveReturns the validator that will be attached to the text box in the dialogboolean
Returnstrue
if the text box the dialog will have contains a password and should be maskedprotected TextInputDialogBuilder
self()
Helper method for casting this totype
parameterB
setInitialContent
(String initialContent) Sets the initial content the dialog will havesetPasswordInput
(boolean passwordInput) Sets if the text box the dialog will have contains a password and should be masked (default:false
)setTextBoxSize
(TerminalSize textBoxSize) Sets the size of the text box the dialog will havesetValidationPattern
(Pattern pattern, String errorMessage) Helper method that assigned a validator to the text box the dialog will have which matches the pattern suppliedsetValidator
(TextInputDialogResultValidator validator) Sets the validator that will be attached to the text box in the dialogMethods inherited from class com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder
build, getDescription, getExtraWindowHints, getTitle, setDescription, setExtraWindowHints, setTitle
-
Field Details
-
initialContent
-
textBoxSize
-
validator
-
passwordInput
private boolean passwordInput
-
-
Constructor Details
-
TextInputDialogBuilder
public TextInputDialogBuilder()Default constructor
-
-
Method Details
-
self
Description copied from class:AbstractDialogBuilder
Helper method for casting this totype
parameterB
- Specified by:
self
in classAbstractDialogBuilder<TextInputDialogBuilder,
TextInputDialog> - Returns:
this
asB
-
buildDialog
Description copied from class:AbstractDialogBuilder
Builds the dialog according to the builder implementation- Specified by:
buildDialog
in classAbstractDialogBuilder<TextInputDialogBuilder,
TextInputDialog> - Returns:
- New dialog object
-
setInitialContent
Sets the initial content the dialog will have- Parameters:
initialContent
- Initial content the dialog will have- Returns:
- Itself
-
getInitialContent
Returns the initial content the dialog will have- Returns:
- Initial content the dialog will have
-
setTextBoxSize
Sets the size of the text box the dialog will have- Parameters:
textBoxSize
- Size of the text box the dialog will have- Returns:
- Itself
-
getTextBoxSize
Returns the size of the text box the dialog will have- Returns:
- Size of the text box the dialog will have
-
setValidator
Sets the validator that will be attached to the text box in the dialog- Parameters:
validator
- Validator that will be attached to the text box in the dialog- Returns:
- Itself
-
getValidator
Returns the validator that will be attached to the text box in the dialog- Returns:
- validator that will be attached to the text box in the dialog
-
setValidationPattern
Helper method that assigned a validator to the text box the dialog will have which matches the pattern supplied- Parameters:
pattern
- Pattern to validate the text boxerrorMessage
- Error message to show when the pattern doesn't match- Returns:
- Itself
-
setPasswordInput
Sets if the text box the dialog will have contains a password and should be masked (default:false
)- Parameters:
passwordInput
-true
if the text box should be password masked,false
otherwise- Returns:
- Itself
-
isPasswordInput
public boolean isPasswordInput()Returnstrue
if the text box the dialog will have contains a password and should be masked- Returns:
true
if the text box the dialog will have contains a password and should be masked
-