Class VFXTableColumn<T, C extends VFXTableCell<T>>

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
javafx.scene.control.Labeled
io.github.palexdev.mfxcore.controls.MFXLabeled
io.github.palexdev.virtualizedfx.table.VFXTableColumn<T,C>
Type Parameters:
T - the type of data in the table
C - the type of cells this column will produce
All Implemented Interfaces:
io.github.palexdev.mfxcore.behavior.WithBehavior, io.github.palexdev.mfxcore.controls.MFXSkinnable, io.github.palexdev.mfxcore.controls.MFXStyleable, WithCellFactory<T,C>, javafx.css.Styleable, javafx.event.EventTarget, javafx.scene.control.Skinnable
Direct Known Subclasses:
VFXDefaultTableColumn

public abstract class VFXTableColumn<T, C extends VFXTableCell<T>> extends io.github.palexdev.mfxcore.controls.MFXLabeled implements WithCellFactory<T,C>

Base class that defines common properties and behaviors for all columns to be used with VFXTable. Extends MFXLabeled for simplicity, and uses behaviors of type VFXTableColumnBehavior. The default style class is set to '.vfx-column'.

This class has three basic properties:

  1. The tableProperty(). Every column should specify the table's instance they belong to. By default, as handled by VFXTableManager.onColumnsChanged(ListChangeListener.Change), the system will manage this property automatically, by setting or re-setting (to null) the instance as columns are added/removed to/from the table. This is an improvement over the previous implementation which required the user to pass the table's instance to the constructors.

  2. The indexProperty(). I believe it may be useful for every column to specify their position in VFXTable.getColumns(). However, there is not a fast way to know the index of a column from its instance, List.indexOf(Object) is way too slow for a virtualized container. For this reason, the property is automatically updated by the VFXTableSkin when a layout is performed, see VFXTableSkin.updateColumnIndex(VFXTableColumn, int).

  3. Every column should specify a function to build cells for some data from the model of type T. These functions do not have to produce different cell types necessarily. Rather, since every column is probably going to refer to a specific piece of sub-data for a class of type T, it should tell the built cells how to map to that piece of sub-data. In fact, if you check the default cell implementations (e.g. VFXSimpleTableCell) you can see that they need an 'extractor' and 'converter' functions to work as intended.

Last but not least, every column has a VFXCellsCache instance which will hold cells that are not used anymore, but could be in the future. Creating nodes is a very costly operation. We can "dampen" this cost by caching and just update them when needed again. You can increment the capacity or disable it by setting the cellsCacheCapacityProperty().

Width Handling

This new implementation handles the width in a special way. First and foremost, the width of each column is decided by the VFXTableHelper implementation, since the base layout methods are defined there. The criteria are various. There is the VFXTable.columnsSizeProperty() which depending on the ColumnsLayoutMode specifies the fixed or minimum width every column must have. So, even in the latter case, we do not use Node.minWidth(double) to determine the minimum width. If you want a column to have a specific width (in variable mode ofc!!) then you must use this method to resize it: resize(double). This new implementation uses the Region.prefWidthProperty() to store the user's preferred width for the column. Not only that, this 'slot'/variable/property is used by autosize methods too VFXTable.autosizeColumn(VFXTableColumn), and should be used by gestures too (see VFXTableColumnBehavior).

