Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public static final class Prompt.Select<T>
- Object
- Prompt.Select
A single-choice list with options: labels, a default, page size,
filtering.
Constructors
public Select(String question, List<T> choices) | A selection among choices. |
Methods
public Prompt.Select<T> labeler(Prompt.Labeler<T> labeler) | How a choice is shown; String.valueOf by default. |
public Prompt.Select<T> defaultIndex(int index) | The choice the cursor starts on. |
public Prompt.Select<T> pageSize(int size) | How many choices are shown at once; 10 by default. |
public Prompt.Select<T> filter(boolean on) | Whether typing filters the list; on by default. |
public T ask() | Asks and answers the choice made. |
Inherited methods
Constructor details
Select
public Select(String question, List<T> choices)A selection among
choices.Method details
labeler
public Prompt.Select<T> labeler(Prompt.Labeler<T> labeler)How a choice is shown;
String.valueOf by default.defaultIndex
public Prompt.Select<T> defaultIndex(int index)The choice the cursor starts on.
pageSize
public Prompt.Select<T> pageSize(int size)How many choices are shown at once; 10 by default.
filter
public Prompt.Select<T> filter(boolean on)Whether typing filters the list; on by default.
ask
public T ask()Asks and answers the choice made.
Throws
IllegalArgumentException- when there are no choices.