Class Prompt.MultiSelect<T>

java.lang.Object
com.codename1.cli.Prompt.MultiSelect<T>
Enclosing class:
Prompt

public static final class Prompt.MultiSelect<T> extends Object
A multiple-choice list with options: labels, preselected choices, limits.
  • 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.