Top Description Fields Constructors Methods
javafx.scene.control

public Class TreeTableCell<S, T>

extends IndexedCell<T>
Class Inheritance
Known Direct Subclasses
javafx.scene.control.cell.CheckBoxTreeTableCell, javafx.scene.control.cell.ChoiceBoxTreeTableCell, javafx.scene.control.cell.ComboBoxTreeTableCell, javafx.scene.control.cell.ProgressBarTreeTableCell, javafx.scene.control.cell.TextFieldTreeTableCell
Type Parameters
<S>
The type of the TreeTableView generic type
<T>
The type of the item contained within the Cell.
Imports
javafx.css.PseudoClass, javafx.scene.control.skin.TreeTableCellSkin, javafx.beans.InvalidationListener, .WeakInvalidationListener, javafx.beans.value.ObservableValue, javafx.collections.ListChangeListener, .WeakListChangeListener, javafx.event.Event, java.lang.ref.WeakReference, javafx.beans.property.ReadOnlyObjectProperty, .ReadOnlyObjectWrapper, javafx.scene.AccessibleAction, .AccessibleAttribute, .AccessibleRole, javafx.scene.control.TreeTableColumn.CellEditEvent, .TreeTableView.TreeTableViewFocusModel

Represents a single row/column intersection in a 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:

  1. The TableSelectionModel#isSelected(int, TableColumnBase) method returns true for the row / column that this cell represents, and
  2. The cell selection mode property is set to true (to represent that it is allowable to select individual cells (and not just rows of cells)).
Since
JavaFX 8.0
See Also
TreeTableView, TreeTableColumn, Cell, IndexedCell, TreeTableRow

Field Summary

Modifier and TypeField and Description
private final InvalidationListener
private int
private ListChangeListener<String>
private final InvalidationListener
private ObservableValue<T>
private static final String
private TreeTablePosition<S, T>
private final InvalidationListener
private final InvalidationListener
private boolean
private boolean
private boolean
private WeakReference<S>
private static final PseudoClass
private final InvalidationListener
private ListChangeListener<TreeTablePosition<S, ?>>
private ReadOnlyObjectWrapper<TreeTableColumn<S, T>>
tableColumn

The TreeTableColumn instance that backs this TreeTableCell.

private ReadOnlyObjectWrapper<TreeTableRow<S>>
tableRow

The TreeTableRow that this TreeTableCell currently finds itself placed within.

private final InvalidationListener
private ReadOnlyObjectWrapper<TreeTableView<S>>
treeTableView

The TreeTableView associated with this TreeTableCell.

private boolean
private ListChangeListener<TreeTableColumn<S, ?>>
private final WeakInvalidationListener
private final WeakListChangeListener<String>
private final WeakInvalidationListener
private final WeakInvalidationListener
private final WeakInvalidationListener
private final WeakInvalidationListener
private final WeakListChangeListener<TreeTablePosition<S, ?>>
private final WeakInvalidationListener
private final WeakListChangeListener<TreeTableColumn<S, ?>>

Constructor Summary

AccessConstructor and Description
public
TreeTableCell()

Constructs a default TreeTableCell instance with a style class of 'tree-table-cell'.

Method Summary

Modifier and TypeMethod and Description
public void
cancelEdit()

Overrides javafx.scene.control.Cell.cancelEdit.

Cancels an edit to the value of the cell.

public void
commitEdit(T newValue)

Overrides javafx.scene.control.Cell.commitEdit.

Commits an edit to the value of the cell.

protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

private void
doCancelEdit()

Switches an editing cell into not editing without changing control's editing state.

public void
executeAccessibleAction(AccessibleAction action, Object... parameters)

Overrides javafx.scene.control.Control.executeAccessibleAction.

This method is called by the assistive technology to request the action indicated by the argument should be executed.

pack-priv TreeTablePosition<S, T>
public final TreeTableColumn<S, T>
public final TreeTableRow<S>

Returns:

the value of the property tableRow
getTableRow
()

Gets the value of the property tableRow.

public final TreeTableRow<S>
getTreeTableRow()
Deprecated since 17. Use getTableRow instead.

