Klasse WizardDialogBuilder

java.lang.Object
com.dua3.utility.fx.controls.WizardDialogBuilder

public class WizardDialogBuilder extends Object
A builder class for constructing a WizardDialog instance. This builder helps in setting up the title and configuring the pages of the wizard dialog.
  • Methodendetails

    • title

      public WizardDialogBuilder title(String title)
      Sets the title for the wizard dialog being built.
      Parameter:
      title - The title to set for the wizard dialog.
      Gibt zurück:
      The current instance of WizardDialogBuilder, for method chaining.
    • page

      public <D extends InputDialogPane<R>, B extends PaneBuilder<D, B, R>, R> WizardDialogBuilder page(String name, B builder)
      Adds a page to the wizard dialog.
      Typparameter:
      D - the type of the input dialog pane
      B - the type of the abstract pane builder
      R - the type of the result produced by the pane
      Parameter:
      name - the name of the page to add
      builder - the builder used to create and configure the pane
      Gibt zurück:
      the current instance of WizardDialogBuilder, for method chaining
    • showAndWait

      public Optional<Map<String,Object>> showAndWait()
      Displays the constructed wizard dialog and waits for the user to close it.
      Gibt zurück:
      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

      public WizardDialog build()
      Constructs and returns a new instance of WizardDialog with 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.

      Gibt zurück:
      A new WizardDialog instance with the configured title and pages.
    • getStartPage

      public String getStartPage()
      Retrieves the start page of the wizard dialog being built.
      Gibt zurück:
      The name of the start page as a String.
    • setStartPage

      public void setStartPage(String startPage)
      Sets the start page for the wizard dialog.
      Parameter:
      startPage - The name of the page to be set as the start page.