Class DialogBase.Builder
java.lang.Object
fr.fidorial.dialog.DialogBase.Builder
- Enclosing class:
DialogBase
Fluent builder for
DialogBase.- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionafterAction(DialogAfterAction afterAction) Sets what the client does once a button has been pressed.body(DialogBody element) Appends a body element.body(List<? extends DialogBody> elements) Appends several body elements.body(ComponentLike message) Appends a plain text body element.build()Returns the built base.canCloseWithEscape(boolean canCloseWithEscape) externalTitle(@Nullable ComponentLike externalTitle) input(DialogInput input) Appends an input control.inputs(List<? extends DialogInput> inputs) Appends several input controls.pause(boolean pause) title(ComponentLike title)
-
Method Details
-
title
- Parameters:
title- the screen title- Returns:
- this builder
- Since:
- 0.1.0
-
externalTitle
@Contract("_ -> this") public DialogBase.Builder externalTitle(@Nullable ComponentLike externalTitle) - Parameters:
externalTitle- the label of the button leading to this dialog, ornullto reuse the title- Returns:
- this builder
- Since:
- 0.1.0
-
body
Appends a body element.- Parameters:
element- the element to append- Returns:
- this builder
- Since:
- 0.1.0
-
body
Appends a plain text body element.- Parameters:
message- the text to display- Returns:
- this builder
- Since:
- 0.1.0
-
body
Appends several body elements.- Parameters:
elements- the elements to append- Returns:
- this builder
- Since:
- 0.1.0
-
input
Appends an input control.- Parameters:
input- the control to append- Returns:
- this builder
- Since:
- 0.1.0
-
inputs
Appends several input controls.- Parameters:
inputs- the controls to append- Returns:
- this builder
- Since:
- 0.1.0
-
canCloseWithEscape
- Parameters:
canCloseWithEscape- whether the escape key dismisses the dialog- Returns:
- this builder
- Since:
- 0.1.0
-
pause
- Parameters:
pause- whether the dialog pauses a single-player game- Returns:
- this builder
- Since:
- 0.1.0
-
afterAction
Sets what the client does once a button has been pressed.Picking
DialogAfterAction.NONEalso clears the pause flag, since the two are mutually exclusive.- Parameters:
afterAction- the behaviour to apply- Returns:
- this builder
- Since:
- 0.1.0
-
build
Returns the built base.- Returns:
- the built base
- Since:
- 0.1.0
-