Class ConfirmDialog.Builder
java.lang.Object
dev.xichil.mvui.ConfirmDialog.Builder
- Enclosing class:
ConfirmDialog
Builds a
ConfirmDialog; from ConfirmDialog.builder(String). Setters return the builder for chaining.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the dialog.The explanation below the question, e.g.The "no" button's label;UiTexts.NOby default, e.g.What "no" does, run on the main thread after the dialog has closed.What "yes" does, run on the main thread after the dialog has closed.The question, shown at the top, e.g.The "yes" button's label;UiTexts.YESby default.
-
Method Details
-
title
The question, shown at the top, e.g. "Delete profile 'default'?". Required.- Parameters:
title- the question- Returns:
- this builder
-
message
The explanation below the question, e.g. "This can't be undone.". Required.- Parameters:
message- the explanation- Returns:
- this builder
-
yesLabel
The "yes" button's label;UiTexts.YESby default. A verb ("Delete", "Overwrite") is clearer.- Parameters:
yesLabel- the label- Returns:
- this builder
-
noLabel
The "no" button's label;UiTexts.NOby default, e.g.UiTexts.CANCEL.- Parameters:
noLabel- the label- Returns:
- this builder
-
onYes
What "yes" does, run on the main thread after the dialog has closed. Required.- Parameters:
onYes- the action- Returns:
- this builder
-
onNo
What "no" does, run on the main thread after the dialog has closed. Optional: by default "no" just closes the dialog.- Parameters:
onNo- the action- Returns:
- this builder
-
build
Builds the dialog.- Returns:
- the dialog
- Throws:
IllegalStateException- iftitle,messageoronYesis missing
-