java.lang.Object
org.tentackle.fx.ShortLongTextCellFactory<T>
- All Implemented Interfaces:
javafx.util.Callback<javafx.scene.control.ListView<T>,javafx.scene.control.ListCell<T>>
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
ShortLongText.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.control.ListCell<T>protected ShortLongTextgetShortLongText(T item) Returns whether the long text should be shown for the given 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
Returns whether the long text should be shown for the given item.- Parameters:
item- the item- Returns:
- the
ShortLongTextto be displayed, null if only short text as toString()
-
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
-