Class CellFactory<T, C extends VFXCell<T>>

java.lang.Object
io.github.palexdev.virtualizedfx.properties.CellFactory<T,C>
All Implemented Interfaces:
Observable, Property<Function<T,C>>, ReadOnlyProperty<Function<T,C>>, ObservableValue<Function<T,C>>, WritableValue<Function<T,C>>

public class CellFactory<T, C extends VFXCell<T>> extends Object implements Property<Function<T,C>>
A wrapper for cell creation functions used by virtualized containers.

Encapsulates a cell generation function (create(Object)) along with a reference to the associated VFXContainer, allowing each created cell to access the container instance upon creation. In other words, this wrapper is an easy way to provide all cells the container they belong to without radical API changes.

Basically provides a hook that invokes VFXCell.onCreated(VFXContainer) on each newly generated cell, passing the container instance to the cell. This is particularly useful when cells need contextual information from the container, such as configuration, state, selection handling.

Note 1: nothing prevents you from creating cells using the function directly, however, keep in mind that to automatically make use of the new VFXCell.onCreated(VFXContainer) hook, you must use create(Object) instead.

Note 2: for convenience this extends Property and delegates the implemented methods to the wrapped cell factory property.