- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.control.Control
-
- javafx.scene.control.Labeled
-
- javafx.scene.control.Cell<T>
-
- javafx.scene.control.IndexedCell<T>
-
- javafx.scene.control.TreeTableCell<S,T>
-
- 参数类型
-
S
- TreeTableView泛型类型的类型 -
T
- 单元格中包含的项目的类型。
- All Implemented Interfaces:
-
Styleable
,EventTarget
,Skinnable
- 已知直接子类:
-
CheckBoxTreeTableCell
,ChoiceBoxTreeTableCell
,ComboBoxTreeTableCell
,ProgressBarTreeTableCell
,TextFieldTreeTableCell
public class TreeTableCell<S,T> extends IndexedCell<T>
在TreeTableView
中表示单行/列交集。 要表示此交集,TreeTableCell包含一个index
属性,以及一个tableColumn
属性。 另外,一个TreeTableCell实例知道它存在的是TreeTableRow
。关于选择的注释: TreeTableCell可视化显示在满足两个条件时被选中:
-
TableSelectionModel.isSelected(int, TableColumnBase)
方法对于此单元格表示的行/列返回true -
cell selection mode
属性设置为true(表示可以选择单个单元格(而不仅仅是单元格行))。
- 从以下版本开始:
- JavaFX 8.0
- 另请参见:
-
TreeTableView
,TreeTableColumn
,Cell
,IndexedCell
,TreeTableRow
-
-
Property Summary
Properties Type Property 描述 ReadOnlyObjectProperty<TreeTableColumn<S,T>>
tableColumn
ReadOnlyObjectProperty<TreeTableRow<S>>
tableRow
ReadOnlyObjectProperty<TreeTableView<S>>
treeTableView
与此TreeTableCell关联的TreeTableView。-
Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltip
-
Properties inherited from class javafx.scene.control.IndexedCell
index
-
Properties inherited from class javafx.scene.control.Labeled
alignment, contentDisplay, ellipsisString, font, graphic, graphicTextGap, labelPadding, lineSpacing, mnemonicParsing, textAlignment, textFill, textOverrun, text, underline, wrapText
-
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, 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 class javafx.scene.Parent
needsLayout
-
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
-
-
Field Summary
-
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
-
-
构造方法摘要
构造方法 Constructor 描述 TreeTableCell()
构造一个具有“tree-table-cell”样式类的默认TreeTableCell实例。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 void
cancelEdit()
调用此功能从编辑状态转换为非编辑状态,而不保存任何用户输入。void
commitEdit(T newValue)
在适当的时候调用此功能(根据您的单元格编辑用户界面的用户交互需求)来执行以下两件事:将相应的事件反馈回支持UI控件(例如protected Skin<?>
createDefaultSkin()
为此控件创建一个新的默认皮肤实例。void
executeAccessibleAction(AccessibleAction action, Object... parameters)
该方法由辅助技术调用,请求执行由参数指示的动作。TreeTableColumn<S,T>
getTableColumn()
获取属性tableColumn的值。TreeTableRow<S>
getTreeTableRow()
TreeTableView<S>
getTreeTableView()
获取属性treeTableView的值。protected void
layoutChildren()
在布局传递过程中调用这个Parent
的孩子。Object
queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
该方法由辅助技术调用以请求属性的值。void
startEdit()
调用此功能从非编辑状态转换到编辑状态,如果单元格是可编辑的。ReadOnlyObjectProperty<TreeTableColumn<S,T>>
tableColumnProperty()
ReadOnlyObjectProperty<TreeTableRow<S>>
tableRowProperty()
ReadOnlyObjectProperty<TreeTableView<S>>
treeTableViewProperty()
与此TreeTableCell关联的TreeTableView。void
updateSelected(boolean selected)
更新此单元格是否处于选定状态。void
updateTreeTableColumn(TreeTableColumn<S,T> col)
更新与此TreeTableCell关联的TreeTableColumn。void
updateTreeTableRow(TreeTableRow<S> treeTableRow)
更新与此TreeTableCell关联的TreeTableRow。void
updateTreeTableView(TreeTableView<S> tv)
更新与此TreeTableCell关联的TreeTableView。-
Methods inherited from class javafx.scene.control.Cell
editableProperty, editingProperty, emptyProperty, getInitialFocusTraversable, getItem, isEditable, isEditing, isEmpty, isItemChanged, isSelected, itemProperty, selectedProperty, setEditable, setItem, updateItem
-
Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getCssMetaData, getSkin, getTooltip, isResizable, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
-
Methods inherited from class javafx.scene.control.IndexedCell
getIndex, indexProperty, updateIndex
-
Methods inherited from class javafx.scene.control.Labeled
alignmentProperty, contentDisplayProperty, ellipsisStringProperty, fontProperty, getAlignment, getClassCssMetaData, getContentBias, getContentDisplay, getControlCssMetaData, getEllipsisString, getFont, getGraphic, getGraphicTextGap, getInitialAlignment, getLabelPadding, getLineSpacing, getText, getTextAlignment, getTextFill, getTextOverrun, graphicProperty, graphicTextGapProperty, 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
-
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, 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, 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, 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, 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 class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
-
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 interface javafx.css.Styleable
getStyleableNode
-
-
-
-
Property Detail
-
tableColumn
public final ReadOnlyObjectProperty<TreeTableColumn<S,T>> tableColumnProperty
- 另请参见:
-
getTableColumn()
-
treeTableView
public final ReadOnlyObjectProperty<TreeTableView<S>> treeTableViewProperty
与此TreeTableCell关联的TreeTableView。- 另请参见:
-
getTreeTableView()
-
tableRow
public final ReadOnlyObjectProperty<TreeTableRow<S>> tableRowProperty
-
-
方法详细信息
-
tableColumnProperty
public final ReadOnlyObjectProperty<TreeTableColumn<S,T>> tableColumnProperty()
- 另请参见:
-
getTableColumn()
-
getTableColumn
public final TreeTableColumn<S,T> getTableColumn()
获取属性tableColumn的值。- Property description:
-
getTreeTableView
public final TreeTableView<S> getTreeTableView()
获取属性treeTableView的值。- Property description:
- 与此TreeTableCell关联的TreeTableView。
-
treeTableViewProperty
public final ReadOnlyObjectProperty<TreeTableView<S>> treeTableViewProperty()
与此TreeTableCell关联的TreeTableView。- 另请参见:
-
getTreeTableView()
-
getTreeTableRow
public final TreeTableRow<S> getTreeTableRow()
-
tableRowProperty
public final ReadOnlyObjectProperty<TreeTableRow<S>> tableRowProperty()
-
startEdit
public void startEdit()
调用此功能从非编辑状态转换到编辑状态,如果单元格是可编辑的。 如果这个单元格已经处于编辑状态,它将保留在它中。
-
commitEdit
public void commitEdit(T newValue)
在适当的时候调用此功能(基于您的单元格编辑用户界面的用户交互要求)来做两件事情:- 将适当的事件触发回到支持UI控件(例如
ListView
)。 这将开始将此编辑推回相关数据源/属性(尽管不能保证这将成功 - 这取决于正在使用的特定编辑提交处理程序)。 有关更多详细信息,请参阅UI控件类javadoc。 - 开始从编辑状态转换到非编辑状态。
一般来说,在自定义单元实现中无需重写此方法 - 在适当的时候简单地调用此方法就足够了(例如,当用户按下Enter键时,可以执行像
cell.commitEdit(converter.fromString(textField.getText()));
- 重写:
-
commitEdit
在Cell<T>
- 参数
-
newValue
- 作为最终用户输入的值,应该以相关方式newValue
给出支持用户界面的数据源和UI控件的安装编辑提交处理程序。
- 将适当的事件触发回到支持UI控件(例如
-
cancelEdit
public void cancelEdit()
调用此功能从编辑状态转换为非编辑状态,而不保存任何用户输入。- 重写:
-
cancelEdit
在Cell<T>
-
updateSelected
public void updateSelected(boolean selected)
更新此单元格是否处于选定状态。- 重写:
-
updateSelected
在Cell<T>
- 参数
-
selected
- 是否选择此单元格。
-
layoutChildren
protected void layoutChildren()
描述从类别Cell
复制在布局传递期间调用这个Parent
的孩子。 默认情况下,它只会将受管理的可调整大小的内容的大小设置为其首选大小,并且不会执行任何节点定位。子类应该根据需要重写此函数以布局内容。
- 重写:
-
layoutChildren
在Cell<T>
-
updateTreeTableView
public final void updateTreeTableView(TreeTableView<S> tv)
更新与此TreeTableCell关联的TreeTableView。 当TreeTableCell首次添加到TreeTableView时,通常只执行一次。 注意:此功能主要由专家使用,主要由实施新皮肤的人员使用。 开发人员或设计师直接访问此功能并不常见。- 参数
-
tv
- 与此TreeTableCell关联的TreeTableView
-
updateTreeTableRow
public final void updateTreeTableRow(TreeTableRow<S> treeTableRow)
更新与此TreeTableCell关联的TreeTableRow。 注意:此功能主要由专家使用,主要由实施新皮肤的人员使用。 开发人员或设计师直接访问此功能并不常见。- 参数
-
treeTableRow
- 与此TreeTableCell关联的TreeTableRow
-
updateTreeTableColumn
public final void updateTreeTableColumn(TreeTableColumn<S,T> col)
更新与此TreeTableCell关联的TreeTableColumn。 注意:此功能主要由专家使用,主要由实施新皮肤的人员使用。 开发人员或设计师直接访问此功能并不常见。- 参数
-
col
- 与此TreeTableCell关联的TreeTableColumn
-
createDefaultSkin
protected Skin<?> createDefaultSkin()
为此控件创建一个新的默认皮肤实例。 如果没有通过CSS-fx-skin
提供皮肤或者在具有setSkin(...)
的子类中显式设置,则调用此控件创建皮肤。- 重写:
-
createDefaultSkin
在Control
- 结果
- 此控件的默认皮肤的新实例。 如果为null,则控件将没有皮肤,除非由css提供。
-
queryAccessibleAttribute
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
该方法由辅助技术调用以请求属性的值。子类通常覆盖此方法来实现特定角色所需的属性。
如果未处理特定属性,则必须调用超类实现。- 重写:
-
queryAccessibleAttribute
在Control
- 参数
-
attribute
- 请求的属性 -
parameters
- 可选参数列表 - 结果
- 请求的属性的值
- 另请参见:
-
AccessibleAttribute
-
executeAccessibleAction
public void executeAccessibleAction(AccessibleAction action, Object... parameters)
该方法由辅助技术调用,请求执行由参数指示的动作。此方法通常被子类覆盖,以实现特定角色所需的操作。
如果未处理特定操作,则必须调用超类实现。- 重写:
-
executeAccessibleAction
在Control
- 参数
-
action
- 要执行的动作 -
parameters
- 可选参数列表 - 另请参见:
-
AccessibleAction
-
-