- All Superinterfaces:
BaseBuilder<CheckboxBuilder>
- All Known Implementing Classes:
DefaultCheckboxBuilder
Builder for checkbox prompts.
-
Method Summary
Modifier and TypeMethodDescriptionadd()Add the current item to the list.default CheckboxBuilderConvenience method to add a simple checkbox item with name and text.default CheckboxBuilderConvenience method to add a simple checkbox item with name, text, and checked state.default CheckboxBuilderConvenience method to add a checkbox item with all options.checked(boolean checked) Set whether the current item is checked.disabled(boolean disabled) Set whether the current item is disabled.disabledText(String disabledText) Set the disabled text for the current item.filterable(boolean filterable) Set whether the checkbox list supports inline text filtering.default CheckboxBuilderSet the footer text for the current item.default CheckboxBuildermaxSelections(int max) Set the maximum number of items that can be selected.default CheckboxBuilderminSelections(int min) Set the minimum number of items that must be selected.Create a new item with the given ID.Create a new separator with no text.newSeparator(String text) Create a new separator with the given text.pageSize(int pageSize) Set the page size for pagination.showPageIndicator(boolean showPageIndicator) Set whether to show page indicators.Set the text for the current item.Methods inherited from interface org.jline.prompt.BaseBuilder
addPrompt, filter, message, name, transformer
-
Method Details
-
newItem
Create a new item with the given ID.- Parameters:
id- the ID- Returns:
- this builder
-
text
Set the text for the current item.- Parameters:
text- the text- Returns:
- this builder
-
checked
Set whether the current item is checked.- Parameters:
checked- whether the item is checked- Returns:
- this builder
-
disabled
Set whether the current item is disabled.- Parameters:
disabled- whether the item is disabled- Returns:
- this builder
-
disabledText
Set the disabled text for the current item.- Parameters:
disabledText- the disabled text- Returns:
- this builder
-
add
CheckboxBuilder add()Add the current item to the list.- Returns:
- this builder
-
add
Convenience method to add a simple checkbox item with name and text.- Parameters:
name- the item name/idtext- the display text- Returns:
- this builder
-
add
Convenience method to add a simple checkbox item with name, text, and checked state.- Parameters:
name- the item name/idtext- the display textchecked- whether the item is initially checked- Returns:
- this builder
-
add
Convenience method to add a checkbox item with all options.- Parameters:
name- the item name/idtext- the display textchecked- whether the item is initially checkeddisabled- whether the item is disabled- Returns:
- this builder
-
filterable
Set whether the checkbox list supports inline text filtering. When enabled (the default), the user can type characters to filter the displayed items. When disabled, typed characters are ignored.- Parameters:
filterable- true to enable filtering, false to disable- Returns:
- this builder
-
pageSize
Set the page size for pagination.- Parameters:
pageSize- the page size, or 0 for no pagination- Returns:
- this builder
-
showPageIndicator
Set whether to show page indicators.- Parameters:
showPageIndicator- true to show page indicators- Returns:
- this builder
-
minSelections
Set the minimum number of items that must be selected.- Parameters:
min- the minimum number of selections (0 for no minimum)- Returns:
- this builder
-
maxSelections
Set the maximum number of items that can be selected.- Parameters:
max- the maximum number of selections (0 for no maximum)- Returns:
- this builder
-
newSeparator
CheckboxSeparatorBuilder newSeparator()Create a new separator with no text.- Returns:
- a separator builder
-
newSeparator
Create a new separator with the given text.- Parameters:
text- the separator text- Returns:
- a separator builder
-