-
- All Superinterfaces:
Prompt
- All Known Implementing Classes:
DefaultListPrompt
public interface ListPrompt extends Prompt
Interface for list prompts. A list prompt allows the user to select a single item from a list.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<ListItem>getItems()Get the list of list items.default intgetPageSize()Get the page size for pagination.default booleanisFilterable()Whether the list supports inline text filtering.default booleanshowPageIndicator()Whether to show a loop indicator when pagination is enabled.-
Methods inherited from interface org.jline.prompt.Prompt
getFilter, getMessage, getName, getTransformer
-
-
-
-
Method Detail
-
getItems
java.util.List<ListItem> 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
-
-