Class DefaultCheckboxBuilder

    • Constructor Detail

      • DefaultCheckboxBuilder

        public DefaultCheckboxBuilder​(PromptBuilder parent)
        Create a new DefaultCheckboxBuilder with the given parent.
        Parameters:
        parent - the parent builder
    • Method Detail

      • newItem

        public CheckboxBuilder newItem​(java.lang.String id)
        Create a new item with the given ID.
        Specified by:
        newItem in interface CheckboxBuilder
        Parameters:
        id - the ID
        Returns:
        this builder
      • text

        public CheckboxBuilder text​(java.lang.String text)
        Set the text for the current item.
        Specified by:
        text in interface CheckboxBuilder
        Parameters:
        text - the text
        Returns:
        this builder
      • checked

        public CheckboxBuilder checked​(boolean checked)
        Set whether the current item is checked.
        Specified by:
        checked in interface CheckboxBuilder
        Parameters:
        checked - whether the item is checked
        Returns:
        this builder
      • disabled

        public CheckboxBuilder disabled​(boolean disabled)
        Set whether the current item is disabled.
        Specified by:
        disabled in interface CheckboxBuilder
        Parameters:
        disabled - whether the item is disabled
        Returns:
        this builder
      • disabledText

        public CheckboxBuilder disabledText​(java.lang.String disabledText)
        Set the disabled text for the current item.
        Specified by:
        disabledText in interface CheckboxBuilder
        Parameters:
        disabledText - the disabled text
        Returns:
        this builder
      • footer

        public CheckboxBuilder footer​(java.lang.String footer)
        Description copied from interface: CheckboxBuilder
        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.
        Specified by:
        footer in interface CheckboxBuilder
        Parameters:
        footer - the footer text, or null/empty for none
        Returns:
        this builder
      • filterable

        public CheckboxBuilder filterable​(boolean filterable)
        Description copied from interface: CheckboxBuilder
        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.
        Specified by:
        filterable in interface CheckboxBuilder
        Parameters:
        filterable - true to enable filtering, false to disable
        Returns:
        this builder
      • pageSize

        public CheckboxBuilder pageSize​(int pageSize)
        Description copied from interface: CheckboxBuilder
        Set the page size for pagination.
        Specified by:
        pageSize in interface CheckboxBuilder
        Parameters:
        pageSize - the page size, or 0 for no pagination
        Returns:
        this builder
      • showPageIndicator

        public CheckboxBuilder showPageIndicator​(boolean showPageIndicator)
        Description copied from interface: CheckboxBuilder
        Set whether to show page indicators.
        Specified by:
        showPageIndicator in interface CheckboxBuilder
        Parameters:
        showPageIndicator - true to show page indicators
        Returns:
        this builder
      • minSelections

        public CheckboxBuilder minSelections​(int min)
        Description copied from interface: CheckboxBuilder
        Set the minimum number of items that must be selected.
        Specified by:
        minSelections in interface CheckboxBuilder
        Parameters:
        min - the minimum number of selections (0 for no minimum)
        Returns:
        this builder
      • maxSelections

        public CheckboxBuilder maxSelections​(int max)
        Description copied from interface: CheckboxBuilder
        Set the maximum number of items that can be selected.
        Specified by:
        maxSelections in interface CheckboxBuilder
        Parameters:
        max - the maximum number of selections (0 for no maximum)
        Returns:
        this builder
      • addSeparator

        public void addSeparator​(SeparatorItem separatorItem)
        Add a separator item to the list.
        Parameters:
        separatorItem - the separator item to add
      • transformer

        public CheckboxBuilder transformer​(java.util.function.Function<java.lang.String,​java.lang.String> transformer)
        Description copied from interface: BaseBuilder
        Set a transformer function that modifies how the answer is displayed after submission. This does not change the actual returned value. For example, a password prompt might transform the answer to "***".
        Specified by:
        transformer in interface BaseBuilder<CheckboxBuilder>
        Parameters:
        transformer - the transformer function
        Returns:
        this builder instance for method chaining
      • filter

        public CheckboxBuilder filter​(java.util.function.Function<java.lang.String,​java.lang.String> filter)
        Description copied from interface: BaseBuilder
        Set a filter function that modifies the actual returned value. This changes the value stored in the result map. For example, trimming whitespace or converting to lowercase.
        Specified by:
        filter in interface BaseBuilder<CheckboxBuilder>
        Parameters:
        filter - the filter function
        Returns:
        this builder instance for method chaining