Class VFXTable<T>

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
io.github.palexdev.mfxcore.controls.Control<VFXTableManager<T>>
io.github.palexdev.virtualizedfx.table.VFXTable<T>
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

public class VFXTable<T> extends io.github.palexdev.mfxcore.controls.Control<VFXTableManager<T>> implements VFXContainer<T>, VFXStyleable, VFXScrollable
Implementation of a virtualized container to show a list of items as tabular data. The default style class is: '.vfx-table'.

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.

Core features & Implementation Details

- 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, VFXDefaultTableRow 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 class VFXTableRow 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.
 
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 modes 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) the virtualMaxXProperty() which specifies the total number of pixels on the x-axis
     2) the virtualMaxYProperty() 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

    Properties
    Type
    Property
    Description
    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.
    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 a Size 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 the VFXTableHelper.
    io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<ColumnsLayoutMode,VFXTableHelper<T>>
    Specifies the function used to build a VFXTableHelper instance.
    javafx.beans.property.ReadOnlyObjectWrapper<VFXTableHelper<T>>
    Specifies the instance of the VFXTableHelper built by the helperFactoryProperty().
    javafx.beans.property.DoubleProperty
    Specifies the container's horizontal position.
    javafx.beans.property.ListProperty<T>
    Specifies the ObservableList used to store the items.
    javafx.beans.property.ReadOnlyDoubleProperty
    javafx.beans.property.ReadOnlyDoubleProperty
    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
    javafx.beans.property.ReadOnlyDoubleProperty
    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

    Constructors
    Constructor
    Description
     
    VFXTable(javafx.collections.ObservableList<T> items)
     
    VFXTable(javafx.collections.ObservableList<T> items, Collection<VFXTableColumn<T,? extends VFXTableCell<T>>> columns)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    autosizeColumn(int index)
    Tries to retrieve a column from the columns' list by the given index to then delegate to autosizeColumn(VFXTableColumn).
    void
    Auto-sizes a column so that its header and all its "children" cells' content is visible.
    void
    This will simply call autosizeColumn(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 a Size object.
    Responsible for creating the rows' cache instance used by this container.
     
     
    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 the VFXTableHelper.
     
    static List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>>
     
    double
    Gets the value of the clipBorderRadius property.
    javafx.collections.ObservableList<VFXTableColumn<T,? extends VFXTableCell<T>>>
    This is the observable list containing all the table's columns.
    Gets the value of the columnsBufferSize property.
    Gets the value of the columnsLayoutMode property.
    io.github.palexdev.mfxcore.base.beans.range.IntegerRange
    io.github.palexdev.mfxcore.base.beans.Size
    Gets the value of the columnsSize property.
    protected List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>>
     
    double
    Gets the value of the extraAutosizeWidth property.
    Gets the value of the helper property.
    Gets the value of the helperFactory property.
    Gets the value of the rowFactory property.
    Gets the value of the rowsBufferSize property.
    int
    Gets the value of the rowsCacheCapacity property.
    double
    Gets the value of the rowsHeight property.
    io.github.palexdev.mfxcore.base.beans.range.IntegerRange
    Gets the value of the state property.
     
    io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<ColumnsLayoutMode,VFXTableHelper<T>>
    Specifies the function used to build a VFXTableHelper instance.
    javafx.beans.property.ReadOnlyObjectWrapper<VFXTableHelper<T>>
    Specifies the instance of the VFXTableHelper built by the helperFactoryProperty().
    javafx.beans.property.DoubleProperty
    Specifies the container's horizontal position.
    int
    Retrieves the given column's index in the table's columns' list.
    boolean
    javafx.beans.property.ListProperty<T>
    Specifies the ObservableList used to store the items.
    Wraps this in a VFXScrollPane to enable scrolling.
    javafx.beans.property.ReadOnlyDoubleProperty
    javafx.beans.property.ReadOnlyDoubleProperty
    javafx.beans.property.ReadOnlyObjectProperty<ViewportLayoutRequest<T>>
    Specifies whether the viewport needs to compute the layout of its content.
    Delegate for VFXCellsCache.populate() (on the rows' cache).
    Populates the rows' cache and all the table's columns' caches.
    void
    protected void
    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 for VFXCellsCache.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 for VFXTableHelper.scrollBy(Orientation, double) with horizontal orientation as parameter.
    void
    scrollToColumn(int index)
    Delegate for VFXTableHelper.scrollToIndex(Orientation, int) with horizontal orientation as parameter.
    void
    Delegate for scrollToColumn(int) with 0 as parameter.
    void
    Delegate for scrollToRow(int) with 0 as parameter.
    void
    Delegate for scrollToColumn(int) with columns.size() - 1 as parameter.
    void
    Delegate for scrollToRow(int) with size() - 1 as parameter.
    void
    Delegate for VFXTableHelper.scrollToPixel(Orientation, double) with horizontal orientation as parameter.
    void
    scrollToPixelVertical(double pixel)
    Delegate for VFXTableHelper.scrollToPixel(Orientation, double) with vertical orientation as parameter.
    void
    scrollToRow(int index)
    Delegate for VFXTableHelper.scrollToIndex(Orientation, int) with vertical orientation as parameter.
    void
    scrollVerticalBy(double pixels)
    Delegate for VFXTableHelper.scrollBy(Orientation, double) with vertical orientation as parameter.
    void
    setClipBorderRadius(double clipBorderRadius)
    Sets the value of the clipBorderRadius property.
    void
    setColumnsBufferSize(BufferSize columnsBufferSize)
    Sets the value of the columnsBufferSize property.
    void
    setColumnsHeight(double h)
    Convenience method to create a new Size object and set the columnsSizeProperty().
    void
    Sets the value of the columnsLayoutMode property.
    void
    setColumnsSize(double w, double h)
    Convenience method to create a new Size object and set the columnsSizeProperty().
    void
    setColumnsSize(io.github.palexdev.mfxcore.base.beans.Size columnsSize)
    Sets the value of the columnsSize property.
    void
    setColumnsWidth(double w)
    Convenience method to create a new Size object and set the columnsSizeProperty().
    void
    setExtraAutosizeWidth(double extraAutosizeWidth)
    Sets the value of the extraAutosizeWidth property.
    void
    Sets the value of the helper property.
    void
    Sets the value of the helperFactory property.
    protected void
    Sets the value of the needsViewportLayout property.
    void
    Sets the value of the rowFactory property.
    void
    setRowsBufferSize(BufferSize rowsBufferSize)
    Sets the value of the rowsBufferSize property.
    void
    setRowsCacheCapacity(int rowsCacheCapacity)
    Sets the value of the rowsCacheCapacity property.
    void
    setRowsHeight(double rowsHeight)
    Sets the value of the rowsHeight property.
    protected void
    Sets the value of the state property.
    javafx.beans.property.ReadOnlyObjectProperty<VFXTableState<T>>
    Specifies the container's current state.
    void
    Convenience method to switch the table's ColumnsLayoutMode.
    void
    update(int... indexes)
    This method should be used by implementations to "manually" update the container.
    protected void
    Setter for the stateProperty().
    javafx.beans.property.ReadOnlyDoubleProperty
    javafx.beans.property.ReadOnlyDoubleProperty
    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.mfxcore.behavior.WithBehavior

    setDefaultBehaviorProvider
  • Property Details

  • Constructor Details

    • VFXTable

      public VFXTable()
    • VFXTable

      public VFXTable(javafx.collections.ObservableList<T> items)
    • 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 to autosizeColumn(VFXTableColumn).
    • autosizeColumn

      public void autosizeColumn(VFXTableColumn<T,?> column)
      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, see VFXTableHelper.autosizeColumn(VFXTableColumn).

    • autosizeColumns

      public void autosizeColumns()
      This will simply call autosizeColumn(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 processed ViewportLayoutRequest.wasDone() at the time calling this.

    • indexOf

      public int indexOf(VFXTableColumn<T,?> column)
      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 to List.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

      protected void update(VFXTableState<T> state)
      Setter for the stateProperty().
    • createCache

      protected VFXCellsCache<T,VFXTableRow<T>> createCache()
      Responsible for creating the rows' cache instance used by this container.
      See Also:
    • defaultRowFactory

      protected Function<T,VFXTableRow<T>> defaultRowFactory()
      Returns:
      the default function used to build rows. Uses VFXDefaultTableRow.
    • defaultHelperFactory

      protected Function<ColumnsLayoutMode,VFXTableHelper<T>> defaultHelperFactory()
      Returns:
      the default function used to build a VFXTableHelper.
    • requestViewportLayout

      public void requestViewportLayout()
      Setter for the needsViewportLayoutProperty(). This sets the property to ViewportLayoutRequest.EMPTY, causing the default skin to recompute the entire layout.
    • requestViewportLayout

      protected void requestViewportLayout(VFXTableColumn<T,?> column)
      Setter for the needsViewportLayoutProperty(). This sets the property to a new ViewportLayoutRequest 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
       
       

      Note that this may be a costly operation due to nested loops. Since cells are inside rows we must first iterate over the rows, then iterate on each of their cells and fire an update event on each of them.
      Specified by:
      update in interface VFXContainer<T>
      See Also:
    • buildSkin

      protected io.github.palexdev.mfxcore.controls.SkinBase<?,?> buildSkin()
      Specified by:
      buildSkin in class io.github.palexdev.mfxcore.controls.Control<VFXTableManager<T>>
    • defaultBehaviorProvider

      public Supplier<VFXTableManager<T>> defaultBehaviorProvider()
      Specified by:
      defaultBehaviorProvider in interface io.github.palexdev.mfxcore.behavior.WithBehavior<T>
    • defaultStyleClasses

      public List<String> defaultStyleClasses()
      Specified by:
      defaultStyleClasses in interface VFXStyleable
      Returns:
      a list containing all the component's default style classes
    • makeScrollable

      public VFXScrollPane makeScrollable()
      Description copied from interface: VFXScrollable
      Wraps this in a VFXScrollPane to enable scrolling.
      Specified by:
      makeScrollable in interface VFXScrollable
    • populateCache

      public VFXTable<T> populateCache()
      Delegate for VFXCellsCache.populate() (on the rows' cache).
      See Also:
    • populateCacheAll

      public VFXTable<T> populateCacheAll()
      Populates the rows' cache and all the table's columns' caches.
      See Also:
    • rowsCacheSize

      public int rowsCacheSize()
      Delegate for VFXCellsCache.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()
    • getColumnsRange

      public io.github.palexdev.mfxcore.base.beans.range.IntegerRange getColumnsRange()
    • getRowsByIndexUnmodifiable

      public SequencedMap<Integer,VFXTableRow<T>> getRowsByIndexUnmodifiable()
    • getRowsByItemUnmodifiable

      public List<Map.Entry<T,VFXTableRow<T>>> getRowsByItemUnmodifiable()
    • virtualMaxXProperty

      public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXProperty()
      Specified by:
      virtualMaxXProperty in interface VFXContainer<T>
      Returns:
      the virtualMaxX property
      See Also:
    • virtualMaxYProperty

      public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYProperty()
      Specified by:
      virtualMaxYProperty in interface VFXContainer<T>
      Returns:
      the virtualMaxY property
      See Also:
    • maxVScrollProperty

      public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollProperty()
      Specified by:
      maxVScrollProperty in interface VFXContainer<T>
      Returns:
      the maxVScroll property
      See Also:
    • maxHScrollProperty

      public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollProperty()
      Specified by:
      maxHScrollProperty in interface VFXContainer<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 to rowsCacheCapacityProperty(), so that it can honor the VFXContainer API.
      Specified by:
      bufferSizeProperty in interface VFXContainer<T>
      Returns:
      the bufferSize property
      See Also:
    • scrollVerticalBy

      public void scrollVerticalBy(double pixels)
      Delegate for VFXTableHelper.scrollBy(Orientation, double) with vertical orientation as parameter.
    • scrollHorizontalBy

      public void scrollHorizontalBy(double pixels)
      Delegate for VFXTableHelper.scrollBy(Orientation, double) with horizontal orientation as parameter.
    • scrollToPixelVertical

      public void scrollToPixelVertical(double pixel)
      Delegate for VFXTableHelper.scrollToPixel(Orientation, double) with vertical orientation as parameter.
    • scrollToPixelHorizontal

      public void scrollToPixelHorizontal(double pixel)
      Delegate for VFXTableHelper.scrollToPixel(Orientation, double) with horizontal orientation as parameter.
    • scrollToRow

      public void scrollToRow(int index)
      Delegate for VFXTableHelper.scrollToIndex(Orientation, int) with vertical orientation as parameter.
    • scrollToColumn

      public void scrollToColumn(int index)
      Delegate for VFXTableHelper.scrollToIndex(Orientation, int) with horizontal orientation as parameter.
    • scrollToFirstRow

      public void scrollToFirstRow()
      Delegate for scrollToRow(int) with 0 as parameter.
    • scrollToLastRow

      public void scrollToLastRow()
      Delegate for scrollToRow(int) with size() - 1 as parameter.
    • scrollToFirstColumn

      public void scrollToFirstColumn()
      Delegate for scrollToColumn(int) with 0 as parameter.
    • scrollToLastColumn

      public void scrollToLastColumn()
      Delegate for scrollToColumn(int) with columns.size() - 1 as parameter.
    • getRowsHeight

      public double getRowsHeight()
      Gets the value of the rowsHeight 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 the helperFactoryProperty().

      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 the helperFactoryProperty().

      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 the rowsHeight 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 the helperFactoryProperty().

      Can be set in CSS via the property: '-vfx-rows-height'.

      Parameters:
      rowsHeight - the value for the rowsHeight property
      See Also:
    • getColumnsSize

      public io.github.palexdev.mfxcore.base.beans.Size getColumnsSize()
      Gets the value of the columnsSize 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. In FIXED mode, all columns will have the same width and height specified by the Size object. In VARIABLE 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 default VFXTableHelper 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 a Size object.

      Note that the width specified by this property will be used differently depending on the ColumnsLayoutMode. In FIXED mode, all columns will have the same width and height specified by the Size object. In VARIABLE 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 default VFXTableHelper 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 the columnsSize 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. In FIXED mode, all columns will have the same width and height specified by the Size object. In VARIABLE 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 default VFXTableHelper implementations.

      Can be set in CSS via the property: '-vfx-columns-size'.

      Parameters:
      columnsSize - the value for the columnsSize property
      See Also:
    • setColumnsSize

      public void setColumnsSize(double w, double h)
      Convenience method to create a new Size object and set the columnsSizeProperty().
    • setColumnsWidth

      public void setColumnsWidth(double w)
      Convenience method to create a new Size object and set the columnsSizeProperty(). The old height will be kept.
    • setColumnsHeight

      public void setColumnsHeight(double h)
      Convenience method to create a new Size object and set the columnsSizeProperty(). The old width will be kept.
    • getColumnsLayoutMode

      public ColumnsLayoutMode getColumnsLayoutMode()
      Gets the value of the columnsLayoutMode 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. See ColumnsLayoutMode.

      Can be set in CSS via the property: '-vfx-columns-layout-mode'.

      Returns:
      the columnsLayoutMode property
      See Also:
    • setColumnsLayoutMode

      public void setColumnsLayoutMode(ColumnsLayoutMode columnsLayoutMode)
      Sets the value of the columnsLayoutMode 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 the columnsLayoutMode property
      See Also:
    • switchColumnsLayoutMode

      public void switchColumnsLayoutMode()
      Convenience method to switch the table's ColumnsLayoutMode.
    • getExtraAutosizeWidth

      public double getExtraAutosizeWidth()
      Gets the value of the extraAutosizeWidth 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 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 extraAutosizeWidth property
      See Also:
    • setExtraAutosizeWidth

      public void setExtraAutosizeWidth(double extraAutosizeWidth)
      Sets the value of the extraAutosizeWidth 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 the extraAutosizeWidth property
      See Also:
    • getColumnsBufferSize

      public BufferSize getColumnsBufferSize()
      Gets the value of the columnsBufferSize property.
      Property description:
      Specifies the number of extra columns to add to the viewport to make scrolling smoother. See also VFXContainer.bufferSizeProperty() and VFXTableHelper.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 also VFXContainer.bufferSizeProperty() and VFXTableHelper.totalRows()

      Can be set in CSS via the property: '-vfx-columns-buffer-size'.

      Returns:
      the columnsBufferSize property
      See Also:
    • setColumnsBufferSize

      public void setColumnsBufferSize(BufferSize columnsBufferSize)
      Sets the value of the columnsBufferSize property.
      Property description:
      Specifies the number of extra columns to add to the viewport to make scrolling smoother. See also VFXContainer.bufferSizeProperty() and VFXTableHelper.totalRows()

      Can be set in CSS via the property: '-vfx-columns-buffer-size'.

      Parameters:
      columnsBufferSize - the value for the columnsBufferSize property
      See Also:
    • getRowsBufferSize

      public BufferSize getRowsBufferSize()
      Gets the value of the rowsBufferSize property.
      Property description:
      Specifies the number of extra rows to add to the viewport to make scrolling smoother. See also VFXContainer.bufferSizeProperty() and VFXTableHelper.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 also VFXContainer.bufferSizeProperty() and VFXTableHelper.totalRows().

      Can be set in CSS via the property: '-vfx-columns-buffer-size'.

      Returns:
      the rowsBufferSize property
      See Also:
    • setRowsBufferSize

      public void setRowsBufferSize(BufferSize rowsBufferSize)
      Sets the value of the rowsBufferSize property.
      Property description:
      Specifies the number of extra rows to add to the viewport to make scrolling smoother. See also VFXContainer.bufferSizeProperty() and VFXTableHelper.totalRows().

      Can be set in CSS via the property: '-vfx-columns-buffer-size'.

      Parameters:
      rowsBufferSize - the value for the rowsBufferSize property
      See Also:
    • getClipBorderRadius

      public double getClipBorderRadius()
      Gets the value of the clipBorderRadius 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 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 clipBorderRadius property
      See Also:
    • setClipBorderRadius

      public void setClipBorderRadius(double clipBorderRadius)
      Sets the value of the clipBorderRadius 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 the clipBorderRadius property
      See Also:
    • getRowsCacheCapacity

      public int getRowsCacheCapacity()
      Gets the value of the rowsCacheCapacity 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 the rowsCacheCapacity 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 the rowsCacheCapacity property
      See Also:
    • getControlCssMetaData

      protected List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getControlCssMetaData()
      Overrides:
      getControlCssMetaData in class javafx.scene.control.Control
    • getClassCssMetaData

      public static List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getClassCssMetaData()
    • getCache

      protected VFXCellsCache<T,VFXTableRow<T>> getCache()
      Returns:
      the rows' cache instance used by this container
    • itemsProperty

      public javafx.beans.property.ListProperty<T> itemsProperty()
      Description copied from interface: VFXContainer
      Specifies the ObservableList 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 an InvalidationListener that will both inform about changes of the property and in the list.

      Specified by:
      itemsProperty in interface VFXContainer<T>
      Returns:
      the items property
      See Also:
    • getRowFactory

      public Function<T,VFXTableRow<T>> getRowFactory()
      Gets the value of the rowFactory 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

      public CellFactory<T,VFXTableRow<T>> rowFactoryProperty()
      Specifies the function used to build the table's rows. See also defaultRowFactory().
      Returns:
      the rowFactory property
      See Also:
    • setRowFactory

      public void setRowFactory(Function<T,VFXTableRow<T>> rowFactory)
      Sets the value of the rowFactory property.
      Property description:
      Specifies the function used to build the table's rows. See also defaultRowFactory().
      Parameters:
      rowFactory - the value for the rowFactory property
      See Also:
    • getColumns

      public javafx.collections.ObservableList<VFXTableColumn<T,? extends VFXTableCell<T>>> getColumns()
      This is the observable list containing all the table's columns.
    • getHelper

      public VFXTableHelper<T> getHelper()
      Gets the value of the helper property.
      Property description:
      Specifies the instance of the VFXTableHelper built by the helperFactoryProperty().
      Returns:
      the value of the helper property
      See Also:
    • helperProperty

      public javafx.beans.property.ReadOnlyObjectWrapper<VFXTableHelper<T>> helperProperty()
      Specifies the instance of the VFXTableHelper built by the helperFactoryProperty().
      Returns:
      the helper property
      See Also:
    • setHelper

      public void setHelper(VFXTableHelper<T> helper)
      Sets the value of the helper property.
      Property description:
      Specifies the instance of the VFXTableHelper built by the helperFactoryProperty().
      Parameters:
      helper - the value for the helper property
      See Also:
    • getHelperFactory

      public Function<ColumnsLayoutMode,VFXTableHelper<T>> getHelperFactory()
      Gets the value of the helperFactory property.
      Property description:
      Specifies the function used to build a VFXTableHelper instance. See also defaultHelperFactory().
      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 a VFXTableHelper instance. See also defaultHelperFactory().
      Returns:
      the helperFactory property
      See Also:
    • setHelperFactory

      public void setHelperFactory(Function<ColumnsLayoutMode,VFXTableHelper<T>> helperFactory)
      Sets the value of the helperFactory property.
      Property description:
      Specifies the function used to build a VFXTableHelper instance. See also defaultHelperFactory().
      Parameters:
      helperFactory - the value for the helperFactory 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 interface VFXContainer<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 interface VFXContainer<T>
      Returns:
      the hPos property
      See Also:
    • getState

      public VFXTableState<T> getState()
      Gets the value of the state 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

      public javafx.beans.property.ReadOnlyObjectProperty<VFXTableState<T>> 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

      protected void setState(VFXTableState<T> state)
      Sets the value of the state 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 the state property
      See Also:
    • isNeedsViewportLayout

      public boolean isNeedsViewportLayout()
    • getViewportLayoutRequest

      public ViewportLayoutRequest<T> 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

      protected void setNeedsViewportLayout(ViewportLayoutRequest needsViewportLayout)
      Sets the value of the needsViewportLayout 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 the needsViewportLayout property
      See Also: