-
- All Superinterfaces:
Prompt
- All Known Implementing Classes:
DefaultCheckboxPrompt
public interface CheckboxPrompt extends Prompt
Interface for checkbox prompts. A checkbox prompt allows the user to select multiple items from a list.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<CheckboxItem>getItems()Get the list of checkbox items.default intgetMaxSelections()Get the maximum number of items that can be selected.default intgetMinSelections()Get the minimum number of items that must be selected.default intgetPageSize()Get the page size for pagination.default booleanisFilterable()Whether the checkbox 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<CheckboxItem> getItems()
Get the list of checkbox items.- Returns:
- the list of checkbox 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
-
getMinSelections
default int getMinSelections()
Get the minimum number of items that must be selected.- Returns:
- the minimum number of selections, or 0 for no minimum
-
getMaxSelections
default int getMaxSelections()
Get the maximum number of items that can be selected.- Returns:
- the maximum number of selections, or 0 for no maximum
-
isFilterable
default boolean isFilterable()
Whether the checkbox 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
-
-