Class DefaultListPrompt

java.lang.Object
org.jline.prompt.impl.DefaultPrompt
org.jline.prompt.impl.DefaultListPrompt
All Implemented Interfaces:
ListPrompt, Prompt

public class DefaultListPrompt extends DefaultPrompt implements ListPrompt
Default implementation of ListPrompt interface. This is now the native implementation that doesn't depend on console-ui.
  • Constructor Details

    • DefaultListPrompt

      public DefaultListPrompt(String name, String message, List<ListItem> items)
    • DefaultListPrompt

      public DefaultListPrompt(String name, String message, List<ListItem> items, int pageSize)
    • DefaultListPrompt

      public DefaultListPrompt(String name, String message, List<ListItem> items, int pageSize, boolean showPageIndicator)
    • DefaultListPrompt

      public DefaultListPrompt(String name, String message, List<ListItem> items, int pageSize, boolean showPageIndicator, boolean filterable)
  • Method Details

    • getItems

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

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

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

      public boolean isFilterable()
      Description copied from interface: ListPrompt
      Whether the 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 ListPrompt
      Returns:
      true if filtering is enabled, false otherwise