- All Superinterfaces:
Prompt
- All Known Implementing Classes:
DefaultListPrompt
Interface for list prompts.
A list prompt allows the user to select a single item from a list.
-
Method Summary
Modifier and TypeMethodDescriptiongetItems()Get the list of list items.default intGet the page size for pagination.default booleanWhether the list supports inline text filtering.default booleanWhether to show a loop indicator when pagination is enabled.Methods inherited from interface org.jline.prompt.Prompt
getFilter, getMessage, getName, getTransformer
-
Method Details
-
getItems
Get the list of list items.- Returns:
- the list of list items
-
getPageSize
default int getPageSize()Get the page size for pagination. If 0 or negative, all items are shown without pagination.- Returns:
- the page size, or 0 for no pagination
-
showPageIndicator
default boolean showPageIndicator()Whether to show a loop indicator when pagination is enabled. If true, shows "(1/3)" style indicators.- Returns:
- true to show page indicators, false to hide
-
isFilterable
default boolean isFilterable()Whether the list supports inline text filtering. When enabled, the user can type characters to filter the displayed items. When disabled, typed characters are ignored.- Returns:
- true if filtering is enabled, false otherwise
-