Module com.googlecode.lanterna
Class ListSelectDialogBuilder<T>
java.lang.Object
com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<ListSelectDialogBuilder<T>,ListSelectDialog<T>>
com.googlecode.lanterna.gui2.dialogs.ListSelectDialogBuilder<T>
public class ListSelectDialogBuilder<T>
extends AbstractDialogBuilder<ListSelectDialogBuilder<T>,ListSelectDialog<T>>
Dialog builder for the
ListSelectDialog
class, use this to create instances of that class and to customize
them-
Field Summary
FieldsFields inherited from class com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder
description, extraWindowHints, title
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddListItem
(T item) Adds an item to the list box at the endfinal ListSelectDialogBuilder
<T> addListItems
(T... items) Adds a list of items to the list box at the end, in the order they are passed inprotected ListSelectDialog
<T> Builds the dialog according to the builder implementationSize of the list box in the dialog ornull
if the dialog will ask for enough space to draw all itemsReturns a copy of the list of items in the list boxboolean
Returnstrue
if the dialog can be cancelled once it's openedprotected ListSelectDialogBuilder
<T> self()
Helper method for casting this totype
parameterB
setCanCancel
(boolean canCancel) Sets if the dialog can be cancelled or not (default:true
)setListBoxSize
(TerminalSize listBoxSize) Sets the size of the list box in the dialog, scrollbars will be used if there is not enough space to draw all items.Methods inherited from class com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder
build, getDescription, getExtraWindowHints, getTitle, setDescription, setExtraWindowHints, setTitle
-
Field Details
-
-
listBoxSize
-
canCancel
private boolean canCancel
-
-
Constructor Details
-
ListSelectDialogBuilder
public ListSelectDialogBuilder()Default constructor
-
-
Method Details
-
self
Description copied from class:AbstractDialogBuilder
Helper method for casting this totype
parameterB
- Specified by:
self
in classAbstractDialogBuilder<ListSelectDialogBuilder<T>,
ListSelectDialog<T>> - Returns:
this
asB
-
buildDialog
Description copied from class:AbstractDialogBuilder
Builds the dialog according to the builder implementation- Specified by:
buildDialog
in classAbstractDialogBuilder<ListSelectDialogBuilder<T>,
ListSelectDialog<T>> - Returns:
- New dialog object
-
setListBoxSize
Sets the size of the list box in the dialog, scrollbars will be used if there is not enough space to draw all items. If set tonull
, the dialog will ask for enough space to be able to draw all items.- Parameters:
listBoxSize
- Size of the list box in the dialog- Returns:
- Itself
-
getListBoxSize
Size of the list box in the dialog ornull
if the dialog will ask for enough space to draw all items- Returns:
- Size of the list box in the dialog or
null
if the dialog will ask for enough space to draw all items
-
setCanCancel
Sets if the dialog can be cancelled or not (default:true
)- Parameters:
canCancel
- Iftrue
, the user has the option to cancel the dialog, iffalse
there is no such button in the dialog- Returns:
- Itself
-
isCanCancel
public boolean isCanCancel()Returnstrue
if the dialog can be cancelled once it's opened- Returns:
true
if the dialog can be cancelled once it's opened
-
addListItem
Adds an item to the list box at the end- Parameters:
item
- Item to add to the list box- Returns:
- Itself
-
addListItems
Adds a list of items to the list box at the end, in the order they are passed in- Parameters:
items
- Items to add to the list box- Returns:
- Itself
-
getListItems
Returns a copy of the list of items in the list box- Returns:
- Copy of the list of items in the list box
-