Package adams.terminal.core
Class MenuListDialogBuilder
- java.lang.Object
-
- com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<MenuListDialogBuilder,MenuListDialog>
-
- adams.terminal.core.MenuListDialogBuilder
-
public class MenuListDialogBuilder extends com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<MenuListDialogBuilder,MenuListDialog>
Dialog builder for theMenuListDialogclass, use this to create instances of that class and to customize them- Author:
- Martin
-
-
Constructor Summary
Constructors Constructor Description MenuListDialogBuilder()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MenuListDialogBuilderaddAction(Runnable action)Adds an additional action to theMenuListBoxthat is to be displayed when the dialog is opened.MenuListDialogBuilderaddAction(String label, Runnable action)Adds an additional action to theMenuListBoxthat is to be displayed when the dialog is openedMenuListDialogBuilderaddActions(Runnable... actions)Adds additional actions to theMenuListBoxthat is to be displayed when the dialog is opened.protected MenuListDialogbuildDialog()List<Runnable>getActions()Returns a copy of the internal list of actions currently inside this builder that will be assigned to theMenuListBoxin the dialog when builtcom.googlecode.lanterna.TerminalSizegetListBoxSize()Returns the specified size of the internalMenuListBoxornullif there is no size and the list box will attempt to take up enough size to draw all itemsprotected MenuListDialogBuilderself()MenuListDialogBuildersetListBoxSize(com.googlecode.lanterna.TerminalSize listBoxSize)Sets the size of the internalMenuListBoxin columns and rows, forcing scrollbars to appear if the space isn't big enough to contain all the items
-
-
-
Method Detail
-
self
protected MenuListDialogBuilder self()
- Specified by:
selfin classcom.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<MenuListDialogBuilder,MenuListDialog>
-
buildDialog
protected MenuListDialog buildDialog()
- Specified by:
buildDialogin classcom.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<MenuListDialogBuilder,MenuListDialog>
-
setListBoxSize
public MenuListDialogBuilder setListBoxSize(com.googlecode.lanterna.TerminalSize listBoxSize)
Sets the size of the internalMenuListBoxin columns and rows, forcing scrollbars to appear if the space isn't big enough to contain all the items- Parameters:
listBoxSize- Size of theMenuListBox- Returns:
- Itself
-
getListBoxSize
public com.googlecode.lanterna.TerminalSize getListBoxSize()
Returns the specified size of the internalMenuListBoxornullif there is no size and the list box will attempt to take up enough size to draw all items- Returns:
- Specified size of the internal
MenuListBoxornullif there is no size
-
addAction
public MenuListDialogBuilder addAction(String label, Runnable action)
Adds an additional action to theMenuListBoxthat is to be displayed when the dialog is opened- Parameters:
label- Label of the new actionaction- Action to perform if the user selects this item- Returns:
- Itself
-
addAction
public MenuListDialogBuilder addAction(Runnable action)
Adds an additional action to theMenuListBoxthat is to be displayed when the dialog is opened. The label of this item will be derived by callingtoString()on the runnable- Parameters:
action- Action to perform if the user selects this item- Returns:
- Itself
-
addActions
public MenuListDialogBuilder addActions(Runnable... actions)
Adds additional actions to theMenuListBoxthat is to be displayed when the dialog is opened. The label of the items will be derived by callingtoString()on each runnable- Parameters:
actions- Items to add to theMenuListBox- Returns:
- Itself
-
-