- java.lang.Object
-
- org.jline.prompt.impl.DefaultPrompt
-
- org.jline.prompt.impl.DefaultCheckboxPrompt
-
- All Implemented Interfaces:
CheckboxPrompt,Prompt
public class DefaultCheckboxPrompt extends DefaultPrompt implements CheckboxPrompt
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
Constructors Constructor Description DefaultCheckboxPrompt(java.lang.String name, java.lang.String message, java.util.List<CheckboxItem> items)DefaultCheckboxPrompt(java.lang.String name, java.lang.String message, java.util.List<CheckboxItem> items, int pageSize)DefaultCheckboxPrompt(java.lang.String name, java.lang.String message, java.util.List<CheckboxItem> items, int pageSize, boolean showPageIndicator)DefaultCheckboxPrompt(java.lang.String name, java.lang.String message, java.util.List<CheckboxItem> items, int pageSize, boolean showPageIndicator, int minSelections, int maxSelections)DefaultCheckboxPrompt(java.lang.String name, java.lang.String message, java.util.List<CheckboxItem> items, int pageSize, boolean showPageIndicator, int minSelections, int maxSelections, boolean filterable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<CheckboxItem>getItems()Get the list of checkbox items.intgetMaxSelections()Get the maximum number of items that can be selected.intgetMinSelections()Get the minimum number of items that must be selected.intgetPageSize()Get the page size for pagination.booleanisFilterable()Whether the checkbox list supports inline text filtering.booleanshowPageIndicator()Whether to show a loop indicator when pagination is enabled.-
Methods inherited from class org.jline.prompt.impl.DefaultPrompt
getFilter, getMessage, getName, getTransformer, setFilter, setTransformer
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jline.prompt.Prompt
getFilter, getMessage, getName, getTransformer
-
-
-
-
Constructor Detail
-
DefaultCheckboxPrompt
public DefaultCheckboxPrompt(java.lang.String name, java.lang.String message, java.util.List<CheckboxItem> items)
-
DefaultCheckboxPrompt
public DefaultCheckboxPrompt(java.lang.String name, java.lang.String message, java.util.List<CheckboxItem> items, int pageSize)
-
DefaultCheckboxPrompt
public DefaultCheckboxPrompt(java.lang.String name, java.lang.String message, java.util.List<CheckboxItem> items, int pageSize, boolean showPageIndicator)
-
DefaultCheckboxPrompt
public DefaultCheckboxPrompt(java.lang.String name, java.lang.String message, java.util.List<CheckboxItem> items, int pageSize, boolean showPageIndicator, int minSelections, int maxSelections)
-
DefaultCheckboxPrompt
public DefaultCheckboxPrompt(java.lang.String name, java.lang.String message, java.util.List<CheckboxItem> items, int pageSize, boolean showPageIndicator, int minSelections, int maxSelections, boolean filterable)
-
-
Method Detail
-
getItems
public java.util.List<CheckboxItem> 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
-
-