APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.scene.control

public Class IndexedCell<T>

extends Cell<T>
Class Inheritance
Known Direct Subclasses
javafx.scene.control.ListCell, javafx.scene.control.TableCell, javafx.scene.control.TableRow, javafx.scene.control.TreeCell, javafx.scene.control.TreeTableCell, javafx.scene.control.TreeTableRow
Type Parameters
<T>
The type of the item contained within the Cell.
Imports
javafx.css.PseudoClass, javafx.beans.property.ReadOnlyIntegerProperty, .ReadOnlyIntegerWrapper

An implementation of Cell which contains an index property which maps into the data model underlying the visualization. Despite this, IndexedCell should not be instantiated directly in a cell factory (refer to Cell for more details on what a cell factory is). Instead of creating IndexedCell directly, you should instead make use of the control-specific cell implementations (for example, ListCell, TreeCell) TableRow and TableCell). For more information about using and customizing cells, refer to the Cell API documentation.

Because each sequential index represents a single sequential element in the control, this allows for easy alternative row highlighting. By default the controls which use Cells provide their own alternative row highlighting colors, but this can be overridden using two pseudo class states provided by IndexedCell: "even" and "odd".

Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private static final String
private ReadOnlyIntegerWrapper
private int
private static final PseudoClass
private static final PseudoClass

Constructor Summary

AccessConstructor and Description
public
IndexedCell()

Creates a default IndexedCell with the default style class of 'indexed-cell'.

Method Summary

Modifier and TypeMethod and Description
public final int

Returns:

the index that this cell represents in the underlying control data model
getIndex
()

Returns the index that this cell represents in the underlying control data model.

pack-priv void
indexChanged(int
the old index
oldIndex
,
int
the new index
newIndex
)

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

public final ReadOnlyIntegerProperty

Returns:

the location of this cell in the virtualized control
indexProperty
()

The location of this cell in the virtualized control (e.g: ListView, TreeView, TableView, etc).

public void
updateIndex(int
the index associated with this indexed cell
newIndex
)

Updates the index associated with this IndexedCell.

Inherited from javafx.scene.control.Cell:
cancelEditcommitEditeditablePropertyeditingPropertyemptyPropertygetInitialFocusTraversablegetItemisEditableisEditingisEmptyisItemChangedisSelecteditemPropertylayoutChildrenselectedPropertysetEditablesetItemsetSelectedstartEditupdateItemupdateSelected

Field Detail

DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS

Hides javafx.scene.control.Cell.DEFAULT_STYLE_CLASS.

indexback to summary
private ReadOnlyIntegerWrapper index
oldIndexback to summary
private int oldIndex
PSEUDO_CLASS_EVENback to summary
private static final PseudoClass PSEUDO_CLASS_EVEN
PSEUDO_CLASS_ODDback to summary
private static final PseudoClass PSEUDO_CLASS_ODD

Constructor Detail

IndexedCellback to summary
public IndexedCell()

Creates a default IndexedCell with the default style class of 'indexed-cell'.

Method Detail

getIndexback to summary
public final int getIndex()

Returns the index that this cell represents in the underlying control data model.

Returns:int

the index that this cell represents in the underlying control data model

indexChangedback to summary
pack-priv 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.

Parameters
oldIndex:int

the old index

newIndex:int

the new index

indexPropertyback to summary
public final ReadOnlyIntegerProperty indexProperty()

The location of this cell in the virtualized control (e.g: ListView, TreeView, TableView, etc). This is the model index which corresponds exactly with the Cell item property. For example, in the case of a ListView, this means the following: cell.item == listView.getItems().get(cell.getIndex())

Returns:ReadOnlyIntegerProperty

the location of this cell in the virtualized control

updateIndexback to summary
public void updateIndex(int newIndex)

Updates the index associated with this IndexedCell.

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
newIndex:int

the index associated with this indexed cell