- 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.
-
-
Field Summary
-
Fields inherited from class org.jline.prompt.impl.DefaultPrompt
message, name
-
-
Constructor Summary
Constructors Constructor Description DefaultListPrompt(java.lang.String name, java.lang.String message, java.util.List<ListItem> items)DefaultListPrompt(java.lang.String name, java.lang.String message, java.util.List<ListItem> items, int pageSize)DefaultListPrompt(java.lang.String name, java.lang.String message, java.util.List<ListItem> items, int pageSize, boolean showPageIndicator)DefaultListPrompt(java.lang.String name, java.lang.String message, java.util.List<ListItem> items, int pageSize, boolean showPageIndicator, boolean filterable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ListItem>getItems()Get the list of list items.intgetPageSize()Get the page size for pagination.booleanisFilterable()Whether the list supports inline text filtering.booleanshowPageIndicator()Whether to show a loop indicator when pagination is enabled.-
Methods inherited from class org.jline.prompt.impl.DefaultPrompt
getFilter, getMessage, getName, getTransformer, setFilter, setTransformer
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jline.prompt.Prompt
getFilter, getMessage, getName, getTransformer
-
-
-
-
Constructor Detail
-
DefaultListPrompt
public DefaultListPrompt(java.lang.String name, java.lang.String message, java.util.List<ListItem> items)
-
DefaultListPrompt
public DefaultListPrompt(java.lang.String name, java.lang.String message, java.util.List<ListItem> items, int pageSize)
-
DefaultListPrompt
public DefaultListPrompt(java.lang.String name, java.lang.String message, java.util.List<ListItem> items, int pageSize, boolean showPageIndicator)
-
DefaultListPrompt
public DefaultListPrompt(java.lang.String name, java.lang.String message, java.util.List<ListItem> items, int pageSize, boolean showPageIndicator, boolean filterable)
-
-
Method Detail
-
getItems
public java.util.List<ListItem> getItems()
Description copied from interface:ListPromptGet the list of list items.- Specified by:
getItemsin interfaceListPrompt- Returns:
- the list of list items
-
getPageSize
public int getPageSize()
Description copied from interface:ListPromptGet the page size for pagination. If 0 or negative, all items are shown without pagination.- Specified by:
getPageSizein interfaceListPrompt- Returns:
- the page size, or 0 for no pagination
-
showPageIndicator
public boolean showPageIndicator()
Description copied from interface:ListPromptWhether to show a loop indicator when pagination is enabled. If true, shows "(1/3)" style indicators.- Specified by:
showPageIndicatorin interfaceListPrompt- Returns:
- true to show page indicators, false to hide
-
isFilterable
public boolean isFilterable()
Description copied from interface:ListPromptWhether 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:
isFilterablein interfaceListPrompt- Returns:
- true if filtering is enabled, false otherwise
-
-