T
- The type of the item contained within the Cell.public class IndexedCell<T> extends Cell<T>
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".
Type | Property and Description |
---|---|
ReadOnlyIntegerProperty |
index
|
editableProperty, editingProperty, emptyProperty, itemProperty, selectedProperty
alignmentProperty, contentDisplayProperty, ellipsisStringProperty, fontProperty, graphicProperty, graphicTextGapProperty, labelPaddingProperty, lineSpacingProperty, mnemonicParsingProperty, textAlignmentProperty, textFillProperty, textOverrunProperty, textProperty, underlineProperty, wrapTextProperty
contextMenuProperty, skinClassNameProperty, skinProperty, tooltipProperty
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DEFAULT_STYLE_CLASS |
private ReadOnlyIntegerWrapper |
index
*
Properties *
*
|
private static PseudoClass |
PSEUDO_CLASS_EVEN |
private static PseudoClass |
PSEUDO_CLASS_ODD |
Constructor and Description |
---|
IndexedCell()
Creates a default IndexedCell with the default style class of 'indexed-cell'.
|
Modifier and Type | Method and Description |
---|---|
int |
getIndex()
Returns the index that this cell represents in the underlying control
data model.
|
(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.
|
ReadOnlyIntegerProperty |
indexProperty()
|
void |
updateIndex(int i)
Updates the index associated with this IndexedCell.
|
cancelEdit, commitEdit, editableProperty, editingProperty, emptyProperty, getInitialFocusTraversable, getItem, isEditable, isEditing, isEmpty, isItemChanged, isSelected, itemProperty, layoutChildren, selectedProperty, setEditable, setItem, setSelected, startEdit, updateItem, updateSelected
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
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, createDefaultSkin, executeAccessibleAction, getBaselineOffset, getContextMenu, getControlChildren, getCssMetaData, getSkin, getTooltip, isResizable, loadSkinClass, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
public final ReadOnlyIntegerProperty indexProperty
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())
private ReadOnlyIntegerWrapper index
private static final java.lang.String DEFAULT_STYLE_CLASS
private static final PseudoClass PSEUDO_CLASS_ODD
private static final PseudoClass PSEUDO_CLASS_EVEN
public IndexedCell()
public final int getIndex()
public final ReadOnlyIntegerProperty indexProperty()
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())
public void updateIndex(int i)
i
- the index associated with this indexed cellvoid indexChanged(int oldIndex, int newIndex)
oldIndex
- newIndex
-