Returns: the TreeTableRow

public final TreeTableView<S>
pack-priv void
indexChanged(int oldIndex, int newIndex)

Overrides javafx.scene.control.IndexedCell.indexChanged.

This method is called whenever the index is changed, regardless of whether the new index is the same as the old index.

private boolean
protected void
layoutChildren()

Overrides javafx.scene.control.Cell.layoutChildren.

Invoked during the layout pass to layout the children in this Parent.

private boolean
private void
possiblySetId(String idCandidate)

private void
possiblySetStyle(String styleCandidate)

public Object
queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)

Overrides javafx.scene.control.Control.queryAccessibleAttribute.

This method is called by the assistive technology to request the value for an attribute.

private void
private void
private void
public void
startEdit()

Overrides javafx.scene.control.Cell.startEdit.

Starts an edit to the value of the cell.

public final ReadOnlyObjectProperty<TreeTableColumn<S, T>>
public final ReadOnlyObjectProperty<TreeTableRow<S>>
public final ReadOnlyObjectProperty<TreeTableView<S>>
private ReadOnlyObjectWrapper<TreeTableView<S>>
private void
private void
private void
private void
updateItem(int oldIndex)

public void
updateSelected(boolean selected)

Overrides javafx.scene.control.Cell.updateSelected.

Updates whether this cell is in a selected state or not.

private void
public final void
updateTableColumn(TreeTableColumn<S, T>
the TreeTableColumn associated with this TreeTableCell
column
)

Updates the TreeTableColumn associated with this TreeTableCell.

public final void
updateTableRow(TreeTableRow<S>
the TreeTableRow associated with this TreeTableCell
row
)

Updates the TreeTableRow associated with this TreeTableCell.

public final void
updateTreeTableColumn(TreeTableColumn<S, T>
the TreeTableColumn
column
)
Deprecated since 17. Use updateTableColumn instead.

public final void
updateTreeTableRow(TreeTableRow<S>
the TreeTableRow
row
)
Deprecated since 17. Use updateTableRow instead.

public final void
updateTreeTableView(TreeTableView<S>
the TreeTableView associated with this TreeTableCell
tv
)

Updates the TreeTableView associated with this TreeTableCell.

Inherited from javafx.scene.control.IndexedCell:
getIndexindexPropertyupdateIndex

Field Detail

columnIdListenerback to summary
private final InvalidationListener columnIdListener
columnIndexback to summary
private int columnIndex
columnStyleClassListenerback to summary
private ListChangeListener<String> columnStyleClassListener
columnStyleListenerback to summary
private final InvalidationListener columnStyleListener
currentObservableValueback to summary
private ObservableValue<T> currentObservableValue
DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS

Hides javafx.scene.control.IndexedCell.DEFAULT_STYLE_CLASS.

editingCellAtStartEditback to summary
private TreeTablePosition<S, T> editingCellAtStartEdit
editingListenerback to summary
private final InvalidationListener editingListener
focusedListenerback to summary
private final InvalidationListener focusedListener
isFirstRunback to summary
private boolean isFirstRun
isLastVisibleColumnback to summary
private boolean isLastVisibleColumn
itemDirtyback to summary
private boolean itemDirty

Hides javafx.scene.control.Cell.itemDirty.

oldRowItemRefback to summary
private WeakReference<S> oldRowItemRef
PSEUDO_CLASS_LAST_VISIBLEback to summary
private static final PseudoClass PSEUDO_CLASS_LAST_VISIBLE
rootPropertyListenerback to summary
private final InvalidationListener rootPropertyListener
selectedListenerback to summary
private ListChangeListener<TreeTablePosition<S, ?>> selectedListener
tableColumnback to summary
private ReadOnlyObjectWrapper<TreeTableColumn<S, T>> tableColumn

The TreeTableColumn instance that backs this TreeTableCell.

tableRowback to summary
private ReadOnlyObjectWrapper<TreeTableRow<S>> tableRow

The TreeTableRow that this TreeTableCell currently finds itself placed within.

