java.lang.Object
com.dua3.utility.fx.controls.WizardDialogBuilder
A builder class for constructing a
WizardDialog instance.
This builder helps in setting up the title and configuring the pages
of the wizard dialog.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs and returns a new instance ofWizardDialogwith the configured title and pages.Retrieves the start page of the wizard dialog being built.<D extends InputDialogPane<R>,B extends AbstractPaneBuilder<D, B, R>, R>
WizardDialogBuilderAdds a page to the wizard dialog.voidsetStartPage(String startPage) Sets the start page for the wizard dialog.Displays the constructed wizard dialog and waits for the user to close it.Sets the title for the wizard dialog being built.
-
Method Details
-
title
Sets the title for the wizard dialog being built.- Parameters:
title- The title to set for the wizard dialog.- Returns:
- The current instance of
WizardDialogBuilder, for method chaining.
-
page
public <D extends InputDialogPane<R>,B extends AbstractPaneBuilder<D, WizardDialogBuilder pageB, R>, R> (String name, B builder) Adds a page to the wizard dialog.- Type Parameters:
D- the type of the input dialog paneB- the type of the abstract pane builderR- the type of the result produced by the pane- Parameters:
name- the name of the page to addbuilder- the builder used to create and configure the pane- Returns:
- the current instance of
WizardDialogBuilder, for method chaining
-
showAndWait
Displays the constructed wizard dialog and waits for the user to close it.- Returns:
- An Optional containing a map with the results from the wizard dialog if the dialog was completed, or an empty Optional if the dialog was canceled or closed without completion.
-
build
Constructs and returns a new instance ofWizardDialogwith the configured title and pages.The pages are linked sequentially based on their insertion order. If a page does not have a "next" page set, it will be linked to the subsequent page in the insertion order.
- Returns:
- A new
WizardDialoginstance with the configured title and pages.
-
getStartPage
Retrieves the start page of the wizard dialog being built.- Returns:
- The name of the start page as a String.
-
setStartPage
Sets the start page for the wizard dialog.- Parameters:
startPage- The name of the page to be set as the start page.
-