Class ShortLongTextCellFactory<T>

  • All Implemented Interfaces:
    javafx.util.Callback<javafx.scene.control.ListView<T>,​javafx.scene.control.ListCell<T>>

    public class ShortLongTextCellFactory<T>
    extends java.lang.Object
    implements javafx.util.Callback<javafx.scene.control.ListView<T>,​javafx.scene.control.ListCell<T>>
    Cell factory to display items implementing ShortLongText.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javafx.scene.control.ListCell<T> call​(javafx.scene.control.ListView<T> listView)  
      protected org.tentackle.misc.ShortLongText getShortLongText​(T item)
      Returns whether the long text should be shown for the given item.
      protected void updateLabels​(T item, javafx.scene.control.Label shortLabel, javafx.scene.control.Label longLabel)
      Updates the labels of a cell.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShortLongTextCellFactory

        public ShortLongTextCellFactory()
    • Method Detail

      • call

        public javafx.scene.control.ListCell<T> call​(javafx.scene.control.ListView<T> listView)
        Specified by:
        call in interface javafx.util.Callback<javafx.scene.control.ListView<T>,​javafx.scene.control.ListCell<T>>
      • getShortLongText

        protected org.tentackle.misc.ShortLongText getShortLongText​(T item)
        Returns whether the long text should be shown for the given item.
        Parameters:
        item - the item
        Returns:
        the ShortLongText to 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 display
        shortLabel - the label for the short text
        longLabel - the label for the long text