Interface PromptItem

All Known Subinterfaces:
CheckboxItem, ChoiceItem, ConfirmItem, ListItem, SeparatorItem
All Known Implementing Classes:
DefaultCheckboxItem, DefaultChoiceItem, DefaultListItem, DefaultSeparatorItem

public interface PromptItem
Interface for all UI items in the Prompter. Items are immutable value objects that represent the configuration of prompt elements.
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Get the text to display when this item is disabled.
    default String
    Optional footer text shown dimmed below a list or checkbox while this item is focused.
    Get the name of this item.
    Get the text to display for this item.
    default boolean
    Whether this item is disabled.
    default boolean
    Whether this item is selectable.
  • Method Details

    • getName

      String getName()
      Get the name of this item.
      Returns:
      the name
    • isDisabled

      default boolean isDisabled()
      Whether this item is disabled.
      Returns:
      true if this item is disabled
    • isSelectable

      default boolean isSelectable()
      Whether this item is selectable.
      Returns:
      true if this item is selectable
    • getText

      String getText()
      Get the text to display for this item.
      Returns:
      the text
    • getDisabledText

      default String getDisabledText()
      Get the text to display when this item is disabled.
      Returns:
      the disabled text
    • getFooter

      default String getFooter()
      Optional footer text shown dimmed below a list or checkbox while this item is focused.
      Returns:
      the footer text, or null/empty for no footer