Class VFXObservingTableCell<T,E>
- All Implemented Interfaces:
io.github.palexdev.mfxcore.behavior.WithBehavior<CellBaseBehavior<T>>,io.github.palexdev.mfxcore.controls.MFXSkinnable<io.github.palexdev.mfxcore.controls.SkinBase<?,,?>> 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 TypeClassDescriptionclassDefault skin implementation used byVFXObservingTableCelland extension ofVFXLabeledCellSkin. -
Property Summary
Properties inherited from class io.github.palexdev.virtualizedfx.cells.VFXSimpleTableCell
column, rowProperties inherited from class io.github.palexdev.virtualizedfx.cells.VFXCellBase
alignment, graphic, index, itemProperties inherited from class io.github.palexdev.mfxcore.controls.Control
behaviorProvider, skinProviderProperties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltipProperties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Parent
needsLayoutProperties 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_SIZEFields 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 TypeMethodDescriptionSupplier<io.github.palexdev.mfxcore.controls.SkinBase<?, ?>> voiddispose()Automatically called by the framework when the cell is not needed anymore.protected ObservableValue<E> Returns theObservableValueextracted by the extractor function.voidupdateItem(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, updateRowMethods inherited from class io.github.palexdev.virtualizedfx.cells.VFXCellBase
alignmentProperty, defaultBehaviorProvider, getAlignment, getClassCssMetaData, getContainer, getControlCssMetaData, getGraphic, getIndex, getItem, graphicProperty, indexProperty, itemProperty, onCreated, setAlignment, setGraphic, setIndex, setItem, toNode, updateIndexMethods inherited from class io.github.palexdev.mfxcore.controls.Control
behaviorProviderProperty, buildSkin, createDefaultSkin, getBehavior, skinProviderPropertyMethods 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, tooltipPropertyMethods 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, widthPropertyMethods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods 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, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.palexdev.mfxcore.controls.MFXSkinnable
getSkinProvider, setDefaultSkinProvider, setSkinProviderMethods inherited from interface io.github.palexdev.mfxcore.controls.MFXStyleable
defaultStyleClassesMethods inherited from interface javafx.css.Styleable
getStyleableNodeMethods inherited from interface io.github.palexdev.virtualizedfx.cells.base.VFXCell
afterLayout, beforeLayout, onCache, onCreated, onDeCache, toNode, updateIndexMethods inherited from interface io.github.palexdev.virtualizedfx.cells.base.VFXMappingTableCell
setConverterMethods inherited from interface io.github.palexdev.mfxcore.behavior.WithBehavior
getBehaviorProvider, setBehaviorProvider, setDefaultBehaviorProvider
-
Field Details
-
property
-
-
Constructor Details
-
VFXObservingTableCell
-
VFXObservingTableCell
public VFXObservingTableCell(T item, Function<T, ObservableValue<E>> extractor, StringConverter<ObservableValue<E>> converter)
-
-
Method Details
-
getProperty
Returns theObservableValueextracted by the extractor function.If the local reference is still
nullit 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 theVFXCellBaseand read how this is handled.VFXCellBase.itemProperty(). Before updating the item this disposes theObservableValuepreviously extracted bygetProperty().- Specified by:
updateItemin interfaceVFXCell<T>- Overrides:
updateItemin classVFXCellBase<T>
-
defaultSkinProvider
- Specified by:
defaultSkinProviderin interfaceio.github.palexdev.mfxcore.controls.MFXSkinnable<T>- Overrides:
defaultSkinProviderin classVFXSimpleTableCell<T, ObservableValue<E>>
-
dispose
public void dispose()Description copied from interface:VFXCellAutomatically 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.
-