Class ChoiceDialogBuilder<T>
ChoiceDialogBuilder class constructs instances of the ChoiceDialog 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 ChoiceDialog constructor
and returns an instance of the ChoiceDialogBuilder.
You can use method chaining to call the builder methods for configuring the ChoiceDialog.
Finally, invoke the build method to generate an instance of the ChoiceDialog 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 Summary
Modifier and TypeMethodDescriptionfinal ChoiceDialogBuilder<T> addItems(Collection<? extends T> col) Calls theaddAllmethod on the ObservableList returned by theChoiceDialog#getItems()method.final ChoiceDialogBuilder<T> Calls theaddAllmethod on the ObservableList returned by theChoiceDialog#getItems()method.apply(Consumer<ChoiceDialog<T>> func) Applies a function to the ChoiceDialog instance being constructed.build()Builds and returns an instance of theChoiceDialogclass.contentText(String contentText) A builder method that invokes thesetContentTextmethod on the instance being constructed.Applies a function to thecontentTextPropertyof the instance being constructed.static <T> ChoiceDialogBuilder<T> create()Returns an instance of theChoiceDialogBuilder<T>.static <T> ChoiceDialogBuilder<T> create(T defaultChoice, Collection<T> choices) Accepts the constructor arguments ofChoiceDialog(T, Collection)and returns an instance ofChoiceDialogBuilder<T>.static <T> ChoiceDialogBuilder<T> create(T defaultChoice, T... choices) Accepts the constructor arguments ofChoiceDialog(T, T...)and returns an instance ofChoiceDialogBuilder<T>.dialogPane(DialogPane value) A builder method that invokes thesetDialogPanemethod on the instance being constructed.Applies a function to thedialogPanePropertyof the instance being constructed.A builder method that invokes thesetGraphicmethod on the instance being constructed.Applies a function to thegraphicPropertyof the instance being constructed.headerText(String headerText) A builder method that invokes thesetHeaderTextmethod on the instance being constructed.Applies a function to theheaderTextPropertyof the instance being constructed.height(double height) A builder method that invokes thesetHeightmethod on the instance being constructed.Applies a function to theheightPropertyof the instance being constructed.onCloseRequest(EventHandler<DialogEvent> value) A builder method that invokes thesetOnCloseRequestmethod on the instance being constructed.Applies a function to theonCloseRequestPropertyof the instance being constructed.onHidden(EventHandler<DialogEvent> value) A builder method that invokes thesetOnHiddenmethod on the instance being constructed.Applies a function to theonHiddenPropertyof the instance being constructed.onHiding(EventHandler<DialogEvent> value) A builder method that invokes thesetOnHidingmethod on the instance being constructed.Applies a function to theonHidingPropertyof the instance being constructed.onShowing(EventHandler<DialogEvent> value) A builder method that invokes thesetOnShowingmethod on the instance being constructed.Applies a function to theonShowingPropertyof the instance being constructed.onShown(EventHandler<DialogEvent> value) A builder method that invokes thesetOnShownmethod on the instance being constructed.Applies a function to theonShownPropertyof the instance being constructed.resizable(boolean resizable) A builder method that invokes thesetResizablemethod on the instance being constructed.Applies a function to theresizablePropertyof the instance being constructed.A builder method that invokes thesetResultmethod on the instance being constructed.resultConverter(Callback<ButtonType, T> value) A builder method that invokes thesetResultConvertermethod on the instance being constructed.Applies a function to theresultConverterPropertyof the instance being constructed.Applies a function to theresultPropertyof the instance being constructed.selectedItem(T item) A builder method that invokes thesetSelectedItemmethod on the instance being constructed.Applies a function to theselectedItemPropertyof the instance being constructed.Applies a function to theshowingPropertyof the instance being constructed.A builder method that invokes thesetTitlemethod on the instance being constructed.Applies a function to thetitlePropertyof the instance being constructed.width(double width) A builder method that invokes thesetWidthmethod on the instance being constructed.Applies a function to thewidthPropertyof the instance being constructed.static <T> ChoiceDialogBuilder<T> withItems(Collection<? extends T> col) Creates an instance of the builder, then calls theaddAllmethod on the ObservableList returned by theChoiceDialog#getItems()method.static <T> ChoiceDialogBuilder<T> withItems(T... elements) Creates an instance of the builder, then calls theaddAllmethod on the ObservableList returned by theChoiceDialog#getItems()method.x(double x) A builder method that invokes thesetXmethod on the instance being constructed.Applies a function to thexPropertyof the instance being constructed.y(double y) A builder method that invokes thesetYmethod on the instance being constructed.Applies a function to theyPropertyof the instance being constructed.
-
Method Details
-
create
Returns an instance of theChoiceDialogBuilder<T>.- Returns:
- an instance of the
ChoiceDialogBuilder<T>.
-
create
Accepts the constructor arguments ofChoiceDialog(T, T...)and returns an instance ofChoiceDialogBuilder<T>.- Returns:
- an instance of the
ChoiceDialogBuilder<T>.
-
create
Accepts the constructor arguments ofChoiceDialog(T, Collection)and returns an instance ofChoiceDialogBuilder<T>.- Returns:
- an instance of the
ChoiceDialogBuilder<T>.
-
build
Builds and returns an instance of theChoiceDialogclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
ChoiceDialogclass
-
apply
Applies a function to the ChoiceDialog instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
contentText
A builder method that invokes thesetContentTextmethod on the instance being constructed.- Returns:
- builder instance
-
dialogPane
A builder method that invokes thesetDialogPanemethod on the instance being constructed.- Returns:
- builder instance
-
graphic
A builder method that invokes thesetGraphicmethod on the instance being constructed.- Returns:
- builder instance
-
headerText
A builder method that invokes thesetHeaderTextmethod on the instance being constructed.- Returns:
- builder instance
-
height
A builder method that invokes thesetHeightmethod on the instance being constructed.- Returns:
- builder instance
-
onCloseRequest
A builder method that invokes thesetOnCloseRequestmethod on the instance being constructed.- Returns:
- builder instance
-
onHidden
A builder method that invokes thesetOnHiddenmethod on the instance being constructed.- Returns:
- builder instance
-
onHiding
A builder method that invokes thesetOnHidingmethod on the instance being constructed.- Returns:
- builder instance
-
onShowing
A builder method that invokes thesetOnShowingmethod on the instance being constructed.- Returns:
- builder instance
-
onShown
A builder method that invokes thesetOnShownmethod on the instance being constructed.- Returns:
- builder instance
-
resizable
A builder method that invokes thesetResizablemethod on the instance being constructed.- Returns:
- builder instance
-
result
A builder method that invokes thesetResultmethod on the instance being constructed.- Returns:
- builder instance
-
resultConverter
A builder method that invokes thesetResultConvertermethod on the instance being constructed.- Returns:
- builder instance
-
selectedItem
A builder method that invokes thesetSelectedItemmethod on the instance being constructed.- Returns:
- builder instance
-
title
A builder method that invokes thesetTitlemethod on the instance being constructed.- Returns:
- builder instance
-
width
A builder method that invokes thesetWidthmethod on the instance being constructed.- Returns:
- builder instance
-
x
A builder method that invokes thesetXmethod on the instance being constructed.- Returns:
- builder instance
-
y
A builder method that invokes thesetYmethod on the instance being constructed.- Returns:
- builder instance
-
addItems
Calls theaddAllmethod on the ObservableList returned by theChoiceDialog#getItems()method.- Returns:
- builder instance
-
addItems
Calls theaddAllmethod on the ObservableList returned by theChoiceDialog#getItems()method.- Returns:
- builder instance
-
withItems
Creates an instance of the builder, then calls theaddAllmethod on the ObservableList returned by theChoiceDialog#getItems()method.- Returns:
- builder instance
-
withItems
Creates an instance of the builder, then calls theaddAllmethod on the ObservableList returned by theChoiceDialog#getItems()method.- Returns:
- builder instance
-
contentTextPropertyApply
Applies a function to thecontentTextPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.contentTextProperty().bind(anotherProperty)) // Use shorthand form .contentTextPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
dialogPanePropertyApply
Applies a function to thedialogPanePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.dialogPaneProperty().bind(anotherProperty)) // Use shorthand form .dialogPanePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
graphicPropertyApply
Applies a function to thegraphicPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.graphicProperty().bind(anotherProperty)) // Use shorthand form .graphicPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
headerTextPropertyApply
Applies a function to theheaderTextPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.headerTextProperty().bind(anotherProperty)) // Use shorthand form .headerTextPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
heightPropertyApply
Applies a function to theheightPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.heightProperty().bind(anotherProperty)) // Use shorthand form .heightPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onCloseRequestPropertyApply
public ChoiceDialogBuilder<T> onCloseRequestPropertyApply(Consumer<ObjectProperty<EventHandler<DialogEvent>>> op) Applies a function to theonCloseRequestPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onCloseRequestProperty().bind(anotherProperty)) // Use shorthand form .onCloseRequestPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onHiddenPropertyApply
public ChoiceDialogBuilder<T> onHiddenPropertyApply(Consumer<ObjectProperty<EventHandler<DialogEvent>>> op) Applies a function to theonHiddenPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onHiddenProperty().bind(anotherProperty)) // Use shorthand form .onHiddenPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onHidingPropertyApply
public ChoiceDialogBuilder<T> onHidingPropertyApply(Consumer<ObjectProperty<EventHandler<DialogEvent>>> op) Applies a function to theonHidingPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onHidingProperty().bind(anotherProperty)) // Use shorthand form .onHidingPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onShowingPropertyApply
public ChoiceDialogBuilder<T> onShowingPropertyApply(Consumer<ObjectProperty<EventHandler<DialogEvent>>> op) Applies a function to theonShowingPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onShowingProperty().bind(anotherProperty)) // Use shorthand form .onShowingPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onShownPropertyApply
public ChoiceDialogBuilder<T> onShownPropertyApply(Consumer<ObjectProperty<EventHandler<DialogEvent>>> op) Applies a function to theonShownPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onShownProperty().bind(anotherProperty)) // Use shorthand form .onShownPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
resizablePropertyApply
Applies a function to theresizablePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.resizableProperty().bind(anotherProperty)) // Use shorthand form .resizablePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
resultConverterPropertyApply
public ChoiceDialogBuilder<T> resultConverterPropertyApply(Consumer<ObjectProperty<Callback<ButtonType, T>>> op) Applies a function to theresultConverterPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.resultConverterProperty().bind(anotherProperty)) // Use shorthand form .resultConverterPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
resultPropertyApply
Applies a function to theresultPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.resultProperty().bind(anotherProperty)) // Use shorthand form .resultPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
selectedItemPropertyApply
Applies a function to theselectedItemPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.selectedItemProperty().bind(anotherProperty)) // Use shorthand form .selectedItemPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
showingPropertyApply
Applies a function to theshowingPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.showingProperty().bind(anotherProperty)) // Use shorthand form .showingPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
titlePropertyApply
Applies a function to thetitlePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.titleProperty().bind(anotherProperty)) // Use shorthand form .titlePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
widthPropertyApply
Applies a function to thewidthPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.widthProperty().bind(anotherProperty)) // Use shorthand form .widthPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
xPropertyApply
-
yPropertyApply
-