Class AboutDialogBuilder

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

public class AboutDialogBuilder extends Object
Builder for Alert Dialogs.

Provides a fluent interface to create Alerts.

  • Method Details

    • title

      public AboutDialogBuilder title(String title)
      Sets the title for the about dialog.
      Parameters:
      title - the title to be set for the about dialog
      Returns:
      the current instance of AboutDialogBuilder for method chaining
    • name

      public AboutDialogBuilder name(String name)
      Sets the name to be used in the AboutDialog.
      Parameters:
      name - the name to set
      Returns:
      the current instance of AboutDialogBuilder
    • version

      public AboutDialogBuilder version(String version)
      Sets the version information for the about dialog.
      Parameters:
      version - the version information to be displayed in the dialog.
      Returns:
      the current instance of AboutDialogBuilder for method chaining.
    • copyright

      public AboutDialogBuilder copyright(String text)
      Sets the copyright information for the About dialog.
      Parameters:
      text - the copyright text to be displayed in the About dialog
      Returns:
      the current instance of AboutDialogBuilder for method chaining
    • mail

      public AboutDialogBuilder mail(String address)
      Sets the email address for the About dialog.
      Parameters:
      address - the email address to be displayed and used in the mailto link
      Returns:
      the current instance of AboutDialogBuilder for method chaining
    • mail

      public AboutDialogBuilder mail(String text, String mailtoUri)
      Sets the text and mailto URI for the mail link in the About Dialog.
      Parameters:
      text - the text to be displayed for the mail link
      mailtoUri - the mailto URI to be assigned to the mail link
      Returns:
      the current instance of AboutDialogBuilder for method chaining
    • css

      public AboutDialogBuilder css(URL css)
      Sets the CSS file to be used for styling the dialog.
      Parameters:
      css - the URL of the CSS file
      Returns:
      the updated instance of AboutDialogBuilder
    • graphic

      public AboutDialogBuilder graphic(@Nullable URL url)
      Sets the graphic for the about dialog using a URL pointing to the image. If the URL is null, the graphic will be set to null. If the URL points to a valid image, the image will be loaded and set as the graphic. If an error occurs while reading the image, a warning will be logged and the graphic will be set to null.
      Parameters:
      url - the URL pointing to the image to be used as the graphic, can be null
      Returns:
      the AboutDialogBuilder instance with the updated graphic
    • graphic

      public AboutDialogBuilder graphic(Node graphic)
      Sets the graphic node for the About dialog.
      Parameters:
      graphic - the graphic node to set
      Returns:
      the current instance of AboutDialogBuilder for method chaining
    • expandableContent

      public AboutDialogBuilder expandableContent(Node c)
      Sets the expandable content for the AboutDialog.
      Parameters:
      c - the node to be displayed as expandable content in the dialog
      Returns:
      the AboutDialogBuilder instance for method chaining
    • expandableContent

      public AboutDialogBuilder expandableContent(@Nullable String text)
      Sets expandable content for the AboutDialog.
      Parameters:
      text - the text to set as expandable content; if null or blank, the expandable content is set to null
      Returns:
      the AboutDialogBuilder instance for method chaining
    • showAndWait

      public void showAndWait()
      Displays the dialog and waits for the user to respond before returning.

      This method constructs an instance of AboutDialog using the current configuration and then invokes its showAndWait method to display it. The dialog will be modal and will block execution until the user dismisses it.

    • build

      public AboutDialog build()
      Constructs and configures an instance of AboutDialog based on the properties set in the AboutDialogBuilder.
      Returns:
      a configured AboutDialog instance