Class VFXObservingTableCell<T,E>
- All Implemented Interfaces:
io.github.palexdev.mfxcore.behavior.WithBehavior
,io.github.palexdev.mfxcore.controls.MFXSkinnable
,io.github.palexdev.mfxcore.controls.MFXStyleable
,VFXCell<T>
,VFXMappingTableCell<T, ObservableValue<E>>
,VFXTableCell<T>
,Styleable
,EventTarget
,Skinnable
VFXSimpleTableCell
which is intended to be used with models that make use of JavaFX properties.
Uses VFXObservingTableCell<T,E>.VFXObservingTableCellSkin
as the default skin implementation.
The extractor function is expected to extract a property of type ObservableValue
.
The StringConverter
is intended to convert the value of the observable, ObservableValue.getValue()
,
to a String
. By default, this returns an empty string if the observable is null
,
otherwise uses Objects.toString(Object)
on its value.
ObservableValue
thus avoiding continuous calls
to the extractor. The reference is disposed by dispose()
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Default skin implementation used byVFXObservingTableCell
and extension ofVFXLabeledCellSkin
. -
Property Summary
Properties inherited from class io.github.palexdev.virtualizedfx.cells.VFXSimpleTableCell
column, row
Properties inherited from class io.github.palexdev.virtualizedfx.cells.VFXCellBase
alignment, graphic, index, item
Properties inherited from class io.github.palexdev.mfxcore.controls.MFXControl
behaviorFactory, skinFactory
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
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionVFXObservingTableCell
(T item, Function<T, ObservableValue<E>> extractor) VFXObservingTableCell
(T item, Function<T, ObservableValue<E>> extractor, StringConverter<ObservableValue<E>> converter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Automatically called by the framework when the cell is not needed anymore.protected ObservableValue
<E> Returns theObservableValue
extracted by the extractor function.void
updateItem
(T item) Automatically called by the framework when the cell needs to update its item.Methods inherited from class io.github.palexdev.virtualizedfx.cells.VFXSimpleTableCell
columnProperty, defaultStyleClasses, getColumn, getConverter, getExtractor, getRow, getRowIndex, getTable, rowProperty, setColumn, setConverter, setExtractor, setRow, updateColumn, updateRow
Methods inherited from class io.github.palexdev.virtualizedfx.cells.VFXCellBase
alignmentProperty, context, defaultBehaviorFactory, getAlignment, getClassCssMetaData, getControlCssMetaData, getGraphic, getIndex, getItem, graphicProperty, indexProperty, itemProperty, onCreated, setAlignment, setGraphic, setIndex, setItem, toNode, updateIndex
Methods inherited from class io.github.palexdev.mfxcore.controls.MFXControl
behaviorFactoryProperty, buildSkin, createDefaultSkin, getBehavior, preloadSkin, skinFactoryProperty
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, 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, 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 io.github.palexdev.mfxcore.controls.MFXSkinnable
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.virtualizedfx.cells.base.VFXCell
afterLayout, beforeLayout, onCache, onCreated, onDeCache, toNode, updateIndex
Methods inherited from interface io.github.palexdev.virtualizedfx.cells.base.VFXMappingTableCell
setConverter
Methods inherited from interface io.github.palexdev.mfxcore.behavior.WithBehavior
getBehaviorFactory, setBehaviorFactory, setDefaultBehaviorFactory
-
Field Details
-
property
-
-
Constructor Details
-
VFXObservingTableCell
-
VFXObservingTableCell
public VFXObservingTableCell(T item, Function<T, ObservableValue<E>> extractor, StringConverter<ObservableValue<E>> converter)
-
-
Method Details
-
getProperty
Returns theObservableValue
extracted by the extractor function.If the local reference is still
null
it first attempts at extracting it, and then updates it (so that later calls will just return the already extracted observable). -
updateItem
Automatically called by the framework when the cell needs to update its item.Note though, that there is no 100% guarantee the new given item is different from the current one. If you have some operations happen when the item changes, for performance reasons, I recommend you to first ensure the new item really is different.
See
Updates theVFXCellBase
and read how this is handled.VFXCellBase.itemProperty()
. Before updating the item this disposes theObservableValue
previously extracted bygetProperty()
.- Specified by:
updateItem
in interfaceVFXCell<T>
- Overrides:
updateItem
in classVFXCellBase<T>
-
defaultSkinFactory
public Supplier<io.github.palexdev.mfxcore.controls.MFXSkinBase<? extends Node>> defaultSkinFactory()- Specified by:
defaultSkinFactory
in interfaceio.github.palexdev.mfxcore.controls.MFXSkinnable
- Overrides:
defaultSkinFactory
in classVFXSimpleTableCell<T, ObservableValue<E>>
-
dispose
public void dispose()Description copied from interface:VFXCell
Automatically called by the framework when the cell is not needed anymore. The user can override this to perform some operations before the cell is GCd.
-