Class CheckBoxTreeItemBuilder<T>
java.lang.Object
io.github.sosuisen.jfxbuilder.controls.CheckBoxTreeItemBuilder<T>
The
CheckBoxTreeItemBuilder
class constructs instances of the CheckBoxTreeItem
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 CheckBoxTreeItem
constructor
and returns an instance of the CheckBoxTreeItemBuilder
.
You can use method chaining to call the builder methods for configuring the CheckBoxTreeItem
.
Finally, invoke the build
method to generate an instance of the CheckBoxTreeItem
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 CheckBoxTreeItemBuilder
<T> addChildren
(Collection<? extends TreeItem<T>> col) Calls theaddAll
method on the ObservableList returned by theCheckBoxTreeItem#getChildren()
method.final CheckBoxTreeItemBuilder
<T> addChildren
(TreeItem<T>... elements) Calls theaddAll
method on the ObservableList returned by theCheckBoxTreeItem#getChildren()
method.apply
(Consumer<CheckBoxTreeItem<T>> func) Applies a function to the CheckBoxTreeItem instance being constructed.build()
Builds and returns an instance of theCheckBoxTreeItem
class.static <T> CheckBoxTreeItemBuilder
<T> create()
Returns an instance of theCheckBoxTreeItemBuilder<T>
.static <T> CheckBoxTreeItemBuilder
<T> create
(T value) Accepts the constructor arguments ofCheckBoxTreeItem(T)
and returns an instance ofCheckBoxTreeItemBuilder<T>
.static <T> CheckBoxTreeItemBuilder
<T> Accepts the constructor arguments ofCheckBoxTreeItem(T, Node)
and returns an instance ofCheckBoxTreeItemBuilder<T>
.static <T> CheckBoxTreeItemBuilder
<T> Accepts the constructor arguments ofCheckBoxTreeItem(T, Node, boolean)
and returns an instance ofCheckBoxTreeItemBuilder<T>
.static <T> CheckBoxTreeItemBuilder
<T> Accepts the constructor arguments ofCheckBoxTreeItem(T, Node, boolean, boolean)
and returns an instance ofCheckBoxTreeItemBuilder<T>
.expanded
(boolean value) A builder method that invokes thesetExpanded
method on the instance being constructed.Applies a function to theexpandedProperty
of the instance being constructed.A builder method that invokes thesetGraphic
method on the instance being constructed.Applies a function to thegraphicProperty
of the instance being constructed.independent
(boolean value) A builder method that invokes thesetIndependent
method on the instance being constructed.Applies a function to theindependentProperty
of the instance being constructed.indeterminate
(boolean value) A builder method that invokes thesetIndeterminate
method on the instance being constructed.Applies a function to theindeterminateProperty
of the instance being constructed.Applies a function to theleafProperty
of the instance being constructed.Applies a function to theparentProperty
of the instance being constructed.selected
(boolean value) A builder method that invokes thesetSelected
method on the instance being constructed.Applies a function to theselectedProperty
of the instance being constructed.A builder method that invokes thesetValue
method on the instance being constructed.Applies a function to thevalueProperty
of the instance being constructed.static <T> CheckBoxTreeItemBuilder
<T> withChildren
(Collection<? extends TreeItem<T>> col) Creates an instance of the builder, then calls theaddAll
method on the ObservableList returned by theCheckBoxTreeItem#getChildren()
method.static <T> CheckBoxTreeItemBuilder
<T> withChildren
(TreeItem<T>... elements) Creates an instance of the builder, then calls theaddAll
method on the ObservableList returned by theCheckBoxTreeItem#getChildren()
method.
-
Method Details
-
create
Returns an instance of theCheckBoxTreeItemBuilder<T>
.- Returns:
- an instance of the
CheckBoxTreeItemBuilder<T>
.
-
create
Accepts the constructor arguments ofCheckBoxTreeItem(T)
and returns an instance ofCheckBoxTreeItemBuilder<T>
.- Returns:
- an instance of the
CheckBoxTreeItemBuilder<T>
.
-
create
Accepts the constructor arguments ofCheckBoxTreeItem(T, Node)
and returns an instance ofCheckBoxTreeItemBuilder<T>
.- Returns:
- an instance of the
CheckBoxTreeItemBuilder<T>
.
-
create
Accepts the constructor arguments ofCheckBoxTreeItem(T, Node, boolean)
and returns an instance ofCheckBoxTreeItemBuilder<T>
.- Returns:
- an instance of the
CheckBoxTreeItemBuilder<T>
.
-
create
public static <T> CheckBoxTreeItemBuilder<T> create(T value, Node graphic, boolean selected, boolean independent) Accepts the constructor arguments ofCheckBoxTreeItem(T, Node, boolean, boolean)
and returns an instance ofCheckBoxTreeItemBuilder<T>
.- Returns:
- an instance of the
CheckBoxTreeItemBuilder<T>
.
-
build
Builds and returns an instance of theCheckBoxTreeItem
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
CheckBoxTreeItem
class
-
apply
Applies a function to the CheckBoxTreeItem instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
expanded
A builder method that invokes thesetExpanded
method on the instance being constructed.- Returns:
- builder instance
-
graphic
A builder method that invokes thesetGraphic
method on the instance being constructed.- Returns:
- builder instance
-
independent
A builder method that invokes thesetIndependent
method on the instance being constructed.- Returns:
- builder instance
-
indeterminate
A builder method that invokes thesetIndeterminate
method on the instance being constructed.- Returns:
- builder instance
-
selected
A builder method that invokes thesetSelected
method on the instance being constructed.- Returns:
- builder instance
-
value
A builder method that invokes thesetValue
method on the instance being constructed.- Returns:
- builder instance
-
addChildren
Calls theaddAll
method on the ObservableList returned by theCheckBoxTreeItem#getChildren()
method.- Returns:
- builder instance
-
addChildren
Calls theaddAll
method on the ObservableList returned by theCheckBoxTreeItem#getChildren()
method.- Returns:
- builder instance
-
withChildren
Creates an instance of the builder, then calls theaddAll
method on the ObservableList returned by theCheckBoxTreeItem#getChildren()
method.- Returns:
- builder instance
-
withChildren
Creates an instance of the builder, then calls theaddAll
method on the ObservableList returned by theCheckBoxTreeItem#getChildren()
method.- Returns:
- builder instance
-
expandedPropertyApply
Applies a function to theexpandedProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.expandedProperty().bind(anotherProperty)) // Use shorthand form .expandedPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
graphicPropertyApply
Applies a function to thegraphicProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.graphicProperty().bind(anotherProperty)) // Use shorthand form .graphicPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
independentPropertyApply
Applies a function to theindependentProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.independentProperty().bind(anotherProperty)) // Use shorthand form .independentPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
indeterminatePropertyApply
Applies a function to theindeterminateProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.indeterminateProperty().bind(anotherProperty)) // Use shorthand form .indeterminatePropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
leafPropertyApply
Applies a function to theleafProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.leafProperty().bind(anotherProperty)) // Use shorthand form .leafPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
parentPropertyApply
public CheckBoxTreeItemBuilder<T> parentPropertyApply(Consumer<ReadOnlyObjectProperty<TreeItem<T>>> op) Applies a function to theparentProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.parentProperty().bind(anotherProperty)) // Use shorthand form .parentPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
selectedPropertyApply
Applies a function to theselectedProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.selectedProperty().bind(anotherProperty)) // Use shorthand form .selectedPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
valuePropertyApply
Applies a function to thevalueProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.valueProperty().bind(anotherProperty)) // Use shorthand form .valuePropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-