Class ShortLongTextCellFactory<T>
java.lang.Object
org.tentackle.fx.ShortLongTextCellFactory<T>
- Type Parameters:
T- the item type
- All Implemented Interfaces:
javafx.util.Callback<javafx.scene.control.ListView<T>, javafx.scene.control.ListCell<T>>
- Direct Known Subclasses:
RdcShortLongTextCellFactory
public class ShortLongTextCellFactory<T>
extends Object
implements javafx.util.Callback<javafx.scene.control.ListView<T>, javafx.scene.control.ListCell<T>>
Cell factory to display items implementing
The short and long texts are shown in two aligned columns. Items not implementing
ShortLongText.The short and long texts are shown in two aligned columns. Items not implementing
ShortLongText are shown via toString().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.control.ListCell<T> protected ShortLongTextgetShortLongText(T item) Gets the short/long text of an item.protected voidupdateLabels(T item, javafx.scene.control.Label shortLabel, javafx.scene.control.Label longLabel) Updates the labels of a cell.
-
Constructor Details
-
ShortLongTextCellFactory
public ShortLongTextCellFactory()Creates the short/long-text cell factory.
-
-
Method Details
-
call
-
getShortLongText
Gets the short/long text of an item.- Parameters:
item- the item- Returns:
- the
ShortLongTextto be displayed, null to display onlytoString()as the short text
-
updateLabels
protected void updateLabels(T item, javafx.scene.control.Label shortLabel, javafx.scene.control.Label longLabel) Updates the labels of a cell.- Parameters:
item- the item to displayshortLabel- the label for the short textlongLabel- the label for the long text
-