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 theaddAllmethod on the ObservableList returned by theCheckBoxTreeItem#getChildren()method.final CheckBoxTreeItemBuilder<T> addChildren(TreeItem<T>... elements) Calls theaddAllmethod 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 theCheckBoxTreeItemclass.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 thesetExpandedmethod on the instance being constructed.Applies a function to theexpandedPropertyof the instance being constructed.A builder method that invokes thesetGraphicmethod on the instance being constructed.Applies a function to thegraphicPropertyof the instance being constructed.independent(boolean value) A builder method that invokes thesetIndependentmethod on the instance being constructed.Applies a function to theindependentPropertyof the instance being constructed.indeterminate(boolean value) A builder method that invokes thesetIndeterminatemethod on the instance being constructed.Applies a function to theindeterminatePropertyof the instance being constructed.Applies a function to theleafPropertyof the instance being constructed.Applies a function to theparentPropertyof the instance being constructed.selected(boolean value) A builder method that invokes thesetSelectedmethod on the instance being constructed.Applies a function to theselectedPropertyof the instance being constructed.A builder method that invokes thesetValuemethod on the instance being constructed.Applies a function to thevaluePropertyof the instance being constructed.static <T> CheckBoxTreeItemBuilder<T> withChildren(Collection<? extends TreeItem<T>> col) Creates an instance of the builder, then calls theaddAllmethod on the ObservableList returned by theCheckBoxTreeItem#getChildren()method.static <T> CheckBoxTreeItemBuilder<T> withChildren(TreeItem<T>... elements) Creates an instance of the builder, then calls theaddAllmethod 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 theCheckBoxTreeItemclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
CheckBoxTreeItemclass
-
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 thesetExpandedmethod on the instance being constructed.- Returns:
- builder instance
-
graphic
A builder method that invokes thesetGraphicmethod on the instance being constructed.- Returns:
- builder instance
-
independent
A builder method that invokes thesetIndependentmethod on the instance being constructed.- Returns:
- builder instance
-
indeterminate
A builder method that invokes thesetIndeterminatemethod on the instance being constructed.- Returns:
- builder instance
-
selected
A builder method that invokes thesetSelectedmethod on the instance being constructed.- Returns:
- builder instance
-
value
A builder method that invokes thesetValuemethod on the instance being constructed.- Returns:
- builder instance
-
addChildren
Calls theaddAllmethod on the ObservableList returned by theCheckBoxTreeItem#getChildren()method.- Returns:
- builder instance
-
addChildren
Calls theaddAllmethod on the ObservableList returned by theCheckBoxTreeItem#getChildren()method.- Returns:
- builder instance
-
withChildren
Creates an instance of the builder, then calls theaddAllmethod on the ObservableList returned by theCheckBoxTreeItem#getChildren()method.- Returns:
- builder instance
-
withChildren
Creates an instance of the builder, then calls theaddAllmethod on the ObservableList returned by theCheckBoxTreeItem#getChildren()method.- Returns:
- builder instance
-
expandedPropertyApply
Applies a function to theexpandedPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 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
-
independentPropertyApply
Applies a function to theindependentPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 theindeterminatePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 theleafPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 theparentPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 theselectedPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 thevaluePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.valueProperty().bind(anotherProperty)) // Use shorthand form .valuePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-