Interface CheckboxBuilder

All Superinterfaces:
BaseBuilder<CheckboxBuilder>
All Known Implementing Classes:
DefaultCheckboxBuilder

public interface CheckboxBuilder extends BaseBuilder<CheckboxBuilder>
Builder for checkbox prompts.
  • Method Details

    • newItem

      CheckboxBuilder newItem(String id)
      Create a new item with the given ID.
      Parameters:
      id - the ID
      Returns:
      this builder
    • text

      CheckboxBuilder text(String text)
      Set the text for the current item.
      Parameters:
      text - the text
      Returns:
      this builder
    • checked

      CheckboxBuilder checked(boolean checked)
      Set whether the current item is checked.
      Parameters:
      checked - whether the item is checked
      Returns:
      this builder
    • disabled

      CheckboxBuilder disabled(boolean disabled)
      Set whether the current item is disabled.
      Parameters:
      disabled - whether the item is disabled
      Returns:
      this builder
    • disabledText

      CheckboxBuilder disabledText(String disabledText)
      Set the disabled text for the current item.
      Parameters:
      disabledText - the disabled text
      Returns:
      this builder
    • footer

      default CheckboxBuilder footer(String footer)
      Set the footer text for the current item. The footer is shown dimmed below the checkbox list while this item is focused. Newlines split it into multiple lines, and long lines wrap to the terminal width. The footer pane has a fixed height, so the list does not shift between items.
      Parameters:
      footer - the footer text, or null/empty for none
      Returns:
      this builder
    • add

      Add the current item to the list.
      Returns:
      this builder
    • add

      default CheckboxBuilder add(String name, String text)
      Convenience method to add a simple checkbox item with name and text.
      Parameters:
      name - the item name/id
      text - the display text
      Returns:
      this builder
    • add

      default CheckboxBuilder add(String name, String text, boolean checked)
      Convenience method to add a simple checkbox item with name, text, and checked state.
      Parameters:
      name - the item name/id
      text - the display text
      checked - whether the item is initially checked
      Returns:
      this builder
    • add

      default CheckboxBuilder add(String name, String text, boolean checked, boolean disabled)
      Convenience method to add a checkbox item with all options.
      Parameters:
      name - the item name/id
      text - the display text
      checked - whether the item is initially checked
      disabled - whether the item is disabled
      Returns:
      this builder
    • filterable

      CheckboxBuilder filterable(boolean filterable)
      Set whether the checkbox list supports inline text filtering. When enabled (the default), the user can type characters to filter the displayed items. When disabled, typed characters are ignored.
      Parameters:
      filterable - true to enable filtering, false to disable
      Returns:
      this builder
    • pageSize

      CheckboxBuilder pageSize(int pageSize)
      Set the page size for pagination.
      Parameters:
      pageSize - the page size, or 0 for no pagination
      Returns:
      this builder
    • showPageIndicator

      CheckboxBuilder showPageIndicator(boolean showPageIndicator)
      Set whether to show page indicators.
      Parameters:
      showPageIndicator - true to show page indicators
      Returns:
      this builder
    • minSelections

      default CheckboxBuilder minSelections(int min)
      Set the minimum number of items that must be selected.
      Parameters:
      min - the minimum number of selections (0 for no minimum)
      Returns:
      this builder
    • maxSelections

      default CheckboxBuilder maxSelections(int max)
      Set the maximum number of items that can be selected.
      Parameters:
      max - the maximum number of selections (0 for no maximum)
      Returns:
      this builder
    • newSeparator

      CheckboxSeparatorBuilder newSeparator()
      Create a new separator with no text.
      Returns:
      a separator builder
    • newSeparator

      CheckboxSeparatorBuilder newSeparator(String text)
      Create a new separator with the given text.
      Parameters:
      text - the separator text
      Returns:
      a separator builder