Class Button.Builder
- Enclosing class:
Button
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the button.A fixed text; seelabel(Supplier).The text on the button, re-read on every refresh.What a click does, run on the main thread.
-
Method Details
-
label
The text on the button, re-read on every refresh. Required.- Parameters:
label- read on refresh- Returns:
- this builder
-
label
A fixed text; seelabel(Supplier).- Parameters:
label- the text- Returns:
- this builder
-
onPress
What a click does, run on the main thread. Required. Typical actions change the mod's state, show aStatusLinemessage, or navigate withUiHost.open(Screen),UiHost.back()orUiHost.close(). Slow work (file or network IO) belongs inUiHost.runAsync(Callable, BiConsumer). If it throws, the error is logged and the menu stays open.- Parameters:
onPress- the action- Returns:
- this builder
-
build
Builds the button.- Returns:
- the button
- Throws:
IllegalStateException- iflabeloronPressis missing
-