- Type Parameters:
T
- the type of items in the table
- All Implemented Interfaces:
io.github.palexdev.mfxcore.behavior.WithBehavior<VFXTableManager<T>>
,VFXContainer<T>
,VFXScrollable
,VFXStyleable
,javafx.css.Styleable
,javafx.event.EventTarget
,javafx.scene.control.Skinnable
Extends Control
, implements VFXContainer
, has its own skin implementation VFXTableSkin
and behavior VFXTableManager
. Uses cells of type VFXTableCell
.
This is a stateful component, meaning that every meaningful variable (position, size, cell size, etc.) will produce a new
VFXTableState
when changing. The state determines how and which items are displayed in the container.
- This container is a bit special because it's like a combination of both VFXList
and VFXGrid
.
We are displaying data in two dimensions, just like the grid, because we have both the items and the columns.
However, each item occupies a row, just like in the list. Because of such nature, this component is also more complex
to use/setup. There are three core aspects:
1) The columns: to display tabular data from a single object type, we usually want to divide such objects in data fragments, where each type belongs to a specific category. This is the columns' role, and to do this, we have to introduce the second core aspect... 2) The cell factory is not a property of the container anymore, rather, each column has its cell factory. This way, every column can build a cell that is going to extract the appropriate piece of data from the object type (e.g., User Object -> Name String). The default cell implementations have specific properties to do exactly this, so you don't really need a different cell type for each column; to be precise, you just need to set the appropriate function to extract the data and display it. However, note that the container does not force you to use such defaults, in theory, you could come up with a totally different strategy if you like. 3) The cells are not positioned directly into the viewport, rather, they are grouped in rows. So, you'll also need to specify a row factory now. By default,Last but not least, there is another peculiar feature worth mentioning. Virtualized containers are super efficient mainly for two reasons: every cell has a fixed size, because of this, it's easy to determine how many cells we need, which items to display, and thus we just create and render the needed number of nodes. The table, like the list and the grid, is no different. There are a bunch of properties to do what I just described which will be discussed more in depth below. The point is, usually, tables have fixed cell heights, but the width depends on the "parent" column. Also, they often offer the possibility of resizing columns to fit the "children" cells' content, or even the possibility of resizing each column with the mouse. In other words, to support such features, we would have no choice but to disable the virtualization on the x-axis, which means a potentially huge performance hit. For this reason, and because I strive to make things as flexible as possible for the sake of the users, I implemented two layout modesVFXDefaultTableRow
is used, you may want to extend such class and change the factory to implement missing features. As for the reasons, there are fundamentally two: i) Selection: suppose you have a selection model, you click on a cell, and you now want the entire row to be highlighted. I won't say it's impossible, but it's definitely not practical. You would have to manage every single cell in the row, and it also makes it harder to style in CSS. ii) The base classVFXTableRow
actually specifies some abstract methods that are crucial for the system to correctly manage the cells. Such methods could, in theory, be placed elsewhere, but doing it like this makes everything cleaner and easier to handle.
ColumnsLayoutMode
. I'll detail how it works below, just
know that this is only one of the many mechanisms that regulate the columns' width.
- The default behavior implementation, VFXTableManager
, can be considered as the name suggests more like
a 'manager' than an actual behavior. It is responsible for reacting to core changes in the functionalities defined here
to produce a new state.
The state can be considered as a 'picture' of the container at a certain time. Each combination of the variables that
influence the way items are shown (how many, start, end, changes in the list, etc.) will produce a specific state.
Because of how the table is designed, there are actually two kinds of states here. The first one is common to all
virtualized containers, and represents the overall state of the component, for the table it's the VFXTableState
class. The other one is specific to the table, and it's actually the VFXTableRow
class itself.
The global state tells how many rows should be present in the viewport, which items from the list (rows range)
and which "data fragments" (columns range) to display; but then each row has its sub-state, they keep the cells' list,
the columns range, and are responsible for updating the cells when needed as well as positioning and sizing them.
Of course, you are free to customize pretty much all of these mechanisms, BUT, beware, VFX components are no joke,
they are complex, make sure to read the documentation before!
- The items' list is managed automatically (permutations, insertions, removals, updates). Compared to previous
algorithms, the VFXTableManager
adopts a much simpler strategy while still trying to keep the cell updates count
as low as possible to improve performance. See VFXTableManager.onItemsChanged()
.
- The columns' list is also managed automatically. Now it's even more convenient as it's not needed to pass the table instance to the column object, rather the manager will automatically set the reference when they are added/removed from the table.
- The function used to generate the rows, called "rowFactory", can be changed anytime, even at runtime, see
VFXTableManager.onRowFactoryChanged()
.
- Core computations such as the range of rows, the range of columns, the estimated size, the layout of cells, etc.,
are delegated to a separate 'helper' class which is the VFXTableHelper
. There are two concrete implementations
for each of the ColumnsLayoutMode
. You are allowed to change the helper through the helperFactoryProperty()
.
- The vertical and horizontal positions are available through the properties hPosProperty()
and vPosProperty()
It could indeed be possible to use a single property for the position, but they are split for performance reasons.
- The virtual bounds of the container are given by two properties:
1) thevirtualMaxXProperty()
which specifies the total number of pixels on the x-axis 2) thevirtualMaxYProperty()
which specifies the total number of pixels on the y-axis
- You can access the current state through the stateProperty()
. The state gives crucial information about
the container such as the rows range, the columns range and the visible rows (by index and by item). If you'd like to observe
for changes in the displayed items, then you want to add a listener on this property. See also VFXTableState
.
- It is possible to force the viewport to update the layout by invoking requestViewportLayout()
,
although this should never be necessary as it is automatically handled by "system".
- The columns' size can be controlled through the columnsSizeProperty()
.
When using the ColumnsLayoutMode.FIXED
, every column will have the width specified by the property.
Instead, when using the other mode ColumnsLayoutMode.VARIABLE
, the value is treated as the minimum width
every column should have. The height is always the same for every column for obvious reasons.
(Make sure to also read VFXTableColumn
to learn how columns' width is managed)
The columnsLayoutModeProperty()
allows you to specify how to lay out and handle the columns.
Just like the list and the grid, the table also makes use of buffers to render a couple more rows and columns to
make the scrolling smoother. There are two buffers, one for the columns columnsBufferSizeProperty()
and one
for the rows rowsBufferSizeProperty()
. Beware, since the ColumnsLayoutMode.VARIABLE
basically disables
the virtualization alongside the x-axis, the columns' buffer won't be used, all columns will be rendered (although with
some internal optimizations).
Also, just like the list and the grid, the table makes use of caches to store rows and cells that are not needed
anymore but could be used again in the future. One cache is here (table's class) and is responsible for storing rows
(since the row factory is also here), the other is in each VFXTableColumn
and is responsible for storing cells
(since every column has its own cell factory). You can control the caches' capacity by the following properties:
rowsCacheCapacityProperty()
, VFXTableColumn.cellsCacheCapacityProperty()
.
Note 1: the cache needs to know how to generate rows/cells for the VFXCellsCache.populate()
feature to
work properly. This is automatically handled by the table and columns, their factory will always be
"shared" with their cache instances.
Note 2: by default both capacities are set to 10 cells. However, for the table's nature, such number is likely to be
too small, but it also depends from case to case. You can play around with the values and see if there's
any benefit to performance.
Other features & Details
- One of the shared features between other virtualized containers is the way layout requests are handled: by having a
read-only property needsViewportLayoutProperty()
and a way to request it requestViewportLayout()
.
However, the table handles request a bit differently. While in other containers, the property is just boolean value,
here the request is a custom class: ViewportLayoutRequest
. The reason is simple, but solves a series of
inconvenient issues. First, the request can carry a column object that can be used by layout methods to optimize the process,
thus computing only a portion of the layout, this mainly useful when using the ColumnsLayoutMode.VARIABLE
mode.
However, this is optional, meaning that if the column instance is null
, then a full layout must be issued.
Second, requests can also act as callbacks, through a boolean property one can know if the layout was actually computed
or not. This is crucial to make the autosize feature work (see below).
- The table allows you to autosize all or specific columns so that the content is fully shown. You can do so by
calling either: autosizeColumn(int)
, autosizeColumn(VFXTableColumn)
or autosizeColumns()
.
Their behavior depends on the set ColumnsLayoutMode
.
In ColumnsLayoutMode.VARIABLE
mode, columns will be resized to make their header and all their "children" cells fit the content.
In ColumnsLayoutMode.FIXED
mode, since columns can't have different size, the algorithm chooses the greatest
needed width among all the columns and then sets the columnsSizeProperty()
.
Of course, the width computation is done on the currently shown items, meaning that if you scroll and there are now
items that are even bigger than the current set width, then you'll have to autosize again.
- Columns' indexes. Since columns are stored in a list, there is not a fast way to retrieve
the index of a column from the instance itself, List.indexOf(Object)
is too slow in the context of a virtualized
container. So, the system tries to avoid as much as possible to use columns' indexes, BUT implements a mechanism to
make it much, much faster. Every VFXTableColumn
has a read-only property to store its index: VFXTableColumn.indexProperty()
.
The system automatically updates the property at layout time (see VFXTableSkin.updateColumnIndex(VFXTableColumn, int)
),
and offers a method indexOf(VFXTableColumn)
to retrieve it (it's more than just a getter!).
- Columns re-ordering/swapping. Since table's columns are nodes which are part of the viewport, adding duplicates
to the list will generate a JavaFX exception. For this reason, any time you want to make some changes to the columns'
list, that may involve having duplicates in it, it's recommended to use a temporary new list and then use 'setAll'.
VFXTableColumn
offers a utility method to swap to columns, so please use VFXTableColumn.swapColumns(VFXTable, int, int)
or VFXTableColumn.swapColumns(ObservableList, int, int)
instead of Collections.swap(List, int, int)
.
-
Property Summary
PropertiesTypePropertyDescriptionio.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<BufferSize> Specifies the number of extra cells to add to the container; they act as a buffer, allowing scroll to be smoother.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Used by the viewport's clip to set its border radius.io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<BufferSize> Specifies the number of extra columns to add to the viewport to make scrolling smoother.io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<ColumnsLayoutMode> Specifies the layout mode for the table's columns.io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty
Specifies the columns' size as aSize
object.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Specifies an extra number of pixels a column will have when it is auto-sized by theVFXTableHelper
.io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty
<ColumnsLayoutMode, VFXTableHelper<T>> Specifies the function used to build aVFXTableHelper
instance.javafx.beans.property.ReadOnlyObjectWrapper
<VFXTableHelper<T>> Specifies the instance of theVFXTableHelper
built by thehelperFactoryProperty()
.javafx.beans.property.DoubleProperty
Specifies the container's horizontal position.javafx.beans.property.ListProperty
<T> Specifies theObservableList
used to store the items.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXTableHelper.maxHScrollProperty()
.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXTableHelper.maxVScrollProperty()
.javafx.beans.property.ReadOnlyObjectProperty
<ViewportLayoutRequest<T>> Specifies whether the viewport needs to compute the layout of its content.Specifies the function used to build the table's rows.io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<BufferSize> Specifies the number of extra rows to add to the viewport to make scrolling smoother.io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty
Specifies the maximum number of rows the cache can contain at any time.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Specifies the fixed height for all the table's rows.javafx.beans.property.ReadOnlyObjectProperty
<VFXTableState<T>> Specifies the container's current state.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXTableHelper.virtualMaxXProperty()
javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXTableHelper.virtualMaxYProperty()
javafx.beans.property.DoubleProperty
Specifies the container's vertical position.Properties inherited from class io.github.palexdev.mfxcore.controls.Control
behaviorProvider
Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltip
Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
Properties inherited from class javafx.scene.Parent
needsLayout
Properties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
Properties inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainer
empty, size
-
Field Summary
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
Fields inherited from interface io.github.palexdev.virtualizedfx.base.VFXScrollable
TRACK_MULTIPLIER
-
Constructor Summary
ConstructorsConstructorDescriptionVFXTable()
VFXTable
(javafx.collections.ObservableList<T> items, Collection<VFXTableColumn<T, ? extends VFXTableCell<T>>> columns) -
Method Summary
Modifier and TypeMethodDescriptionvoid
autosizeColumn
(int index) Tries to retrieve a column from the columns' list by the given index to then delegate toautosizeColumn(VFXTableColumn)
.void
autosizeColumn
(VFXTableColumn<T, ?> column) Auto-sizes a column so that its header and all its "children" cells' content is visible.void
This will simply callautosizeColumn(VFXTableColumn)
on all the table's columns.io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<BufferSize> Specifies the number of extra cells to add to the container; they act as a buffer, allowing scroll to be smoother.protected io.github.palexdev.mfxcore.controls.SkinBase
<?, ?> int
io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Used by the viewport's clip to set its border radius.io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<BufferSize> Specifies the number of extra columns to add to the viewport to make scrolling smoother.io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<ColumnsLayoutMode> Specifies the layout mode for the table's columns.io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty
Specifies the columns' size as aSize
object.protected VFXCellsCache
<T, VFXTableRow<T>> Responsible for creating the rows' cache instance used by this container.protected Function
<ColumnsLayoutMode, VFXTableHelper<T>> protected Function
<T, VFXTableRow<T>> io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Specifies an extra number of pixels a column will have when it is auto-sized by theVFXTableHelper
.protected VFXCellsCache
<T, VFXTableRow<T>> getCache()
static List
<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> double
Gets the value of theclipBorderRadius
property.javafx.collections.ObservableList
<VFXTableColumn<T, ? extends VFXTableCell<T>>> This is the observable list containing all the table's columns.Gets the value of thecolumnsBufferSize
property.Gets the value of thecolumnsLayoutMode
property.io.github.palexdev.mfxcore.base.beans.range.IntegerRange
Delegate forVFXTableState.getColumnsRange()
io.github.palexdev.mfxcore.base.beans.Size
Gets the value of thecolumnsSize
property.protected List
<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> double
Gets the value of theextraAutosizeWidth
property.Gets the value of thehelper
property.Gets the value of thehelperFactory
property.Gets the value of therowFactory
property.Gets the value of therowsBufferSize
property.Delegate forVFXTableState.getRowsByIndexUnmodifiable()
List
<Map.Entry<T, VFXTableRow<T>>> Delegate forVFXTableState.getRowsByItemUnmodifiable()
int
Gets the value of therowsCacheCapacity
property.double
Gets the value of therowsHeight
property.io.github.palexdev.mfxcore.base.beans.range.IntegerRange
Delegate forVFXTableState.getRowsRange()
getState()
Gets the value of thestate
property.io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty
<ColumnsLayoutMode, VFXTableHelper<T>> Specifies the function used to build aVFXTableHelper
instance.javafx.beans.property.ReadOnlyObjectWrapper
<VFXTableHelper<T>> Specifies the instance of theVFXTableHelper
built by thehelperFactoryProperty()
.javafx.beans.property.DoubleProperty
Specifies the container's horizontal position.int
indexOf
(VFXTableColumn<T, ?> column) Retrieves the given column's index in the table's columns' list.boolean
Delegate forViewportLayoutRequest.isValid()
.javafx.beans.property.ListProperty
<T> Specifies theObservableList
used to store the items.Wraps this in aVFXScrollPane
to enable scrolling.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXTableHelper.maxHScrollProperty()
.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXTableHelper.maxVScrollProperty()
.javafx.beans.property.ReadOnlyObjectProperty
<ViewportLayoutRequest<T>> Specifies whether the viewport needs to compute the layout of its content.Delegate forVFXCellsCache.populate()
(on the rows' cache).Populates the rows' cache and all the table's columns' caches.void
Setter for theneedsViewportLayoutProperty()
.protected void
requestViewportLayout
(VFXTableColumn<T, ?> column) Setter for theneedsViewportLayoutProperty()
.Specifies the function used to build the table's rows.io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<BufferSize> Specifies the number of extra rows to add to the viewport to make scrolling smoother.io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty
Specifies the maximum number of rows the cache can contain at any time.int
Delegate forVFXCellsCache.size()
(on the row's cache).io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Specifies the fixed height for all the table's rows.void
scrollHorizontalBy
(double pixels) Delegate forVFXTableHelper.scrollBy(Orientation, double)
with horizontal orientation as parameter.void
scrollToColumn
(int index) Delegate forVFXTableHelper.scrollToIndex(Orientation, int)
with horizontal orientation as parameter.void
Delegate forscrollToColumn(int)
with 0 as parameter.void
Delegate forscrollToRow(int)
with 0 as parameter.void
Delegate forscrollToColumn(int)
withcolumns.size() - 1
as parameter.void
Delegate forscrollToRow(int)
withsize() - 1
as parameter.void
scrollToPixelHorizontal
(double pixel) Delegate forVFXTableHelper.scrollToPixel(Orientation, double)
with horizontal orientation as parameter.void
scrollToPixelVertical
(double pixel) Delegate forVFXTableHelper.scrollToPixel(Orientation, double)
with vertical orientation as parameter.void
scrollToRow
(int index) Delegate forVFXTableHelper.scrollToIndex(Orientation, int)
with vertical orientation as parameter.void
scrollVerticalBy
(double pixels) Delegate forVFXTableHelper.scrollBy(Orientation, double)
with vertical orientation as parameter.void
setClipBorderRadius
(double clipBorderRadius) Sets the value of theclipBorderRadius
property.void
setColumnsBufferSize
(BufferSize columnsBufferSize) Sets the value of thecolumnsBufferSize
property.void
setColumnsHeight
(double h) Convenience method to create a newSize
object and set thecolumnsSizeProperty()
.void
setColumnsLayoutMode
(ColumnsLayoutMode columnsLayoutMode) Sets the value of thecolumnsLayoutMode
property.void
setColumnsSize
(double w, double h) Convenience method to create a newSize
object and set thecolumnsSizeProperty()
.void
setColumnsSize
(io.github.palexdev.mfxcore.base.beans.Size columnsSize) Sets the value of thecolumnsSize
property.void
setColumnsWidth
(double w) Convenience method to create a newSize
object and set thecolumnsSizeProperty()
.void
setExtraAutosizeWidth
(double extraAutosizeWidth) Sets the value of theextraAutosizeWidth
property.void
setHelper
(VFXTableHelper<T> helper) Sets the value of thehelper
property.void
setHelperFactory
(Function<ColumnsLayoutMode, VFXTableHelper<T>> helperFactory) Sets the value of thehelperFactory
property.protected void
setNeedsViewportLayout
(ViewportLayoutRequest needsViewportLayout) Sets the value of theneedsViewportLayout
property.void
setRowFactory
(Function<T, VFXTableRow<T>> rowFactory) Sets the value of therowFactory
property.void
setRowsBufferSize
(BufferSize rowsBufferSize) Sets the value of therowsBufferSize
property.void
setRowsCacheCapacity
(int rowsCacheCapacity) Sets the value of therowsCacheCapacity
property.void
setRowsHeight
(double rowsHeight) Sets the value of therowsHeight
property.protected void
setState
(VFXTableState<T> state) Sets the value of thestate
property.javafx.beans.property.ReadOnlyObjectProperty
<VFXTableState<T>> Specifies the container's current state.void
Convenience method to switch the table'sColumnsLayoutMode
.void
update
(int... indexes) This method should be used by implementations to "manually" update the container.protected void
update
(VFXTableState<T> state) Setter for thestateProperty()
.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXTableHelper.virtualMaxXProperty()
javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXTableHelper.virtualMaxYProperty()
javafx.beans.property.DoubleProperty
Specifies the container's vertical position.Methods inherited from class io.github.palexdev.mfxcore.controls.Control
behaviorProviderProperty, changeSkin, createDefaultSkin, getBehavior, getBehaviorProvider, sceneBuilderIntegration, setBehaviorProvider
Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
Methods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javafx.css.Styleable
getStyleableNode
Methods inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainer
emptyProperty, getBufferSize, getHPos, getItems, getMaxHScroll, getMaxVScroll, getVirtualMaxX, getVirtualMaxY, getVPos, isEmpty, setBufferSize, setHPos, setItems, setVPos, size, sizeProperty
Methods inherited from interface io.github.palexdev.mfxcore.behavior.WithBehavior
setDefaultBehaviorProvider
-
Property Details
-
virtualMaxX
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXPropertyDelegate forVFXTableHelper.virtualMaxXProperty()
- Specified by:
virtualMaxXProperty
in interfaceVFXContainer<T>
- Returns:
- the
virtualMaxX
property - See Also:
-
virtualMaxY
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYPropertyDelegate forVFXTableHelper.virtualMaxYProperty()
- Specified by:
virtualMaxYProperty
in interfaceVFXContainer<T>
- Returns:
- the
virtualMaxY
property - See Also:
-
maxVScroll
public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollPropertyDelegate forVFXTableHelper.maxVScrollProperty()
.- Specified by:
maxVScrollProperty
in interfaceVFXContainer<T>
- Returns:
- the
maxVScroll
property - See Also:
-
maxHScroll
public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollPropertyDelegate forVFXTableHelper.maxHScrollProperty()
.- Specified by:
maxHScrollProperty
in interfaceVFXContainer<T>
- Returns:
- the
maxHScroll
property - See Also:
-
bufferSize
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<BufferSize> bufferSizePropertySpecifies the number of extra cells to add to the container; they act as a buffer, allowing scroll to be smoother. To avoid edge cases due to the users abusing the system, this is done by using an enumerator which allows up to three buffer cells. For the table this is a delegate torowsCacheCapacityProperty()
, so that it can honor theVFXContainer
API.- Specified by:
bufferSizeProperty
in interfaceVFXContainer<T>
- Returns:
- the
bufferSize
property - See Also:
-
rowsHeight
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty rowsHeightPropertySpecifies the fixed height for all the table's rows.Note that the default
VFXTableHelper
implementations will also set the cells' height to this value, however you can modify such behavior if needed by providing your custom implementation through thehelperFactoryProperty()
.Can be set in CSS via the property: '-vfx-rows-height'.
- See Also:
-
columnsSize
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty columnsSizePropertySpecifies the columns' size as aSize
object.Note that the width specified by this property will be used differently depending on the
ColumnsLayoutMode
. InFIXED
mode, all columns will have the same width and height specified by theSize
object. InVARIABLE
mode, the width value will be used as the minimum width all columns must have. This behavior can also be modified as it is defined by the defaultVFXTableHelper
implementations.Can be set in CSS via the property: '-vfx-columns-size'.
- See Also:
-
columnsLayoutMode
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<ColumnsLayoutMode> columnsLayoutModePropertySpecifies the layout mode for the table's columns. SeeColumnsLayoutMode
.Can be set in CSS via the property: '-vfx-columns-layout-mode'.
- See Also:
-
extraAutosizeWidth
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty extraAutosizeWidthPropertySpecifies an extra number of pixels a column will have when it is auto-sized by theVFXTableHelper
.In some occasions auto-sizing all the columns may result in the text of each cell being very close to each other, which is rather unpleasant to see. This extra amount acts like a "spacing" property between the columns when auto-sizing.
Can be set in CSS via the property: '-fx-extra-autosize-width'.- See Also:
-
columnsBufferSize
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<BufferSize> columnsBufferSizePropertySpecifies the number of extra columns to add to the viewport to make scrolling smoother. See alsoVFXContainer.bufferSizeProperty()
andVFXTableHelper.totalRows()
Can be set in CSS via the property: '-vfx-columns-buffer-size'.
- See Also:
-
rowsBufferSize
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<BufferSize> rowsBufferSizePropertySpecifies the number of extra rows to add to the viewport to make scrolling smoother. See alsoVFXContainer.bufferSizeProperty()
andVFXTableHelper.totalRows()
.Can be set in CSS via the property: '-vfx-columns-buffer-size'.
- See Also:
-
clipBorderRadius
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty clipBorderRadiusPropertyUsed by the viewport's clip to set its border radius. This is useful when you want to make a rounded container, this prevents the content from going outside the view. Side note: the clip is aRectangle
, now for some fucking reason, the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So, for a border radius of 5, you want this value to be at least 10/13.Can be set in CSS via the property: '-vfx-clip-border-radius'.
- See Also:
-
rowsCacheCapacity
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty rowsCacheCapacityPropertySpecifies the maximum number of rows the cache can contain at any time. Excess will not be added to the queue and disposed immediately.Can be set in CSS via the property: '-vfx-rows-cache-capacity'.
- See Also:
-
items
- Specified by:
itemsProperty
in interfaceVFXContainer<T>
- Returns:
- the
items
property - See Also:
-
rowFactory
Specifies the function used to build the table's rows. See alsodefaultRowFactory()
.- See Also:
-
helper
Specifies the instance of theVFXTableHelper
built by thehelperFactoryProperty()
.- See Also:
-
helperFactory
public io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<ColumnsLayoutMode,VFXTableHelper<T>> helperFactoryPropertySpecifies the function used to build aVFXTableHelper
instance. See alsodefaultHelperFactory()
.- See Also:
-
vPos
public javafx.beans.property.DoubleProperty vPosProperty- Specified by:
vPosProperty
in interfaceVFXContainer<T>
- Returns:
- the
vPos
property - See Also:
-
hPos
public javafx.beans.property.DoubleProperty hPosProperty- Specified by:
hPosProperty
in interfaceVFXContainer<T>
- Returns:
- the
hPos
property - See Also:
-
state
Specifies the container's current state. The state carries useful information such as the range of rows and columns and the rows ordered by index, or by item (not ordered).- See Also:
-
needsViewportLayout
public javafx.beans.property.ReadOnlyObjectProperty<ViewportLayoutRequest<T>> needsViewportLayoutPropertySpecifies whether the viewport needs to compute the layout of its content.Since this is read-only, layout requests must be sent by using
requestViewportLayout()
.- See Also:
-
-
Constructor Details
-
VFXTable
public VFXTable() -
VFXTable
-
VFXTable
public VFXTable(javafx.collections.ObservableList<T> items, Collection<VFXTableColumn<T, ? extends VFXTableCell<T>>> columns)
-
-
Method Details
-
autosizeColumn
public void autosizeColumn(int index) Tries to retrieve a column from the columns' list by the given index to then delegate toautosizeColumn(VFXTableColumn)
. -
autosizeColumn
Auto-sizes a column so that its header and all its "children" cells' content is visible. The actual resize is delegated to the helper:VFXTableHelper.autosizeColumn(VFXTableColumn)
.Note: this operation is peculiar in the sense that there are a few conditions to meet before the actual resize is done. You see, to compute the maximum width to allow the content to fit, first the table, the columns and the cells must have been laid out at least one time. So, if, when calling this method, the last layout request was not processed (
ViewportLayoutRequest.wasDone()
), the operation is delayed, and will run as soon as the condition is met. To be precise, the operation could still be delayed, the other conditions are defined in the helper, seeVFXTableHelper.autosizeColumn(VFXTableColumn)
. -
autosizeColumns
public void autosizeColumns()This will simply callautosizeColumn(VFXTableColumn)
on all the table's columns. To be precise, the actual operation is delegated to the helper:VFXTableHelper.autosizeColumns()
.Just like
autosizeColumn(VFXTableColumn)
, the operation could be delayed if the last layout request was not processedViewportLayoutRequest.wasDone()
at the time calling this. -
indexOf
Retrieves the given column's index in the table's columns' list.Since every
VFXTableColumn
has its index as a property,VFXTableColumn.indexProperty()
, this method will simply invoke the related getter. However, if the returned index is invalid (< 0), then it resorts toList.indexOf(Object)
which is much slower. The good thing is that if it resorts to the latter, then it also updates the column's index property, so that the next time the index will be available through the property. -
update
Setter for thestateProperty()
. -
createCache
Responsible for creating the rows' cache instance used by this container.- See Also:
-
defaultRowFactory
- Returns:
- the default function used to build rows. Uses
VFXDefaultTableRow
.
-
defaultHelperFactory
- Returns:
- the default function used to build a
VFXTableHelper
.
-
requestViewportLayout
public void requestViewportLayout()Setter for theneedsViewportLayoutProperty()
. This sets the property toViewportLayoutRequest.EMPTY
, causing the default skin to recompute the entire layout. -
requestViewportLayout
Setter for theneedsViewportLayoutProperty()
. This sets the property to a newViewportLayoutRequest
with the given column, causing the default skin to recompute only a portion of the layout. -
update
public void update(int... indexes) This method should be used by implementations to "manually" update the container.This can be useful when working with models that do not use JavaFX properties.
Note: the
indexes
var-arg parameter can be used to specify which cells need to be updated. An empty array should update all of them.More details: some cells may use an update mechanism which relies on property invalidation. Follow this example to better understand what I mean:
// Let's say I have a User class with 'firstName' and 'lastName' fields (we also have both getters and setters) // Now, let's assume I have a UserCell class used by the VFXContainer to display User objects (in a label for example) // This is a part of its implementation... public class UserCell extends Label implements VFXCell<User> { private final ObjectProperty<User> item = new SimpleObjectProperty<>() { @Overridden protected void invalidated() { update(); } }; protected void update() { // This will update the cell's text based on the current item } } // Remember, the 'invalidated()' method is called only when the reference changes, because internally it does not // check for equality but for identity // Now let's say I want to change a User's 'lastName' field like this... container.getItems().get(i).setLastName("NewLastName"); // Question: how can we tell the cell to force the update? // There are two possible ways... // 1) For the invalidation to occur, we first set the item property to 'null', and then back to the old value // 2) We use an event-based mechanism to tell cells to force update themselves. This solution requires cells to // subscribe to such events to support "manual" updates // Solution 2 is more flexible, see VFXContainerEvent class
- Specified by:
update
in interfaceVFXContainer<T>
- See Also:
-
buildSkin
protected io.github.palexdev.mfxcore.controls.SkinBase<?,?> buildSkin()- Specified by:
buildSkin
in classio.github.palexdev.mfxcore.controls.Control<VFXTableManager<T>>
-
defaultBehaviorProvider
- Specified by:
defaultBehaviorProvider
in interfaceio.github.palexdev.mfxcore.behavior.WithBehavior<T>
-
defaultStyleClasses
- Specified by:
defaultStyleClasses
in interfaceVFXStyleable
- Returns:
- a list containing all the component's default style classes
-
makeScrollable
Description copied from interface:VFXScrollable
Wraps this in aVFXScrollPane
to enable scrolling.- Specified by:
makeScrollable
in interfaceVFXScrollable
-
populateCache
Delegate forVFXCellsCache.populate()
(on the rows' cache).- See Also:
-
populateCacheAll
Populates the rows' cache and all the table's columns' caches.- See Also:
-
rowsCacheSize
public int rowsCacheSize()Delegate forVFXCellsCache.size()
(on the row's cache). -
cellsCacheSize
public int cellsCacheSize()- Returns:
- the total number of cached cells by iterating over
getColumns()
.
-
getRowsRange
public io.github.palexdev.mfxcore.base.beans.range.IntegerRange getRowsRange()Delegate forVFXTableState.getRowsRange()
-
getColumnsRange
public io.github.palexdev.mfxcore.base.beans.range.IntegerRange getColumnsRange()Delegate forVFXTableState.getColumnsRange()
-
getRowsByIndexUnmodifiable
Delegate forVFXTableState.getRowsByIndexUnmodifiable()
-
getRowsByItemUnmodifiable
Delegate forVFXTableState.getRowsByItemUnmodifiable()
-
virtualMaxXProperty
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXProperty()Delegate forVFXTableHelper.virtualMaxXProperty()
- Specified by:
virtualMaxXProperty
in interfaceVFXContainer<T>
- Returns:
- the
virtualMaxX
property - See Also:
-
virtualMaxYProperty
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYProperty()Delegate forVFXTableHelper.virtualMaxYProperty()
- Specified by:
virtualMaxYProperty
in interfaceVFXContainer<T>
- Returns:
- the
virtualMaxY
property - See Also:
-
maxVScrollProperty
public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollProperty()Delegate forVFXTableHelper.maxVScrollProperty()
.- Specified by:
maxVScrollProperty
in interfaceVFXContainer<T>
- Returns:
- the
maxVScroll
property - See Also:
-
maxHScrollProperty
public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollProperty()Delegate forVFXTableHelper.maxHScrollProperty()
.- Specified by:
maxHScrollProperty
in interfaceVFXContainer<T>
- Returns:
- the
maxHScroll
property - See Also:
-
bufferSizeProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<BufferSize> bufferSizeProperty()Specifies the number of extra cells to add to the container; they act as a buffer, allowing scroll to be smoother. To avoid edge cases due to the users abusing the system, this is done by using an enumerator which allows up to three buffer cells. For the table this is a delegate torowsCacheCapacityProperty()
, so that it can honor theVFXContainer
API.- Specified by:
bufferSizeProperty
in interfaceVFXContainer<T>
- Returns:
- the
bufferSize
property - See Also:
-
scrollVerticalBy
public void scrollVerticalBy(double pixels) Delegate forVFXTableHelper.scrollBy(Orientation, double)
with vertical orientation as parameter. -
scrollHorizontalBy
public void scrollHorizontalBy(double pixels) Delegate forVFXTableHelper.scrollBy(Orientation, double)
with horizontal orientation as parameter. -
scrollToPixelVertical
public void scrollToPixelVertical(double pixel) Delegate forVFXTableHelper.scrollToPixel(Orientation, double)
with vertical orientation as parameter. -
scrollToPixelHorizontal
public void scrollToPixelHorizontal(double pixel) Delegate forVFXTableHelper.scrollToPixel(Orientation, double)
with horizontal orientation as parameter. -
scrollToRow
public void scrollToRow(int index) Delegate forVFXTableHelper.scrollToIndex(Orientation, int)
with vertical orientation as parameter. -
scrollToColumn
public void scrollToColumn(int index) Delegate forVFXTableHelper.scrollToIndex(Orientation, int)
with horizontal orientation as parameter. -
scrollToFirstRow
public void scrollToFirstRow()Delegate forscrollToRow(int)
with 0 as parameter. -
scrollToLastRow
public void scrollToLastRow()Delegate forscrollToRow(int)
withsize() - 1
as parameter. -
scrollToFirstColumn
public void scrollToFirstColumn()Delegate forscrollToColumn(int)
with 0 as parameter. -
scrollToLastColumn
public void scrollToLastColumn()Delegate forscrollToColumn(int)
withcolumns.size() - 1
as parameter. -
getRowsHeight
public double getRowsHeight()Gets the value of therowsHeight
property.- Property description:
- Specifies the fixed height for all the table's rows.
Note that the default
VFXTableHelper
implementations will also set the cells' height to this value, however you can modify such behavior if needed by providing your custom implementation through thehelperFactoryProperty()
.Can be set in CSS via the property: '-vfx-rows-height'.
- Returns:
- the value of the
rowsHeight
property - See Also:
-
rowsHeightProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty rowsHeightProperty()Specifies the fixed height for all the table's rows.Note that the default
VFXTableHelper
implementations will also set the cells' height to this value, however you can modify such behavior if needed by providing your custom implementation through thehelperFactoryProperty()
.Can be set in CSS via the property: '-vfx-rows-height'.
- Returns:
- the
rowsHeight
property - See Also:
-
setRowsHeight
public void setRowsHeight(double rowsHeight) Sets the value of therowsHeight
property.- Property description:
- Specifies the fixed height for all the table's rows.
Note that the default
VFXTableHelper
implementations will also set the cells' height to this value, however you can modify such behavior if needed by providing your custom implementation through thehelperFactoryProperty()
.Can be set in CSS via the property: '-vfx-rows-height'.
- Parameters:
rowsHeight
- the value for therowsHeight
property- See Also:
-
getColumnsSize
public io.github.palexdev.mfxcore.base.beans.Size getColumnsSize()Gets the value of thecolumnsSize
property.- Property description:
- Specifies the columns' size as a
Size
object.Note that the width specified by this property will be used differently depending on the
ColumnsLayoutMode
. InFIXED
mode, all columns will have the same width and height specified by theSize
object. InVARIABLE
mode, the width value will be used as the minimum width all columns must have. This behavior can also be modified as it is defined by the defaultVFXTableHelper
implementations.Can be set in CSS via the property: '-vfx-columns-size'.
- Returns:
- the value of the
columnsSize
property - See Also:
-
columnsSizeProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty columnsSizeProperty()Specifies the columns' size as aSize
object.Note that the width specified by this property will be used differently depending on the
ColumnsLayoutMode
. InFIXED
mode, all columns will have the same width and height specified by theSize
object. InVARIABLE
mode, the width value will be used as the minimum width all columns must have. This behavior can also be modified as it is defined by the defaultVFXTableHelper
implementations.Can be set in CSS via the property: '-vfx-columns-size'.
- Returns:
- the
columnsSize
property - See Also:
-
setColumnsSize
public void setColumnsSize(io.github.palexdev.mfxcore.base.beans.Size columnsSize) Sets the value of thecolumnsSize
property.- Property description:
- Specifies the columns' size as a
Size
object.Note that the width specified by this property will be used differently depending on the
ColumnsLayoutMode
. InFIXED
mode, all columns will have the same width and height specified by theSize
object. InVARIABLE
mode, the width value will be used as the minimum width all columns must have. This behavior can also be modified as it is defined by the defaultVFXTableHelper
implementations.Can be set in CSS via the property: '-vfx-columns-size'.
- Parameters:
columnsSize
- the value for thecolumnsSize
property- See Also:
-
setColumnsSize
public void setColumnsSize(double w, double h) Convenience method to create a newSize
object and set thecolumnsSizeProperty()
. -
setColumnsWidth
public void setColumnsWidth(double w) Convenience method to create a newSize
object and set thecolumnsSizeProperty()
. The old height will be kept. -
setColumnsHeight
public void setColumnsHeight(double h) Convenience method to create a newSize
object and set thecolumnsSizeProperty()
. The old width will be kept. -
getColumnsLayoutMode
Gets the value of thecolumnsLayoutMode
property.- Property description:
- Specifies the layout mode for the table's columns. See
ColumnsLayoutMode
.Can be set in CSS via the property: '-vfx-columns-layout-mode'.
- Returns:
- the value of the
columnsLayoutMode
property - See Also:
-
columnsLayoutModeProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<ColumnsLayoutMode> columnsLayoutModeProperty()Specifies the layout mode for the table's columns. SeeColumnsLayoutMode
.Can be set in CSS via the property: '-vfx-columns-layout-mode'.
- Returns:
- the
columnsLayoutMode
property - See Also:
-
setColumnsLayoutMode
Sets the value of thecolumnsLayoutMode
property.- Property description:
- Specifies the layout mode for the table's columns. See
ColumnsLayoutMode
.Can be set in CSS via the property: '-vfx-columns-layout-mode'.
- Parameters:
columnsLayoutMode
- the value for thecolumnsLayoutMode
property- See Also:
-
switchColumnsLayoutMode
public void switchColumnsLayoutMode()Convenience method to switch the table'sColumnsLayoutMode
. -
getExtraAutosizeWidth
public double getExtraAutosizeWidth()Gets the value of theextraAutosizeWidth
property.- Property description:
- Specifies an extra number of pixels a column will have when it is auto-sized by the
VFXTableHelper
.In some occasions auto-sizing all the columns may result in the text of each cell being very close to each other, which is rather unpleasant to see. This extra amount acts like a "spacing" property between the columns when auto-sizing.
Can be set in CSS via the property: '-fx-extra-autosize-width'. - Returns:
- the value of the
extraAutosizeWidth
property - See Also:
-
extraAutosizeWidthProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty extraAutosizeWidthProperty()Specifies an extra number of pixels a column will have when it is auto-sized by theVFXTableHelper
.In some occasions auto-sizing all the columns may result in the text of each cell being very close to each other, which is rather unpleasant to see. This extra amount acts like a "spacing" property between the columns when auto-sizing.
Can be set in CSS via the property: '-fx-extra-autosize-width'.- Returns:
- the
extraAutosizeWidth
property - See Also:
-
setExtraAutosizeWidth
public void setExtraAutosizeWidth(double extraAutosizeWidth) Sets the value of theextraAutosizeWidth
property.- Property description:
- Specifies an extra number of pixels a column will have when it is auto-sized by the
VFXTableHelper
.In some occasions auto-sizing all the columns may result in the text of each cell being very close to each other, which is rather unpleasant to see. This extra amount acts like a "spacing" property between the columns when auto-sizing.
Can be set in CSS via the property: '-fx-extra-autosize-width'. - Parameters:
extraAutosizeWidth
- the value for theextraAutosizeWidth
property- See Also:
-
getColumnsBufferSize
Gets the value of thecolumnsBufferSize
property.- Property description:
- Specifies the number of extra columns to add to the viewport to make scrolling smoother.
See also
VFXContainer.bufferSizeProperty()
andVFXTableHelper.totalRows()
Can be set in CSS via the property: '-vfx-columns-buffer-size'.
- Returns:
- the value of the
columnsBufferSize
property - See Also:
-
columnsBufferSizeProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<BufferSize> columnsBufferSizeProperty()Specifies the number of extra columns to add to the viewport to make scrolling smoother. See alsoVFXContainer.bufferSizeProperty()
andVFXTableHelper.totalRows()
Can be set in CSS via the property: '-vfx-columns-buffer-size'.
- Returns:
- the
columnsBufferSize
property - See Also:
-
setColumnsBufferSize
Sets the value of thecolumnsBufferSize
property.- Property description:
- Specifies the number of extra columns to add to the viewport to make scrolling smoother.
See also
VFXContainer.bufferSizeProperty()
andVFXTableHelper.totalRows()
Can be set in CSS via the property: '-vfx-columns-buffer-size'.
- Parameters:
columnsBufferSize
- the value for thecolumnsBufferSize
property- See Also:
-
getRowsBufferSize
Gets the value of therowsBufferSize
property.- Property description:
- Specifies the number of extra rows to add to the viewport to make scrolling smoother.
See also
VFXContainer.bufferSizeProperty()
andVFXTableHelper.totalRows()
.Can be set in CSS via the property: '-vfx-columns-buffer-size'.
- Returns:
- the value of the
rowsBufferSize
property - See Also:
-
rowsBufferSizeProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<BufferSize> rowsBufferSizeProperty()Specifies the number of extra rows to add to the viewport to make scrolling smoother. See alsoVFXContainer.bufferSizeProperty()
andVFXTableHelper.totalRows()
.Can be set in CSS via the property: '-vfx-columns-buffer-size'.
- Returns:
- the
rowsBufferSize
property - See Also:
-
setRowsBufferSize
Sets the value of therowsBufferSize
property.- Property description:
- Specifies the number of extra rows to add to the viewport to make scrolling smoother.
See also
VFXContainer.bufferSizeProperty()
andVFXTableHelper.totalRows()
.Can be set in CSS via the property: '-vfx-columns-buffer-size'.
- Parameters:
rowsBufferSize
- the value for therowsBufferSize
property- See Also:
-
getClipBorderRadius
public double getClipBorderRadius()Gets the value of theclipBorderRadius
property.- Property description:
- Used by the viewport's clip to set its border radius.
This is useful when you want to make a rounded container, this prevents the content from going outside the view.
Side note: the clip is a
Rectangle
, now for some fucking reason, the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So, for a border radius of 5, you want this value to be at least 10/13.Can be set in CSS via the property: '-vfx-clip-border-radius'.
- Returns:
- the value of the
clipBorderRadius
property - See Also:
-
clipBorderRadiusProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty clipBorderRadiusProperty()Used by the viewport's clip to set its border radius. This is useful when you want to make a rounded container, this prevents the content from going outside the view. Side note: the clip is aRectangle
, now for some fucking reason, the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So, for a border radius of 5, you want this value to be at least 10/13.Can be set in CSS via the property: '-vfx-clip-border-radius'.
- Returns:
- the
clipBorderRadius
property - See Also:
-
setClipBorderRadius
public void setClipBorderRadius(double clipBorderRadius) Sets the value of theclipBorderRadius
property.- Property description:
- Used by the viewport's clip to set its border radius.
This is useful when you want to make a rounded container, this prevents the content from going outside the view.
Side note: the clip is a
Rectangle
, now for some fucking reason, the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So, for a border radius of 5, you want this value to be at least 10/13.Can be set in CSS via the property: '-vfx-clip-border-radius'.
- Parameters:
clipBorderRadius
- the value for theclipBorderRadius
property- See Also:
-
getRowsCacheCapacity
public int getRowsCacheCapacity()Gets the value of therowsCacheCapacity
property.- Property description:
- Specifies the maximum number of rows the cache can contain at any time. Excess will not be added to the queue and
disposed immediately.
Can be set in CSS via the property: '-vfx-rows-cache-capacity'.
- Returns:
- the value of the
rowsCacheCapacity
property - See Also:
-
rowsCacheCapacityProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty rowsCacheCapacityProperty()Specifies the maximum number of rows the cache can contain at any time. Excess will not be added to the queue and disposed immediately.Can be set in CSS via the property: '-vfx-rows-cache-capacity'.
- Returns:
- the
rowsCacheCapacity
property - See Also:
-
setRowsCacheCapacity
public void setRowsCacheCapacity(int rowsCacheCapacity) Sets the value of therowsCacheCapacity
property.- Property description:
- Specifies the maximum number of rows the cache can contain at any time. Excess will not be added to the queue and
disposed immediately.
Can be set in CSS via the property: '-vfx-rows-cache-capacity'.
- Parameters:
rowsCacheCapacity
- the value for therowsCacheCapacity
property- See Also:
-
getControlCssMetaData
- Overrides:
getControlCssMetaData
in classjavafx.scene.control.Control
-
getClassCssMetaData
-
getCache
- Returns:
- the rows' cache instance used by this container
-
itemsProperty
Description copied from interface:VFXContainer
Specifies theObservableList
used to store the items.We use a
ListProperty
because it offers many commodities such as both the size and emptiness of the list as observable properties, as well as the possibility of adding anInvalidationListener
that will both inform about changes of the property and in the list.- Specified by:
itemsProperty
in interfaceVFXContainer<T>
- Returns:
- the
items
property - See Also:
-
getRowFactory
Gets the value of therowFactory
property.- Property description:
- Specifies the function used to build the table's rows.
See also
defaultRowFactory()
. - Returns:
- the value of the
rowFactory
property - See Also:
-
rowFactoryProperty
Specifies the function used to build the table's rows. See alsodefaultRowFactory()
.- Returns:
- the
rowFactory
property - See Also:
-
setRowFactory
Sets the value of therowFactory
property.- Property description:
- Specifies the function used to build the table's rows.
See also
defaultRowFactory()
. - Parameters:
rowFactory
- the value for therowFactory
property- See Also:
-
getColumns
This is the observable list containing all the table's columns. -
getHelper
Gets the value of thehelper
property.- Property description:
- Specifies the instance of the
VFXTableHelper
built by thehelperFactoryProperty()
. - Returns:
- the value of the
helper
property - See Also:
-
helperProperty
Specifies the instance of theVFXTableHelper
built by thehelperFactoryProperty()
.- Returns:
- the
helper
property - See Also:
-
setHelper
Sets the value of thehelper
property.- Property description:
- Specifies the instance of the
VFXTableHelper
built by thehelperFactoryProperty()
. - Parameters:
helper
- the value for thehelper
property- See Also:
-
getHelperFactory
Gets the value of thehelperFactory
property.- Property description:
- Specifies the function used to build a
VFXTableHelper
instance. See alsodefaultHelperFactory()
. - Returns:
- the value of the
helperFactory
property - See Also:
-
helperFactoryProperty
public io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<ColumnsLayoutMode,VFXTableHelper<T>> helperFactoryProperty()Specifies the function used to build aVFXTableHelper
instance. See alsodefaultHelperFactory()
.- Returns:
- the
helperFactory
property - See Also:
-
setHelperFactory
Sets the value of thehelperFactory
property.- Property description:
- Specifies the function used to build a
VFXTableHelper
instance. See alsodefaultHelperFactory()
. - Parameters:
helperFactory
- the value for thehelperFactory
property- See Also:
-
vPosProperty
public javafx.beans.property.DoubleProperty vPosProperty()Description copied from interface:VFXContainer
Specifies the container's vertical position.- Specified by:
vPosProperty
in interfaceVFXContainer<T>
- Returns:
- the
vPos
property - See Also:
-
hPosProperty
public javafx.beans.property.DoubleProperty hPosProperty()Description copied from interface:VFXContainer
Specifies the container's horizontal position.- Specified by:
hPosProperty
in interfaceVFXContainer<T>
- Returns:
- the
hPos
property - See Also:
-
getState
Gets the value of thestate
property.- Property description:
- Specifies the container's current state. The state carries useful information such as the range of rows and columns and the rows ordered by index, or by item (not ordered).
- Returns:
- the value of the
state
property - See Also:
-
stateProperty
Specifies the container's current state. The state carries useful information such as the range of rows and columns and the rows ordered by index, or by item (not ordered).- Returns:
- the
state
property - See Also:
-
setState
Sets the value of thestate
property.- Property description:
- Specifies the container's current state. The state carries useful information such as the range of rows and columns and the rows ordered by index, or by item (not ordered).
- Parameters:
state
- the value for thestate
property- See Also:
-
isNeedsViewportLayout
public boolean isNeedsViewportLayout()Delegate forViewportLayoutRequest.isValid()
. -
getViewportLayoutRequest
-
needsViewportLayoutProperty
public javafx.beans.property.ReadOnlyObjectProperty<ViewportLayoutRequest<T>> needsViewportLayoutProperty()Specifies whether the viewport needs to compute the layout of its content.Since this is read-only, layout requests must be sent by using
requestViewportLayout()
.- Returns:
- the
needsViewportLayout
property - See Also:
-
setNeedsViewportLayout
Sets the value of theneedsViewportLayout
property.- Property description:
- Specifies whether the viewport needs to compute the layout of its content.
Since this is read-only, layout requests must be sent by using
requestViewportLayout()
. - Parameters:
needsViewportLayout
- the value for theneedsViewportLayout
property- See Also:
-