Interface Cell<T>


public interface Cell<T>
Base API for all cells.

Also offers a static method to quickly wrap a node into a cell.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Automatically called after the cell has been laid out.
    default void
    Automatically called before the cell is laid out.
    default void
    Automatically called before the cell's node is removed from the container.
    Returns the cell's node.
    default void
    updateIndex​(int index)
    Automatically called by the VirtualFlow.
    void
    updateItem​(T item)
    Automatically called by the VirtualFlow
  • Method Details

    • getNode

      Node getNode()
      Returns the cell's node. The ideal way to implement a cell would be to extend a JavaFX's pane/region and override this method to return "this".
    • updateItem

      void updateItem(T item)
      Automatically called by the VirtualFlow

      This method must be implemented to correctly update the Cell's content on scroll.

      Note: if the Cell's content is a Node this method should also re-set the Cell's children because (quoting from JavaFX doc) 'A node may occur at most once anywhere in the scene graph' and it's possible that a Node may be removed from a Cell to be the content of another Cell.

    • updateIndex

      default void updateIndex(int index)
      Automatically called by the VirtualFlow.

      Cells are dumb, they have no logic, no state. This method allow cells implementations to keep track of a cell's index.

      Default implementation is empty.

    • afterLayout

      default void afterLayout()
      Automatically called after the cell has been laid out.

      Default implementation is empty.

    • beforeLayout

      default void beforeLayout()
      Automatically called before the cell is laid out.

      Default implementation is empty.

    • dispose

      default void dispose()
      Automatically called before the cell's node is removed from the container.

      Default implementation is empty.