T
- The type of the item contained within the Cell.public class TreeTableCell<S,T> extends IndexedCell<T>
TreeTableView
. To
represent this intersection, a TreeTableCell contains an
index
property, as well as a
tableColumn
property. In addition, a TreeTableCell
instance knows what TreeTableRow
it exists in.
A note about selection: A TreeTableCell visually shows it is selected when two conditions are met:
TableSelectionModel.isSelected(int, TableColumnBase)
method
returns true for the row / column that this cell represents, andcell selection mode
property is set to true (to represent that it is allowable to select
individual cells (and not just rows of cells)).TreeTableView
,
TreeTableColumn
,
Cell
,
IndexedCell
,
TreeTableRow
USE_COMPUTED_SIZE, USE_PREF_SIZE
BASELINE_OFFSET_SAME_AS_HEIGHT
Constructor and Description |
---|
TreeTableCell()
Constructs a default TreeTableCell instance with a style class of
'tree-table-cell'.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelEdit()
Call this function to transition from an editing state into a non-editing
state, without saving any user input.
|
void |
commitEdit(T newValue)
Call this function when appropriate (based on the user interaction requirements
of your cell editing user interface) to do two things:
Fire the appropriate events back to the backing UI control (e.g.
|
protected Skin<?> |
createDefaultSkin()
Create a new instance of the default skin for this control.
|
void |
executeAccessibleAction(AccessibleAction action,
java.lang.Object... parameters)
This method is called by the assistive technology to request the action
indicated by the argument should be executed.
|
TreeTableColumn<S,T> |
getTableColumn() |
TreeTableRow<S> |
getTreeTableRow() |
TreeTableView<S> |
getTreeTableView() |
(package private) void |
indexChanged(int oldIndex,
int newIndex)
This method is called whenever the index is changed, regardless of whether
the new index is the same as the old index.
|
private boolean |
isInCellSelectionMode() |
protected void |
layoutChildren()
Invoked during the layout pass to layout the children in this
Parent . |
private boolean |
match(TreeTablePosition pos) |
private void |
possiblySetId(java.lang.String idCandidate) |
private void |
possiblySetStyle(java.lang.String styleCandidate) |
java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters)
*
Accessibility handling *
*
|
private void |
setTableColumn(TreeTableColumn<S,T> value) |
private void |
setTreeTableRow(TreeTableRow<S> value) |
private void |
setTreeTableView(TreeTableView<S> value) |
void |
startEdit()
Call this function to transition from a non-editing state into an editing
state, if the cell is editable.
|
ReadOnlyObjectProperty<TreeTableColumn<S,T>> |
tableColumnProperty() |
ReadOnlyObjectProperty<TreeTableRow<S>> |
tableRowProperty() |
ReadOnlyObjectProperty<TreeTableView<S>> |
treeTableViewProperty() |
private ReadOnlyObjectWrapper<TreeTableView<S>> |
treeTableViewPropertyImpl() |
private void |
updateColumnIndex() |
private void |
updateEditing() |
private void |
updateFocus() |
private void |
updateItem(int oldIndex) |
void |
updateSelected(boolean selected)
Updates whether this cell is in a selected state or not.
|
private void |
updateSelection() |
void |
updateTreeTableColumn(TreeTableColumn<S,T> col)
Updates the TreeTableColumn associated with this TreeTableCell.
|
void |
updateTreeTableRow(TreeTableRow<S> treeTableRow)
Updates the TreeTableRow associated with this TreeTableCell.
|
void |
updateTreeTableView(TreeTableView<S> tv)
Updates the TreeTableView associated with this TreeTableCell.
|
getIndex, indexProperty, updateIndex
editableProperty, editingProperty, emptyProperty, getItem, impl_cssGetFocusTraversableInitialValue, isEditable, isEditing, isEmpty, isItemChanged, isSelected, itemProperty, selectedProperty, setEditable, setItem, setSelected, updateItem
alignmentProperty, contentDisplayProperty, ellipsisStringProperty, fontProperty, getAlignment, getClassCssMetaData, getContentBias, getContentDisplay, getControlCssMetaData, getEllipsisString, getFont, getGraphic, getGraphicTextGap, getLabelPadding, getLineSpacing, getText, getTextAlignment, getTextFill, getTextOverrun, graphicProperty, graphicTextGapProperty, impl_cssGetAlignmentInitialValue, isMnemonicParsing, isUnderline, isWrapText, labelPaddingProperty, lineSpacingProperty, mnemonicParsingProperty, setAlignment, setContentDisplay, setEllipsisString, setFont, setGraphic, setGraphicTextGap, setLineSpacing, setMnemonicParsing, setText, setTextAlignment, setTextFill, setTextOverrun, setUnderline, setWrapText, textAlignmentProperty, textFillProperty, textOverrunProperty, textProperty, toString, underlineProperty, wrapTextProperty
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getControlChildren, getCssMetaData, getSkin, getTooltip, impl_processCSS, isResizable, loadSkinClass, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, 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, snapSize, snapSpace, snapToPixelProperty, widthProperty
getChildren, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBounds
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, 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, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, 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, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
boolean lockItemOnEdit
private boolean itemDirty
private ListChangeListener<TreeTablePosition<S,?>> selectedListener
private final InvalidationListener focusedListener
private final InvalidationListener tableRowUpdateObserver
private final InvalidationListener editingListener
private ListChangeListener<TreeTableColumn<S,?>> visibleLeafColumnsListener
private ListChangeListener<java.lang.String> columnStyleClassListener
private final InvalidationListener rootPropertyListener
private final InvalidationListener columnStyleListener
private final InvalidationListener columnIdListener
private final WeakListChangeListener<TreeTablePosition<S,?>> weakSelectedListener
private final WeakInvalidationListener weakFocusedListener
private final WeakInvalidationListener weaktableRowUpdateObserver
private final WeakInvalidationListener weakEditingListener
private final WeakListChangeListener<TreeTableColumn<S,?>> weakVisibleLeafColumnsListener
private final WeakListChangeListener<java.lang.String> weakColumnStyleClassListener
private final WeakInvalidationListener weakColumnStyleListener
private final WeakInvalidationListener weakColumnIdListener
private final WeakInvalidationListener weakRootPropertyListener
private ReadOnlyObjectWrapper<TreeTableColumn<S,T>> treeTableColumn
private ReadOnlyObjectWrapper<TreeTableView<S>> treeTableView
private ReadOnlyObjectWrapper<TreeTableRow<S>> treeTableRow
private boolean isLastVisibleColumn
private int columnIndex
private boolean updateEditingIndex
private ObservableValue<T> currentObservableValue
private boolean isFirstRun
private java.lang.ref.WeakReference<S> oldRowItemRef
private static final java.lang.String DEFAULT_STYLE_CLASS
private static final PseudoClass PSEUDO_CLASS_LAST_VISIBLE
public TreeTableCell()
public final ReadOnlyObjectProperty<TreeTableColumn<S,T>> tableColumnProperty()
private void setTableColumn(TreeTableColumn<S,T> value)
public final TreeTableColumn<S,T> getTableColumn()
private void setTreeTableView(TreeTableView<S> value)
public final TreeTableView<S> getTreeTableView()
public final ReadOnlyObjectProperty<TreeTableView<S>> treeTableViewProperty()
private ReadOnlyObjectWrapper<TreeTableView<S>> treeTableViewPropertyImpl()
private void setTreeTableRow(TreeTableRow<S> value)
public final TreeTableRow<S> getTreeTableRow()
public final ReadOnlyObjectProperty<TreeTableRow<S>> tableRowProperty()
public void startEdit()
public void commitEdit(T newValue)
ListView
). This will begin the process of pushing this edit
back to the relevant data source / property (although it does not
guarantee that this will be successful - that is dependent upon the
specific edit commit handler being used). Refer to the UI control
class javadoc for more detail.In general there is no need to override this method in custom cell
implementations - it should be sufficient to simply call this method
when appropriate (e.g. when the user pressed the Enter key, you may do something
like cell.commitEdit(converter.fromString(textField.getText()));
commitEdit
in class Cell<T>
newValue
- The value as input by the end user, which should be
persisted in the relevant way given the data source underpinning the
user interface and the install edit commit handler of the UI control.public void cancelEdit()
cancelEdit
in class Cell<T>
public void updateSelected(boolean selected)
updateSelected
in class Cell<T>
selected
- whether or not to select this cell.void indexChanged(int oldIndex, int newIndex)
indexChanged
in class IndexedCell<T>
private void updateColumnIndex()
private void updateSelection()
private void updateFocus()
private void updateEditing()
private boolean match(TreeTablePosition pos)
private boolean isInCellSelectionMode()
private void updateItem(int oldIndex)
protected void layoutChildren()
Control
Parent
. By default it will only set the size of managed,
resizable content to their preferred sizes and does not do any node
positioning.
Subclasses should override this function to layout content as needed.
layoutChildren
in class Control
public final void updateTreeTableView(TreeTableView<S> tv)
public final void updateTreeTableRow(TreeTableRow<S> treeTableRow)
public final void updateTreeTableColumn(TreeTableColumn<S,T> col)
protected Skin<?> createDefaultSkin()
-fx-skin
or set explicitly in a sub-class with setSkin(...)
.createDefaultSkin
in class Control
private void possiblySetId(java.lang.String idCandidate)
private void possiblySetStyle(java.lang.String styleCandidate)
public java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)
queryAccessibleAttribute
in class Control
attribute
- the requested attributeparameters
- optional list of parametersAccessibleAttribute
public void executeAccessibleAction(AccessibleAction action, java.lang.Object... parameters)
Node
This method is commonly overridden by subclasses to implement
action that are required for a specific role.
If a particular action is not handled, the super class implementation
must be called.
executeAccessibleAction
in class Control
action
- the action to executeparameters
- optional list of parametersAccessibleAction