Class VFXTableSkin<T>

java.lang.Object
javafx.scene.control.SkinBase<VFXTable<T>>
io.github.palexdev.mfxcore.controls.MFXSkinBase<VFXTable<T>>
io.github.palexdev.virtualizedfx.table.VFXTableSkin<T>
All Implemented Interfaces:
Skin<VFXTable<T>>

public class VFXTableSkin<T> extends io.github.palexdev.mfxcore.controls.MFXSkinBase<VFXTable<T>>
Default skin implementation for VFXTable, extends MFXSkinBase and expects behaviors of type VFXTableManager.

The table is organized in columns, rows and cells. This architecture leads to more complex layout compared to other containers because it comprises many more nodes. The 'viewport' node wraps two Panes:

1) one contains the table's columns, can be selected in CSS as '.columns'

2) the other contains the rows, can be selected in CSS as '.rows'

The table's height and the viewport height are different here. The latter is given by the table's height minus the columns pane height, specified by VFXTable.columnsSizeProperty(). The rows are given by the VFXTable.stateProperty() and depends on the viewport's height. Each column produces one cell per row. Columns and cells are kept aligned by the layout methods defined in VFXTableHelper.

Q: Why so many nodes?

A: scrolling in a table is a bit peculiar because: vertical scrolling should affect only the rows, while horizontal scrolling should affect both rows and columns. For such reason, a clip node is set on the rows container and avoids rows overflow on vertical scroll.

As all skins typically do, this is also responsible for catching any change in the component's properties. The computation that leads to a new state is delegated to the controller/behavior, which is the VFXTableManager. Read this addListeners() to check which changes are handled.

Last but not least, by design, this skin makes the component always be at least 100px tall and wide. You can change this by overriding the DEFAULT_SIZE variable.