java.lang.Object
org.jline.prompt.impl.DefaultCheckboxBuilder
- All Implemented Interfaces:
BaseBuilder<CheckboxBuilder>,CheckboxBuilder
Default implementation of CheckboxBuilder.
This is now the native implementation that doesn't depend on console-ui.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCheckboxBuilder(PromptBuilder parent) Create a new DefaultCheckboxBuilder with the given parent. -
Method Summary
Modifier and TypeMethodDescriptionadd()Add the current item to the list.Add this prompt to the parent builder.voidaddSeparator(SeparatorItem separatorItem) Add a separator item to the list.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.Set a filter function that modifies the actual returned value.filterable(boolean filterable) Set whether the checkbox list supports inline text filtering.Set the footer text for the current item.maxSelections(int max) Set the maximum number of items that can be selected.Set the message to display to the user.minSelections(int min) Set the minimum number of items that must be selected.Set the name of this prompt.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.transformer(Function<String, String> transformer) Set a transformer function that modifies how the answer is displayed after submission.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jline.prompt.CheckboxBuilder
add, add, add
-
Constructor Details
-
DefaultCheckboxBuilder
Create a new DefaultCheckboxBuilder with the given parent.- Parameters:
parent- the parent builder
-
-
Method Details
-
name
Set the name of this prompt.- Specified by:
namein interfaceBaseBuilder<CheckboxBuilder>- Parameters:
name- the name- Returns:
- this builder
-
message
Set the message to display to the user.- Specified by:
messagein interfaceBaseBuilder<CheckboxBuilder>- Parameters:
message- the message- Returns:
- this builder
-
newItem
Create a new item with the given ID.- Specified by:
newItemin interfaceCheckboxBuilder- Parameters:
id- the ID- Returns:
- this builder
-
text
Set the text for the current item.- Specified by:
textin interfaceCheckboxBuilder- Parameters:
text- the text- Returns:
- this builder
-
checked
Set whether the current item is checked.- Specified by:
checkedin interfaceCheckboxBuilder- Parameters:
checked- whether the item is checked- Returns:
- this builder
-
disabled
Set whether the current item is disabled.- Specified by:
disabledin interfaceCheckboxBuilder- Parameters:
disabled- whether the item is disabled- Returns:
- this builder
-
disabledText
Set the disabled text for the current item.- Specified by:
disabledTextin interfaceCheckboxBuilder- Parameters:
disabledText- the disabled text- Returns:
- this builder
-
add
Add the current item to the list.- Specified by:
addin interfaceCheckboxBuilder- Returns:
- this builder
-
filterable
Description copied from interface:CheckboxBuilderSet 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.- Specified by:
filterablein interfaceCheckboxBuilder- Parameters:
filterable- true to enable filtering, false to disable- Returns:
- this builder
-
pageSize
Description copied from interface:CheckboxBuilderSet the page size for pagination.- Specified by:
pageSizein interfaceCheckboxBuilder- Parameters:
pageSize- the page size, or 0 for no pagination- Returns:
- this builder
-
showPageIndicator
Description copied from interface:CheckboxBuilderSet whether to show page indicators.- Specified by:
showPageIndicatorin interfaceCheckboxBuilder- Parameters:
showPageIndicator- true to show page indicators- Returns:
- this builder
-
minSelections
Description copied from interface:CheckboxBuilderSet the minimum number of items that must be selected.- Specified by:
minSelectionsin interfaceCheckboxBuilder- Parameters:
min- the minimum number of selections (0 for no minimum)- Returns:
- this builder
-
maxSelections
Description copied from interface:CheckboxBuilderSet the maximum number of items that can be selected.- Specified by:
maxSelectionsin interfaceCheckboxBuilder- Parameters:
max- the maximum number of selections (0 for no maximum)- Returns:
- this builder
-
newSeparator
Description copied from interface:CheckboxBuilderCreate a new separator with no text.- Specified by:
newSeparatorin interfaceCheckboxBuilder- Returns:
- a separator builder
-
newSeparator
Description copied from interface:CheckboxBuilderCreate a new separator with the given text.- Specified by:
newSeparatorin interfaceCheckboxBuilder- Parameters:
text- the separator text- Returns:
- a separator builder
-
addSeparator
Add a separator item to the list.- Parameters:
separatorItem- the separator item to add
-
transformer
Description copied from interface:BaseBuilderSet a transformer function that modifies how the answer is displayed after submission. This does not change the actual returned value. For example, a password prompt might transform the answer to "***".- Specified by:
transformerin interfaceBaseBuilder<CheckboxBuilder>- Parameters:
transformer- the transformer function- Returns:
- this builder instance for method chaining
-
filter
Description copied from interface:BaseBuilderSet a filter function that modifies the actual returned value. This changes the value stored in the result map. For example, trimming whitespace or converting to lowercase.- Specified by:
filterin interfaceBaseBuilder<CheckboxBuilder>- Parameters:
filter- the filter function- Returns:
- this builder instance for method chaining
-
addPrompt
Add this prompt to the parent builder.- Specified by:
addPromptin interfaceBaseBuilder<CheckboxBuilder>- Returns:
- the parent
PromptBuilderfor continued prompt configuration - See Also:
-