java.lang.Object
io.github.sosuisen.jfxbuilder.controls.DialogBuilder<R>

public class DialogBuilder<R> extends Object
The DialogBuilder class constructs instances of the Dialog class and offers a fluent interface for creating and configuring it.

This class includes a static create method that accepts the same arguments as the original Dialog constructor and returns an instance of the DialogBuilder.

You can use method chaining to call the builder methods for configuring the Dialog. Finally, invoke the build method to generate an instance of the Dialog class.

Note that intermediate builder methods are not evaluated until the build method is called, meaning they are evaluated lazily.

Author:
Hidekazu Kubota <hidekazu.kubota@gmail.com>
  • Method Details

    • create

      public static <R> DialogBuilder<R> create()
      Returns an instance of the DialogBuilder<R>.
      Returns:
      an instance of the DialogBuilder<R>.
    • build

      public Dialog<R> build()
      Builds and returns an instance of the Dialog class.

      Intermediate builder methods are not evaluated until the build method is called; in other words, they are evaluated lazily.

      Returns:
      new instance of the Dialog class
    • apply

      public DialogBuilder<R> apply(Consumer<Dialog<R>> func)
      Applies a function to the Dialog instance being constructed. Most operations on the instance can be performed using this method.
      Returns:
      builder instance
    • contentText

      public DialogBuilder<R> contentText(String contentText)
      A builder method that invokes the setContentText method on the instance being constructed.
      Returns:
      builder instance
    • dialogPane

      public DialogBuilder<R> dialogPane(DialogPane value)
      A builder method that invokes the setDialogPane method on the instance being constructed.
      Returns:
      builder instance
    • graphic

      public DialogBuilder<R> graphic(Node graphic)
      A builder method that invokes the setGraphic method on the instance being constructed.
      Returns:
      builder instance
    • headerText

      public DialogBuilder<R> headerText(String headerText)
      A builder method that invokes the setHeaderText method on the instance being constructed.
      Returns:
      builder instance
    • height

      public DialogBuilder<R> height(double height)
      A builder method that invokes the setHeight method on the instance being constructed.
      Returns:
      builder instance
    • onCloseRequest

      public DialogBuilder<R> onCloseRequest(EventHandler<DialogEvent> value)
      A builder method that invokes the setOnCloseRequest method on the instance being constructed.
      Returns:
      builder instance
    • onHidden

      public DialogBuilder<R> onHidden(EventHandler<DialogEvent> value)
      A builder method that invokes the setOnHidden method on the instance being constructed.
      Returns:
      builder instance
    • onHiding

      public DialogBuilder<R> onHiding(EventHandler<DialogEvent> value)
      A builder method that invokes the setOnHiding method on the instance being constructed.
      Returns:
      builder instance
    • onShowing

      public DialogBuilder<R> onShowing(EventHandler<DialogEvent> value)
      A builder method that invokes the setOnShowing method on the instance being constructed.
      Returns:
      builder instance
    • onShown

      public DialogBuilder<R> onShown(EventHandler<DialogEvent> value)
      A builder method that invokes the setOnShown method on the instance being constructed.
      Returns:
      builder instance
    • resizable

      public DialogBuilder<R> resizable(boolean resizable)
      A builder method that invokes the setResizable method on the instance being constructed.
      Returns:
      builder instance
    • result

      public DialogBuilder<R> result(R value)
      A builder method that invokes the setResult method on the instance being constructed.
      Returns:
      builder instance
    • resultConverter

      public DialogBuilder<R> resultConverter(Callback<ButtonType,R> value)
      A builder method that invokes the setResultConverter method on the instance being constructed.
      Returns:
      builder instance
    • title

      public DialogBuilder<R> title(String title)
      A builder method that invokes the setTitle method on the instance being constructed.
      Returns:
      builder instance
    • width

      public DialogBuilder<R> width(double width)
      A builder method that invokes the setWidth method on the instance being constructed.
      Returns:
      builder instance
    • x

      public DialogBuilder<R> x(double x)
      A builder method that invokes the setX method on the instance being constructed.
      Returns:
      builder instance
    • y

      public DialogBuilder<R> y(double y)
      A builder method that invokes the setY method on the instance being constructed.
      Returns:
      builder instance
    • contentTextPropertyApply

      public DialogBuilder<R> contentTextPropertyApply(Consumer<StringProperty> op)
      Applies a function to the contentTextProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.contentTextProperty().bind(anotherProperty))
      
      // Use shorthand form
      .contentTextPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • dialogPanePropertyApply

      public DialogBuilder<R> dialogPanePropertyApply(Consumer<ObjectProperty<DialogPane>> op)
      Applies a function to the dialogPaneProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.dialogPaneProperty().bind(anotherProperty))
      
      // Use shorthand form
      .dialogPanePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • graphicPropertyApply

      public DialogBuilder<R> graphicPropertyApply(Consumer<ObjectProperty<Node>> op)
      Applies a function to the graphicProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.graphicProperty().bind(anotherProperty))
      
      // Use shorthand form
      .graphicPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • headerTextPropertyApply

      public DialogBuilder<R> headerTextPropertyApply(Consumer<StringProperty> op)
      Applies a function to the headerTextProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.headerTextProperty().bind(anotherProperty))
      
      // Use shorthand form
      .headerTextPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • heightPropertyApply

      public DialogBuilder<R> heightPropertyApply(Consumer<ReadOnlyDoubleProperty> op)
      Applies a function to the heightProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.heightProperty().bind(anotherProperty))
      
      // Use shorthand form
      .heightPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • onCloseRequestPropertyApply

      public DialogBuilder<R> onCloseRequestPropertyApply(Consumer<ObjectProperty<EventHandler<DialogEvent>>> op)
      Applies a function to the onCloseRequestProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.onCloseRequestProperty().bind(anotherProperty))
      
      // Use shorthand form
      .onCloseRequestPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • onHiddenPropertyApply

      public DialogBuilder<R> onHiddenPropertyApply(Consumer<ObjectProperty<EventHandler<DialogEvent>>> op)
      Applies a function to the onHiddenProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.onHiddenProperty().bind(anotherProperty))
      
      // Use shorthand form
      .onHiddenPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • onHidingPropertyApply

      public DialogBuilder<R> onHidingPropertyApply(Consumer<ObjectProperty<EventHandler<DialogEvent>>> op)
      Applies a function to the onHidingProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.onHidingProperty().bind(anotherProperty))
      
      // Use shorthand form
      .onHidingPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • onShowingPropertyApply

      public DialogBuilder<R> onShowingPropertyApply(Consumer<ObjectProperty<EventHandler<DialogEvent>>> op)
      Applies a function to the onShowingProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.onShowingProperty().bind(anotherProperty))
      
      // Use shorthand form
      .onShowingPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • onShownPropertyApply

      public DialogBuilder<R> onShownPropertyApply(Consumer<ObjectProperty<EventHandler<DialogEvent>>> op)
      Applies a function to the onShownProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.onShownProperty().bind(anotherProperty))
      
      // Use shorthand form
      .onShownPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • resizablePropertyApply

      public DialogBuilder<R> resizablePropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the resizableProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.resizableProperty().bind(anotherProperty))
      
      // Use shorthand form
      .resizablePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • resultConverterPropertyApply

      public DialogBuilder<R> resultConverterPropertyApply(Consumer<ObjectProperty<Callback<ButtonType,R>>> op)
      Applies a function to the resultConverterProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.resultConverterProperty().bind(anotherProperty))
      
      // Use shorthand form
      .resultConverterPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • resultPropertyApply

      public DialogBuilder<R> resultPropertyApply(Consumer<ObjectProperty<R>> op)
      Applies a function to the resultProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.resultProperty().bind(anotherProperty))
      
      // Use shorthand form
      .resultPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • showingPropertyApply

      public DialogBuilder<R> showingPropertyApply(Consumer<ReadOnlyBooleanProperty> op)
      Applies a function to the showingProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.showingProperty().bind(anotherProperty))
      
      // Use shorthand form
      .showingPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • titlePropertyApply

      public DialogBuilder<R> titlePropertyApply(Consumer<StringProperty> op)
      Applies a function to the titleProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.titleProperty().bind(anotherProperty))
      
      // Use shorthand form
      .titlePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • widthPropertyApply

      public DialogBuilder<R> widthPropertyApply(Consumer<ReadOnlyDoubleProperty> op)
      Applies a function to the widthProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.widthProperty().bind(anotherProperty))
      
      // Use shorthand form
      .widthPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • xPropertyApply

      public DialogBuilder<R> xPropertyApply(Consumer<ReadOnlyDoubleProperty> op)
      Applies a function to the xProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.xProperty().bind(anotherProperty))
      
      // Use shorthand form
      .xPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • yPropertyApply

      public DialogBuilder<R> yPropertyApply(Consumer<ReadOnlyDoubleProperty> op)
      Applies a function to the yProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.yProperty().bind(anotherProperty))
      
      // Use shorthand form
      .yPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance