Class TableViewTableViewFocusModelBuilder<S>
java.lang.Object
io.github.sosuisen.jfxbuilder.controls.TableViewTableViewFocusModelBuilder<S>
The
TableViewTableViewFocusModelBuilder class constructs instances of the TableViewFocusModel 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 TableViewFocusModel constructor
and returns an instance of the TableViewTableViewFocusModelBuilder.
You can use method chaining to call the builder methods for configuring the TableViewFocusModel.
Finally, invoke the build method to generate an instance of the TableViewFocusModel 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 TypeMethodDescriptionapply(Consumer<TableView.TableViewFocusModel<S>> func) Applies a function to the TableViewFocusModel instance being constructed.build()Builds and returns an instance of theTableViewFocusModelclass.static <S> TableViewTableViewFocusModelBuilder<S> Accepts the constructor arguments ofTableViewFocusModel(TableView)and returns an instance ofTableViewTableViewFocusModelBuilder<S>.Applies a function to thefocusedCellPropertyof the instance being constructed.Applies a function to thefocusedIndexPropertyof the instance being constructed.Applies a function to thefocusedItemPropertyof the instance being constructed.
-
Method Details
-
create
Accepts the constructor arguments ofTableViewFocusModel(TableView)and returns an instance ofTableViewTableViewFocusModelBuilder<S>.- Returns:
- an instance of the
TableViewTableViewFocusModelBuilder<S>.
-
build
Builds and returns an instance of theTableViewFocusModelclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
TableViewFocusModelclass
-
apply
public TableViewTableViewFocusModelBuilder<S> apply(Consumer<TableView.TableViewFocusModel<S>> func) Applies a function to the TableViewFocusModel instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
focusedCellPropertyApply
public TableViewTableViewFocusModelBuilder<S> focusedCellPropertyApply(Consumer<ReadOnlyObjectProperty<TablePosition>> op) Applies a function to thefocusedCellPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.focusedCellProperty().bind(anotherProperty)) // Use shorthand form .focusedCellPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
focusedIndexPropertyApply
public TableViewTableViewFocusModelBuilder<S> focusedIndexPropertyApply(Consumer<ReadOnlyIntegerProperty> op) Applies a function to thefocusedIndexPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.focusedIndexProperty().bind(anotherProperty)) // Use shorthand form .focusedIndexPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
focusedItemPropertyApply
public TableViewTableViewFocusModelBuilder<S> focusedItemPropertyApply(Consumer<ReadOnlyObjectProperty<S>> op) Applies a function to thefocusedItemPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.focusedItemProperty().bind(anotherProperty)) // Use shorthand form .focusedItemPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-