tableRowUpdateObserverback to summary
private final InvalidationListener tableRowUpdateObserver
treeTableViewback to summary
private ReadOnlyObjectWrapper<TreeTableView<S>> treeTableView

The TreeTableView associated with this TreeTableCell.

updateEditingIndexback to summary
private boolean updateEditingIndex
visibleLeafColumnsListenerback to summary
private ListChangeListener<TreeTableColumn<S, ?>> visibleLeafColumnsListener
weakColumnIdListenerback to summary
private final WeakInvalidationListener weakColumnIdListener
weakColumnStyleClassListenerback to summary
private final WeakListChangeListener<String> weakColumnStyleClassListener
weakColumnStyleListenerback to summary
private final WeakInvalidationListener weakColumnStyleListener
weakEditingListenerback to summary
private final WeakInvalidationListener weakEditingListener
weakFocusedListenerback to summary
private final WeakInvalidationListener weakFocusedListener
weakRootPropertyListenerback to summary
private final WeakInvalidationListener weakRootPropertyListener
weakSelectedListenerback to summary
private final WeakListChangeListener<TreeTablePosition<S, ?>> weakSelectedListener
weaktableRowUpdateObserverback to summary
private final WeakInvalidationListener weaktableRowUpdateObserver
weakVisibleLeafColumnsListenerback to summary
private final WeakListChangeListener<TreeTableColumn<S, ?>> weakVisibleLeafColumnsListener

Constructor Detail

TreeTableCellback to summary
public TreeTableCell()

Constructs a default TreeTableCell instance with a style class of 'tree-table-cell'.

Method Detail

cancelEditback to summary
public void cancelEdit()

Overrides javafx.scene.control.Cell.cancelEdit.

Doc from javafx.scene.control.Cell.cancelEdit.

Cancels an edit to the value of the cell. Call this function to transition from an editing state into a non-editing state, without saving any user input.

Annotations
@Override
commitEditback to summary
public void commitEdit(T newValue)

Overrides javafx.scene.control.Cell.commitEdit.

Doc from javafx.scene.control.Cell.commitEdit.

Commits an edit to the value of the cell. Call this function when appropriate (based on the user interaction requirements of your cell editing user interface) to do two things:

  1. Fire the appropriate events back to the backing UI control (e.g., 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.
  2. Begin the transition from an editing state into a non-editing state.

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()));

Annotations
@Override
createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Annotations
@Override
doCancelEditback to summary
private void doCancelEdit()

Switches an editing cell into not editing without changing control's editing state.

executeAccessibleActionback to summary
public void executeAccessibleAction(AccessibleAction action, Object... parameters)

Overrides javafx.scene.control.Control.executeAccessibleAction.

Doc from javafx.scene.control.Control.executeAccessibleAction.

This method is called by the assistive technology to request the action indicated by the argument should be executed.

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 superclass implementation must be called.

Annotations
@Override
getEditingCellAtStartEditback to summary
pack-priv TreeTablePosition<S, T> getEditingCellAtStartEdit()
getTableColumnback to summary
public final TreeTableColumn<S, T> getTableColumn()
getTableRowback to summary
public final TreeTableRow<S> getTableRow()

Gets the value of the property tableRow.

Returns:TreeTableRow<S>

the value of the property tableRow

Since
17
getTreeTableRowback to summary
public final TreeTableRow<S> getTreeTableRow()

Deprecated

since 17.

Use getTableRow instead.

Returns:TreeTableRow<S>

the TreeTableRow

Annotations
@Deprecated
since:17
getTreeTableViewback to summary
public final TreeTableView<S> getTreeTableView()
indexChangedback to summary
pack-priv void indexChanged(int oldIndex, int newIndex)

Overrides javafx.scene.control.IndexedCell.indexChanged.

Doc from javafx.scene.control.IndexedCell.indexChanged.

This method is called whenever the index is changed, regardless of whether the new index is the same as the old index.

Annotations
@Override
isInCellSelectionModeback to summary
private boolean isInCellSelectionMode()
layoutChildrenback to summary
protected void layoutChildren()

Overrides javafx.scene.control.Cell.layoutChildren.

Doc from javafx.scene.control.Cell.layoutChildren.

