Class SelectList.Builder
- Enclosing class:
SelectList
Builds a
SelectList; from SelectList.builder(String). Also has the options every entry has (Entry.Builder).-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the list.Called when the player selects a row (orSelectList.select(String)is called), on the main thread.rows(Supplier<List<SelectList.Row>> rows) The rows, in display order; re-read on every refresh.
-
Method Details
-
rows
The rows, in display order; re-read on every refresh. Required. Return a fresh list each time; it is copied. Row ids must be unique.- Parameters:
rows- supplies the current rows- Returns:
- this builder
-
onSelect
Called when the player selects a row (orSelectList.select(String)is called), on the main thread. Optional: actions can readSelectList.selected()instead.- Parameters:
onSelect- receives the selected row's id, ornullwhen the selection was cleared- Returns:
- this builder
-
build
Builds the list. Nothing is selected at first.- Returns:
- the list
- Throws:
IllegalStateException- ifrowsis missing
-