Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public static final class Prompt.MultiSelect<T>

  1. Object
  2. Prompt.MultiSelect
A multiple-choice list with options: labels, preselected choices, limits.

Constructors

public MultiSelect(String question, List<T> choices)A multiple selection among choices.

Methods

public Prompt.MultiSelect<T> labeler(Prompt.Labeler<T> labeler)How a choice is shown; String.valueOf by default.
public Prompt.MultiSelect<T> preselect(int... indexes)The choices selected when the list opens, by index.
public Prompt.MultiSelect<T> pageSize(int size)How many choices are shown at once; 10 by default.
public Prompt.MultiSelect<T> min(int count)The fewest choices the answer may have.
public Prompt.MultiSelect<T> max(int count)The most choices the answer may have.
public Prompt.MultiSelect<T> filter(boolean on)Whether typing filters the list; on by default.
public List<T> ask()Asks and answers the choices made, in list order.

Inherited methods

Constructor details

MultiSelect

public MultiSelect(String question, List<T> choices)
A multiple selection among choices.

Method details

labeler

public Prompt.MultiSelect<T> labeler(Prompt.Labeler<T> labeler)
How a choice is shown; String.valueOf by default.

preselect

public Prompt.MultiSelect<T> preselect(int... indexes)
The choices selected when the list opens, by index.

pageSize

public Prompt.MultiSelect<T> pageSize(int size)
How many choices are shown at once; 10 by default.

min

public Prompt.MultiSelect<T> min(int count)
The fewest choices the answer may have.

max

public Prompt.MultiSelect<T> max(int count)
The most choices the answer may have.

filter

public Prompt.MultiSelect<T> filter(boolean on)
Whether typing filters the list; on by default.

ask

public List<T> ask()
Asks and answers the choices made, in list order.