Klasse DialogPaneBuilder<D,B extends DialogPaneBuilder<D,B,R>,R>

java.lang.Object
com.dua3.utility.fx.controls.abstract_builders.DialogPaneBuilder<D,B,R>
Typparameter:
D - the type of the dialog or pane to build
B - the type of the builder
R - the result type
Bekannte direkte Unterklassen:
DialogBuilder, PaneBuilder

public abstract class DialogPaneBuilder<D,B extends DialogPaneBuilder<D,B,R>,R> extends Object
Abstract base class for DialogPane builders.

Provides a fluent interface to create Dialog panes.

  • Felddetails

  • Konstruktordetails

    • DialogPaneBuilder

      protected DialogPaneBuilder(BiConsumer<? super D,? super String> headerSetter)
  • Methodendetails

    • setDialogSupplier

      protected final void setDialogSupplier(Supplier<? extends D> dialogSupplier)
    • build

      public D build()
      Create Alert instance.
      Gibt zurück:
      Alert instance
    • applyIfNotNull

      protected static <C, D> void applyIfNotNull(BiConsumer<C,D> consumer, @Nullable C a, @Nullable D b)
    • header

      public B header(String fmt, Object... args)
      Set Alert header text.
      Parameter:
      fmt - the format String as defined by Formatter
      args - the arguments passed to the formatter
      Gibt zurück:
      this
    • resultHandler

      public B resultHandler(DialogPaneBuilder.ResultHandler<R> resultHandler)
      Sets the result handler for this dialog pane builder.
      Parameter:
      resultHandler - the result handler to be used for handling dialog results
      Gibt zurück:
      this builder instance
    • getResultHandler

      public DialogPaneBuilder.ResultHandler<R> getResultHandler()
      Gets the result handler for this dialog pane builder.
      Gibt zurück:
      the result handler managing dialog results
    • button

      protected B button(InputDialogPane.ButtonDef<R> button)
      Adds a button definition to the dialog pane builder. This method attaches the specified button definition to the builder's list of buttons and returns the current builder instance for method chaining.
      Parameter:
      button - the button definition to be added, containing button type, result handler, action to execute, and enablement state
      Gibt zurück:
      the current builder instance with the added button definition
    • buttons

      public List<InputDialogPane.ButtonDef<R>> buttons()
      Retrieves the list of button definitions associated with this dialog pane builder. If no button definitions have been explicitly provided, a default list containing "OK" and "Cancel" buttons is returned. The buttons are defined with their respective actions, result handlers, and enablement state.
      Gibt zurück:
      a list of button definitions for this dialog pane builder