The default behavior implementation allows you to resize the column at runtime with the mouse cursor. The feature can be enabled/disabled through the gestureResizableProperty().

  • Property Summary

    Properties
    Type
    Property
    Description
    io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty
    Specifies the maximum number of cells the cache can contain at any time.
    io.github.palexdev.mfxcore.base.properties.styleable.StyleableBooleanProperty
    The default behavior VFXTableColumnBehavior allows to resize the column at runtime via gestures.
    javafx.beans.property.ReadOnlyIntegerProperty
    Specifies the index of the columns in the list VFXTable.getColumns().
    javafx.beans.property.ReadOnlyObjectProperty<VFXTable<T>>
    Specifies the table's instance this column belongs to.

    Properties inherited from class io.github.palexdev.mfxcore.controls.MFXLabeled

    behaviorFactory, skinFactory, textOpacity

    Properties inherited from class javafx.scene.control.Labeled

    alignment, contentDisplay, ellipsisString, font, graphic, graphicTextGap, labelPadding, lineSpacing, mnemonicParsing, textAlignment, textFill, textOverrun, text, textTruncated, underline, wrapText

    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, onMouseDragDone, 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 javafx.scene.control.Skinnable

    skin
  • 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
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
    VFXTableColumn(String text, javafx.scene.Node graphic)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected VFXCellsCache<T,C>
     
    int
    Delegate for VFXCellsCache.size().
    io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty
    Specifies the maximum number of cells the cache can contain at any time.
    double
    computePrefWidth(double height)

    Overridden to make it public. Since we use the Region.prefWidthProperty() to store the width we'd like the column to have, and for how JavaFX works, invoking Region.prefWidth(double) would return a cached value which may not be what we want.

     
    protected VFXCellsCache<T,C>
    Responsible for creating the cells' cache instance used by this column.
    Supplier<io.github.palexdev.mfxcore.behavior.MFXBehavior<? extends javafx.scene.Node>>
     
    protected Function<T,C>
     
     
    io.github.palexdev.mfxcore.base.properties.styleable.StyleableBooleanProperty
    The default behavior VFXTableColumnBehavior allows to resize the column at runtime via gestures.
    Specifies the function used to build the cells.
    int
    Gets the value of the cellsCacheCapacity property.
    static List<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>>
     
    List<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>>
     
    int
    Gets the value of the index property.
    Gets the value of the table property.
    javafx.beans.property.ReadOnlyIntegerProperty
    Specifies the index of the columns in the list VFXTable.getColumns().
    boolean
    Gets the value of the gestureResizable property.
    protected void
    This core method is responsible for telling the table to update its state when a column changes its cell factory.
    void
    void
    resize(double width)
    Sets the column's pref width to the given value and invokes a layout request by calling VFXTableManager.onColumnWidthChanged(VFXTableColumn).
    void
    setCellsCacheCapacity(int cellsCacheCapacity)
    Sets the value of the cellsCacheCapacity property.
    void
    setGestureResizable(boolean gestureResizable)
    Sets the value of the gestureResizable property.
    protected void
    setIndex(int index)
    Sets the value of the index property.
    protected void
    Sets the value of the table property.
    static <T> void
    swapColumns(VFXTable<T> table, int i, int j)
    static <T> void
    swapColumns(javafx.collections.ObservableList<VFXTableColumn<T, ? extends VFXTableCell<T>>> columns, int i, int j)
    This convenience method swaps the columns at the given indexes in the given list.
    javafx.beans.property.ReadOnlyObjectProperty<VFXTable<T>>
    Specifies the table's instance this column belongs to.

    Methods inherited from class io.github.palexdev.mfxcore.controls.MFXLabeled

    behaviorFactoryProperty, buildSkin, createDefaultSkin, getBehavior, getTextOpacity, preloadSkin, setTextOpacity, skinFactoryProperty, textOpacityProperty

    Methods inherited from class javafx.scene.control.Labeled

    alignmentProperty, contentDisplayProperty, ellipsisStringProperty, fontProperty, getAlignment, getContentBias, getContentDisplay, getEllipsisString, getFont, getGraphic, getGraphicTextGap, getInitialAlignment, getLabelPadding, getLineSpacing, getText, getTextAlignment, getTextFill, getTextOverrun, graphicProperty, graphicTextGapProperty, isMnemonicParsing, isTextTruncated, isUnderline, isWrapText, labelPaddingProperty, lineSpacingProperty, mnemonicParsingProperty, setAlignment, setContentDisplay, setEllipsisString, setFont, setGraphic, setGraphicTextGap, setLineSpacing, setMnemonicParsing, setText, setTextAlignment, setTextFill, setTextOverrun, setUnderline, setWrapText, textAlignmentProperty, textFillProperty, textOverrunProperty, textProperty, textTruncatedProperty, toString, underlineProperty, wrapTextProperty

    Methods inherited from class javafx.scene.control.Control

    computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, 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, 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, getOnMouseDragDone, 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, onMouseDragDoneProperty, 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, requestFocusTraversal, 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, setOnMouseDragDone, 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, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.github.palexdev.mfxcore.controls.MFXSkinnable

    defaultSkinFactory, getSkinFactory, setDefaultSkinFactory, setSkinFactory

    Methods inherited from interface io.github.palexdev.mfxcore.controls.MFXStyleable

    setDefaultStyleClasses

    Methods inherited from interface javafx.scene.control.Skinnable

    getSkin, setSkin, skinProperty

    Methods inherited from interface javafx.css.Styleable

    getCssMetaData, getId, getPseudoClassStates, getStyle, getStyleableNode, getStyleableParent, getStyleClass, getTypeSelector

    Methods inherited from interface io.github.palexdev.mfxcore.behavior.WithBehavior

    getBehaviorFactory, setBehaviorFactory, setDefaultBehaviorFactory

    Methods inherited from interface WithCellFactory

    create, setCellFactory
  • Property Details

    • cellsCacheCapacity

      public io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty cellsCacheCapacityProperty

      Specifies the maximum number of cells 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-cells-cache-capacity'.

      See Also:
    • gestureResizable

      public io.github.palexdev.mfxcore.base.properties.styleable.StyleableBooleanProperty gestureResizableProperty

      The default behavior VFXTableColumnBehavior allows to resize the column at runtime via gestures. This property is used to enable or disable such feature.

      This is also settable via CSS with the "-vfx-resizable" property.

      See Also:
    • table

      public javafx.beans.property.ReadOnlyObjectProperty<VFXTable<T>> tableProperty
      Specifies the table's instance this column belongs to. The value will be null if the column is not yet in the scene graph or if the column is not part of any table.
      See Also:
    • index

      public javafx.beans.property.ReadOnlyIntegerProperty indexProperty

      Specifies the index of the columns in the list VFXTable.getColumns(). The value will be -1 if the property has not been updated yet or if the column is not in a table.

      This method will be reliable 99% of the time, however, just to be sure I suggest you to use VFXTable.indexOf(VFXTableColumn) instead.

      See Also:
  • Constructor Details

    • VFXTableColumn

      public VFXTableColumn()
    • VFXTableColumn

      public VFXTableColumn(String text)
    • VFXTableColumn

      public VFXTableColumn(String text, javafx.scene.Node graphic)
  • Method Details

    • swapColumns

      public static <T> void swapColumns(javafx.collections.ObservableList<VFXTableColumn<T, ? extends VFXTableCell<T>>> columns, int i, int j)

      This convenience method swaps the columns at the given indexes in the given list.

      As probably already explained in VFXTable, since columns are concrete nodes, there's the potential risk of adding duplicates in the list which would lead to a JavaFX exception. This is the exact reason why Collections.swap(List, int, int) cannot be used. What this method does internally, is to copy the columns to a temporary array, swap the columns in that, and finally use ObservableList.setAll(Object[]).

    • swapColumns

      public static <T> void swapColumns(VFXTable<T> table, int i, int j)
    • resize

      public void resize(double width)
      Sets the column's pref width to the given value and invokes a layout request by calling VFXTableManager.onColumnWidthChanged(VFXTableColumn).
    • createCache

      protected VFXCellsCache<T,C> createCache()
      Responsible for creating the cells' cache instance used by this column.
      See Also:
    • defaultCellFactory

      protected Function<T,C> defaultCellFactory()
      Returns:
      the default function used to build cells. Uses VFXSimpleTableCell.
    • onCellFactoryChanged

      protected void onCellFactoryChanged(Function<T,C> newFactory)

      This core method is responsible for telling the table to update its state when a column changes its cell factory. Since every column has its own cell factory property, it would be too inconvenient to handle such case on the table side. Rather, this column implementation is responsible for communicating it to the table's manager by calling VFXTableManager.onCellFactoryChanged(VFXTableColumn). (automatically called by the property!)

      This will also cause the cells' cache to clear and dispose all cached cells built by the previous factory.

    • computePrefWidth

      public double computePrefWidth(double height)

      Overridden to make it public. Since we use the Region.prefWidthProperty() to store the width we'd like the column to have, and for how JavaFX works, invoking Region.prefWidth(double) would return a cached value which may not be what we want. In fact, this is useful for example when we have to autosize the column as this method will ignore such cached value and return a computed value depending solely on its content.

      Overrides:
      computePrefWidth in class javafx.scene.control.Control
    • defaultBehaviorFactory

      public Supplier<io.github.palexdev.mfxcore.behavior.MFXBehavior<? extends javafx.scene.Node>> defaultBehaviorFactory()
      Specified by:
      defaultBehaviorFactory in interface io.github.palexdev.mfxcore.behavior.WithBehavior
    • defaultStyleClasses

      public List<String> defaultStyleClasses()
      Specified by:
      defaultStyleClasses in interface io.github.palexdev.mfxcore.controls.MFXStyleable
    • getCellsCacheCapacity

      public int getCellsCacheCapacity()
      Gets the value of the cellsCacheCapacity property.
      Property description:

      Specifies the maximum number of cells 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-cells-cache-capacity'.

      Returns:
      the value of the cellsCacheCapacity property
      See Also:
    • cellsCacheCapacityProperty

      public io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty cellsCacheCapacityProperty()

      Specifies the maximum number of cells 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-cells-cache-capacity'.

      Returns:
      the cellsCacheCapacity property
      See Also:
    • setCellsCacheCapacity

      public void setCellsCacheCapacity(int cellsCacheCapacity)
      Sets the value of the cellsCacheCapacity property.
      Property description:

      Specifies the maximum number of cells 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-cells-cache-capacity'.

      Parameters:
      cellsCacheCapacity - the value for the cellsCacheCapacity property
      See Also:
    • isGestureResizable

      public boolean isGestureResizable()
      Gets the value of the gestureResizable property.
      Property description:

      The default behavior VFXTableColumnBehavior allows to resize the column at runtime via gestures. This property is used to enable or disable such feature.

      This is also settable via CSS with the "-vfx-resizable" property.

      Returns:
      the value of the gestureResizable property
      See Also:
    • gestureResizableProperty

      public io.github.palexdev.mfxcore.base.properties.styleable.StyleableBooleanProperty gestureResizableProperty()

      The default behavior VFXTableColumnBehavior allows to resize the column at runtime via gestures. This property is used to enable or disable such feature.

      This is also settable via CSS with the "-vfx-resizable" property.

      Returns:
      the gestureResizable property
      See Also:
    • setGestureResizable

      public void setGestureResizable(boolean gestureResizable)
      Sets the value of the gestureResizable property.
      Property description:

      The default behavior VFXTableColumnBehavior allows to resize the column at runtime via gestures. This property is used to enable or disable such feature.

      This is also settable via CSS with the "-vfx-resizable" property.

      Parameters:
      gestureResizable - the value for the gestureResizable property
      See Also:
    • getClassCssMetaData

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

      public List<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> getControlCssMetaData()
      Overrides:
      getControlCssMetaData in class io.github.palexdev.mfxcore.controls.MFXLabeled
    • cache

      protected VFXCellsCache<T,C> cache()
      Returns:
      the cells' cache instance used by this column
    • populateCache

      public void populateCache()
    • cacheSize

      public int cacheSize()
      Delegate for VFXCellsCache.size().
    • getTable

      public VFXTable<T> getTable()
      Gets the value of the table property.
      Property description:
      Specifies the table's instance this column belongs to. The value will be null if the column is not yet in the scene graph or if the column is not part of any table.
      Returns:
      the value of the table property
      See Also:
    • context

      public VFXContext<T> context()
    • tableProperty

      public javafx.beans.property.ReadOnlyObjectProperty<VFXTable<T>> tableProperty()
      Specifies the table's instance this column belongs to. The value will be null if the column is not yet in the scene graph or if the column is not part of any table.
      Returns:
      the table property
      See Also:
    • setTable

      protected void setTable(VFXTable<T> table)
      Sets the value of the table property.
      Property description:
      Specifies the table's instance this column belongs to. The value will be null if the column is not yet in the scene graph or if the column is not part of any table.
      Parameters:
      table - the value for the table property
      See Also:
    • getIndex

      public int getIndex()
      Gets the value of the index property.
      Property description:

      Specifies the index of the columns in the list VFXTable.getColumns(). The value will be -1 if the property has not been updated yet or if the column is not in a table.

      This method will be reliable 99% of the time, however, just to be sure I suggest you to use VFXTable.indexOf(VFXTableColumn) instead.

      Returns:
      the value of the index property
      See Also:
    • indexProperty

      public javafx.beans.property.ReadOnlyIntegerProperty indexProperty()

      Specifies the index of the columns in the list VFXTable.getColumns(). The value will be -1 if the property has not been updated yet or if the column is not in a table.

      This method will be reliable 99% of the time, however, just to be sure I suggest you to use VFXTable.indexOf(VFXTableColumn) instead.

      Returns:
      the index property
      See Also:
    • setIndex

      protected void setIndex(int index)
      Sets the value of the index property.
      Property description:

      Specifies the index of the columns in the list VFXTable.getColumns(). The value will be -1 if the property has not been updated yet or if the column is not in a table.

      This method will be reliable 99% of the time, however, just to be sure I suggest you to use VFXTable.indexOf(VFXTableColumn) instead.

      Parameters:
      index - the value for the index property
      See Also:
    • getCellFactory

      public CellFactory<T,C> getCellFactory()
      Specifies the function used to build the cells. See also defaultCellFactory().
      Specified by:
      getCellFactory in interface WithCellFactory<T, C extends VFXTableCell<T>>