Class DefaultCheckboxPrompt

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.
  • Constructor Details

    • DefaultCheckboxPrompt

      public DefaultCheckboxPrompt(String name, String message, List<CheckboxItem> items)
    • DefaultCheckboxPrompt

      public DefaultCheckboxPrompt(String name, String message, List<CheckboxItem> items, int pageSize)
    • 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

      public List<CheckboxItem> getItems()
      Description copied from interface: CheckboxPrompt
      Get the list of checkbox items.
      Specified by:
      getItems in interface CheckboxPrompt
      Returns:
      the list of checkbox items
    • getPageSize

      public int getPageSize()
      Description copied from interface: CheckboxPrompt
      Get the page size for pagination. If 0 or negative, all items are shown without pagination.
      Specified by:
      getPageSize in interface CheckboxPrompt
      Returns:
      the page size, or 0 for no pagination
    • showPageIndicator

      public boolean showPageIndicator()
      Description copied from interface: CheckboxPrompt
      Whether to show a loop indicator when pagination is enabled. If true, shows "(1/3)" style indicators.
      Specified by:
      showPageIndicator in interface CheckboxPrompt
      Returns:
      true to show page indicators, false to hide
    • getMinSelections

      public int getMinSelections()
      Description copied from interface: CheckboxPrompt
      Get the minimum number of items that must be selected.
      Specified by:
      getMinSelections in interface CheckboxPrompt
      Returns:
      the minimum number of selections, or 0 for no minimum
    • getMaxSelections

      public int getMaxSelections()
      Description copied from interface: CheckboxPrompt
      Get the maximum number of items that can be selected.
      Specified by:
      getMaxSelections in interface CheckboxPrompt
      Returns:
      the maximum number of selections, or 0 for no maximum
    • isFilterable

      public boolean isFilterable()
      Description copied from interface: CheckboxPrompt
      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.
      Specified by:
      isFilterable in interface CheckboxPrompt
      Returns:
      true if filtering is enabled, false otherwise