Invoked during the layout pass to layout the children in this 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.

Annotations
@Override
matchback to summary
private boolean match(TreeTablePosition<S, T> pos)
possiblySetIdback to summary
private void possiblySetId(String idCandidate)
possiblySetStyleback to summary
private void possiblySetStyle(String styleCandidate)
queryAccessibleAttributeback to summary
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)

Overrides javafx.scene.control.Control.queryAccessibleAttribute.

Doc from javafx.scene.control.Control.queryAccessibleAttribute.

This method is called by the assistive technology to request the value for an attribute.

This method is commonly overridden by subclasses to implement attributes that are required for a specific role.
If a particular attribute is not handled, the superclass implementation must be called.

Annotations
@Override
setTableColumnback to summary
private void setTableColumn(TreeTableColumn<S, T> value)
setTableRowback to summary
private void setTableRow(TreeTableRow<S> value)
setTreeTableViewback to summary
private void setTreeTableView(TreeTableView<S> value)
startEditback to summary
public void startEdit()

Overrides javafx.scene.control.Cell.startEdit.

Doc from javafx.scene.control.Cell.startEdit.

Starts an edit to the value of the cell. Call this function to transition from a non-editing state into an editing state, if the cell is editable. If this cell is already in an editing state, it will stay in it.

Annotations
@Override
tableColumnPropertyback to summary
public final ReadOnlyObjectProperty<TreeTableColumn<S, T>> tableColumnProperty()
tableRowPropertyback to summary
public final ReadOnlyObjectProperty<TreeTableRow<S>> tableRowProperty()
treeTableViewPropertyback to summary
public final ReadOnlyObjectProperty<TreeTableView<S>> treeTableViewProperty()
treeTableViewPropertyImplback to summary
private ReadOnlyObjectWrapper<TreeTableView<S>> treeTableViewPropertyImpl()
updateColumnIndexback to summary
private void updateColumnIndex()
updateEditingback to summary
private void updateEditing()
updateFocusback to summary
private void updateFocus()
updateItemback to summary
private void updateItem(int oldIndex)
updateSelectedback to summary
public void updateSelected(boolean selected)

Overrides javafx.scene.control.Cell.updateSelected.

Doc from javafx.scene.control.Cell.updateSelected.

Updates whether this cell is in a selected state or not.

Annotations
@Override
updateSelectionback to summary
private void updateSelection()
updateTableColumnback to summary
public final void updateTableColumn(TreeTableColumn<S, T> column)

Updates the TreeTableColumn associated with this TreeTableCell.

Note

This function is intended to be used by experts, primarily by those implementing new Skins. It is not common for developers or designers to access this function directly.

Parameters
column:TreeTableColumn<S, T>

the TreeTableColumn associated with this TreeTableCell

Since
17
updateTableRowback to summary
public final void updateTableRow(TreeTableRow<S> row)

Updates the TreeTableRow associated with this TreeTableCell.

Note

This function is intended to be used by experts, primarily by those implementing new Skins. It is not common for developers or designers to access this function directly.

Parameters
row:TreeTableRow<S>

the TreeTableRow associated with this TreeTableCell

Since
17
updateTreeTableColumnback to summary
public final void updateTreeTableColumn(TreeTableColumn<S, T> column)

Deprecated

since 17.

Use updateTableColumn instead.

Parameters
column:TreeTableColumn<S, T>

the TreeTableColumn

Annotations
@Deprecated
since:17
updateTreeTableRowback to summary
public final void updateTreeTableRow(TreeTableRow<S> row)

Deprecated

since 17.

Use updateTableRow instead.

Parameters
row:TreeTableRow<S>

the TreeTableRow

Annotations
@Deprecated
since:17
updateTreeTableViewback to summary
public final void updateTreeTableView(TreeTableView<S> tv)

Updates the TreeTableView associated with this TreeTableCell. This is typically only done once when the TreeTableCell is first added to the TreeTableView.

Note

This function is intended to be used by experts, primarily by those implementing new Skins. It is not common for developers or designers to access this function directly.

Parameters
tv:TreeTableView<S>

the TreeTableView associated with this TreeTableCell