- All Superinterfaces:
BaseBuilder<ListBuilder>
- All Known Implementing Classes:
DefaultListBuilder
Builder for list prompts.
-
Method Summary
Modifier and TypeMethodDescriptionadd()Add the current item to the list.default ListBuilderConvenience method to add a simple list item with name and text.default ListBuilderConvenience method to add a simple list item with name, text, and disabled state.default ListBuilderConvenience method to add a simple list item with name, text, disabled state, and disabled text.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 list supports inline text filtering.default ListBuilderSet the footer text for the current item.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
-
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
ListBuilder add()Add the current item to the list.- Returns:
- this builder
-
add
Convenience method to add a simple list item with name and text.- Parameters:
name- the item name/idtext- the display text- Returns:
- this builder
-
add
Convenience method to add a simple list item with name, text, and disabled state.- Parameters:
name- the item name/idtext- the display textdisabled- whether the item is disabled- Returns:
- this builder
-
add
Convenience method to add a simple list item with name, text, disabled state, and disabled text.- Parameters:
name- the item name/idtext- the display textdisabled- whether the item is disableddisabledText- the text to show when disabled- Returns:
- this builder
-
filterable
Set whether the 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
-
newSeparator
ListSeparatorBuilder 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
-