Top Inners Fields Constructors Methods
com.dlsc.gemsfx.gridtable

public Class GridTableCell<S, T>

extends Cell<T>
Class Inheritance
Imports
com.dlsc.gemsfx.skins.GridTableCellSkin, javafx.beans.property.IntegerProperty, .ObjectProperty, .SimpleIntegerProperty, .SimpleObjectProperty, javafx.css.CssMetaData, .PseudoClass, .Styleable, .StyleableBooleanProperty, .StyleableProperty, javafx.css.converter.BooleanConverter, javafx.geometry.Pos, javafx.scene.control.Cell, .Skin, javafx.util.StringConverter, java.util.ArrayList, .Collections, .List

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final ObjectProperty<GridTableColumn<S, T>>
private static final String
private static final boolean
private final IntegerProperty
private static final PseudoClass
private static final PseudoClass
private final ObjectProperty<S>
private StyleableBooleanProperty

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final ObjectProperty<GridTableColumn<S, T>>
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

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

public static List<CssMetaData<? extends Styleable, ?>>
getClassCssMetaData()

Hides javafx.scene.control.Labeled.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

public final GridTableColumn<S, T>
public List<CssMetaData<? extends Styleable, ?>>
getControlCssMetaData()

Overrides javafx.scene.control.Labeled.getControlCssMetaData.

Gets the unmodifiable list of the control's CSS-styleable properties.

public final int
public S
public final IntegerProperty
public final boolean
public ObjectProperty<S>
pack-priv final void
setColumn(GridTableColumn<S, T> column)

pack-priv final void
setIndex(int index)

public void
setRowItem(S rowItem)

public final void
setTransparent(final boolean transparent)

public final StyleableBooleanProperty
transparentProperty()

A custom property to enable CSS-based control of mouse transparency.

protected void
updateItem(T item, boolean empty)

Overrides javafx.scene.control.Cell.updateItem.

The updateItem method should not be called by developers, but it is the best method for developers to override to allow for them to customise the visuals of the cell.

Inherited from javafx.scene.control.Cell:
cancelEditcommitEditeditablePropertyeditingPropertyemptyPropertygetInitialFocusTraversablegetItemisEditableisEditingisEmptyisItemChangedisSelecteditemPropertylayoutChildrenselectedPropertysetEditablesetItemstartEditupdateSelected

Field Detail

columnback to summary
private final ObjectProperty<GridTableColumn<S, T>> column
DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS

Hides javafx.scene.control.Cell.DEFAULT_STYLE_CLASS.

DEFAULT_TRANSPARENTback to summary
private static final boolean DEFAULT_TRANSPARENT
indexback to summary
private final IntegerProperty index
PSEUDO_CLASS_EVENback to summary
private static final PseudoClass PSEUDO_CLASS_EVEN
PSEUDO_CLASS_ODDback to summary
private static final PseudoClass PSEUDO_CLASS_ODD
rowItemback to summary
private final ObjectProperty<S> rowItem
transparentback to summary
private StyleableBooleanProperty transparent

Constructor Detail

GridTableCellback to summary
public GridTableCell()

Method Detail

columnPropertyback to summary
public final ObjectProperty<GridTableColumn<S, T>> columnProperty()
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
getClassCssMetaDataback to summary
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()

Hides javafx.scene.control.Labeled.getClassCssMetaData.

Doc from javafx.scene.control.Labeled.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

getColumnback to summary
public final GridTableColumn<S, T> getColumn()
getControlCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getControlCssMetaData()

Overrides javafx.scene.control.Labeled.getControlCssMetaData.

Doc from javafx.scene.control.Labeled.getControlCssMetaData.

Gets the unmodifiable list of the control's CSS-styleable properties.

Annotations
@Override
getIndexback to summary
public final int getIndex()
getRowItemback to summary
public S getRowItem()
indexPropertyback to summary
public final IntegerProperty indexProperty()
isTransparentback to summary
public final boolean isTransparent()
rowItemPropertyback to summary
public ObjectProperty<S> rowItemProperty()
setColumnback to summary
pack-priv final void setColumn(GridTableColumn<S, T> column)
setIndexback to summary
pack-priv final void setIndex(int index)
setRowItemback to summary
public void setRowItem(S rowItem)
setTransparentback to summary
public final void setTransparent(final boolean transparent)
transparentPropertyback to summary
public final StyleableBooleanProperty transparentProperty()

A custom property to enable CSS-based control of mouse transparency. Since mouseTransparent cannot be directly set through CSS, transparentProperty allows for CSS-driven adjustments, facilitating easier styling without altering existing code.

updateItemback to summary
protected void updateItem(T item, boolean empty)

Overrides javafx.scene.control.Cell.updateItem.

Doc from javafx.scene.control.Cell.updateItem.

The updateItem method should not be called by developers, but it is the best method for developers to override to allow for them to customise the visuals of the cell. To clarify, developers should never call this method in their code (they should leave it up to the UI control, such as the javafx.scene.control.ListView control) to call this method. However, the purpose of having the updateItem method is so that developers, when specifying custom cell factories (again, like the ListView cell factory), the updateItem method can be overridden to allow for complete customisation of the cell.

It is very important that subclasses of Cell override the updateItem method properly, as failure to do so will lead to issues such as blank cells or cells with unexpected content appearing within them. Here is an example of how to properly override the updateItem method:

protected void updateItem(T item, boolean empty) {
    super.updateItem(item, empty);

    if (empty || item == null) {
        setText(null);
        setGraphic(null);
    } else {
        setText(item.toString());
    }
}

Note in this code sample two important points:

  1. We call the super.updateItem(T, boolean) method. If this is not done, the item and empty properties are not correctly set, and you are likely to end up with graphical issues.
  2. We test for the empty condition, and if true, we set the text and graphic properties to null. If we do not do this, it is almost guaranteed that end users will see graphical artifacts in cells unexpectedly.
Annotations
@Override
com.dlsc.gemsfx.gridtable back to summary

private Class GridTableCell.StyleableProperties

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final List<CssMetaData<? extends Styleable, ?>>
private static final CssMetaData<GridTableCell<S, T>, Boolean>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

STYLEABLESback to summary
private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES
TRANSPARENTback to summary
private static final CssMetaData<GridTableCell<S, T>, Boolean> TRANSPARENT

Constructor Detail

StyleablePropertiesback to summary
private StyleableProperties()