java.lang.Object
org.jline.prompt.impl.DefaultPrompt
org.jline.prompt.impl.DefaultCheckboxPrompt
- All Implemented Interfaces:
CheckboxPrompt,Prompt
Default implementation of CheckboxPrompt interface.
This is now the native implementation that doesn't depend on console-ui.
-
Field Summary
Fields inherited from class org.jline.prompt.impl.DefaultPrompt
message, name -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCheckboxPrompt(String name, String message, List<CheckboxItem> items) DefaultCheckboxPrompt(String name, String message, List<CheckboxItem> items, int pageSize) DefaultCheckboxPrompt(String name, String message, List<CheckboxItem> items, int pageSize, boolean showPageIndicator) DefaultCheckboxPrompt(String name, String message, List<CheckboxItem> items, int pageSize, boolean showPageIndicator, int minSelections, int maxSelections) DefaultCheckboxPrompt(String name, String message, List<CheckboxItem> items, int pageSize, boolean showPageIndicator, int minSelections, int maxSelections, boolean filterable) -
Method Summary
Modifier and TypeMethodDescriptiongetItems()Get the list of checkbox items.intGet the maximum number of items that can be selected.intGet the minimum number of items that must be selected.intGet the page size for pagination.booleanWhether the checkbox list supports inline text filtering.booleanWhether to show a loop indicator when pagination is enabled.Methods inherited from class org.jline.prompt.impl.DefaultPrompt
getFilter, getMessage, getName, getTransformer, setFilter, setTransformerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jline.prompt.Prompt
getFilter, getMessage, getName, getTransformer
-
Constructor Details
-
DefaultCheckboxPrompt
-
DefaultCheckboxPrompt
-
DefaultCheckboxPrompt
public DefaultCheckboxPrompt(String name, String message, List<CheckboxItem> items, int pageSize, boolean showPageIndicator) -
DefaultCheckboxPrompt
public DefaultCheckboxPrompt(String name, String message, List<CheckboxItem> items, int pageSize, boolean showPageIndicator, int minSelections, int maxSelections) -
DefaultCheckboxPrompt
public DefaultCheckboxPrompt(String name, String message, List<CheckboxItem> items, int pageSize, boolean showPageIndicator, int minSelections, int maxSelections, boolean filterable)
-
-
Method Details
-
getItems
Description copied from interface:CheckboxPromptGet the list of checkbox items.- Specified by:
getItemsin interfaceCheckboxPrompt- Returns:
- the list of checkbox items
-
getPageSize
public int getPageSize()Description copied from interface:CheckboxPromptGet the page size for pagination. If 0 or negative, all items are shown without pagination.- Specified by:
getPageSizein interfaceCheckboxPrompt- Returns:
- the page size, or 0 for no pagination
-
showPageIndicator
public boolean showPageIndicator()Description copied from interface:CheckboxPromptWhether to show a loop indicator when pagination is enabled. If true, shows "(1/3)" style indicators.- Specified by:
showPageIndicatorin interfaceCheckboxPrompt- Returns:
- true to show page indicators, false to hide
-
getMinSelections
public int getMinSelections()Description copied from interface:CheckboxPromptGet the minimum number of items that must be selected.- Specified by:
getMinSelectionsin interfaceCheckboxPrompt- Returns:
- the minimum number of selections, or 0 for no minimum
-
getMaxSelections
public int getMaxSelections()Description copied from interface:CheckboxPromptGet the maximum number of items that can be selected.- Specified by:
getMaxSelectionsin interfaceCheckboxPrompt- Returns:
- the maximum number of selections, or 0 for no maximum
-
isFilterable
public boolean isFilterable()Description copied from interface:CheckboxPromptWhether 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.- Specified by:
isFilterablein interfaceCheckboxPrompt- Returns:
- true if filtering is enabled, false otherwise
-