public class ListSelectDialogBuilder<T> extends AbstractDialogBuilder<ListSelectDialogBuilder<T>,ListSelectDialog<T>>
ListSelectDialog
class, use this to create instances of that class and to customize
themdescription, extraWindowHints, title
Constructor | Description |
---|---|
ListSelectDialogBuilder() |
Default constructor
|
Modifier and Type | Method | Description |
---|---|---|
ListSelectDialogBuilder<T> |
addListItem(T item) |
Adds an item to the list box at the end
|
ListSelectDialogBuilder<T> |
addListItems(T... items) |
Adds a list of items to the list box at the end, in the order they are passed in
|
protected ListSelectDialog<T> |
buildDialog() |
Builds the dialog according to the builder implementation
|
TerminalSize |
getListBoxSize() |
Size of the list box in the dialog or
null if the dialog will ask for enough space to draw all items |
List<T> |
getListItems() |
Returns a copy of the list of items in the list box
|
boolean |
isCanCancel() |
Returns
true if the dialog can be cancelled once it's opened |
protected ListSelectDialogBuilder<T> |
self() |
Helper method for casting this to
type parameter B |
ListSelectDialogBuilder<T> |
setCanCancel(boolean canCancel) |
Sets if the dialog can be cancelled or not (default:
true ) |
ListSelectDialogBuilder<T> |
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.
|
build, getDescription, getExtraWindowHints, getTitle, setDescription, setExtraWindowHints, setTitle
protected ListSelectDialogBuilder<T> self()
AbstractDialogBuilder
type
parameter B
self
in class AbstractDialogBuilder<ListSelectDialogBuilder<T>,ListSelectDialog<T>>
this
as B
protected ListSelectDialog<T> buildDialog()
AbstractDialogBuilder
buildDialog
in class AbstractDialogBuilder<ListSelectDialogBuilder<T>,ListSelectDialog<T>>
public ListSelectDialogBuilder<T> setListBoxSize(TerminalSize listBoxSize)
null
, the dialog will ask for enough space to be able to draw all items.listBoxSize
- Size of the list box in the dialogpublic TerminalSize getListBoxSize()
null
if the dialog will ask for enough space to draw all itemsnull
if the dialog will ask for enough space to draw all itemspublic ListSelectDialogBuilder<T> setCanCancel(boolean canCancel)
true
)canCancel
- If true
, the user has the option to cancel the dialog, if false
there is no such
button in the dialogpublic boolean isCanCancel()
true
if the dialog can be cancelled once it's openedtrue
if the dialog can be cancelled once it's openedpublic ListSelectDialogBuilder<T> addListItem(T item)
item
- Item to add to the list boxpublic ListSelectDialogBuilder<T> addListItems(T... items)
items
- Items to add to the list boxCopyright © 2020. All rights reserved.