Class CellWrapper<T,N extends javafx.scene.Node,C extends Cell<T,N>>

java.lang.Object
org.fxmisc.flowless.CellWrapper<T,N,C>
All Implemented Interfaces:
Cell<T,N>

abstract class CellWrapper<T,N extends javafx.scene.Node,C extends Cell<T,N>> extends Object implements Cell<T,N>
Factory class for wrapping a Cell and running additional code before/after specific methods
  • Field Details

    • delegate

      private final C extends Cell<T,N> delegate
  • Constructor Details

    • CellWrapper

      public CellWrapper(C delegate)
  • Method Details

    • beforeDispose

      public static <T, N extends javafx.scene.Node, C extends Cell<T, N>> CellWrapper<T,N,C> beforeDispose(C cell, Runnable action)
    • afterDispose

      public static <T, N extends javafx.scene.Node, C extends Cell<T, N>> CellWrapper<T,N,C> afterDispose(C cell, Runnable action)
    • beforeReset

      public static <T, N extends javafx.scene.Node, C extends Cell<T, N>> CellWrapper<T,N,C> beforeReset(C cell, Runnable action)
    • afterReset

      public static <T, N extends javafx.scene.Node, C extends Cell<T, N>> CellWrapper<T,N,C> afterReset(C cell, Runnable action)
    • beforeUpdateItem

      public static <T, N extends javafx.scene.Node, C extends Cell<T, N>> CellWrapper<T,N,C> beforeUpdateItem(C cell, Consumer<? super T> action)
    • afterUpdateItem

      public static <T, N extends javafx.scene.Node, C extends Cell<T, N>> CellWrapper<T,N,C> afterUpdateItem(C cell, Consumer<? super T> action)
    • beforeUpdateIndex

      public static <T, N extends javafx.scene.Node, C extends Cell<T, N>> CellWrapper<T,N,C> beforeUpdateIndex(C cell, IntConsumer action)
    • afterUpdateIndex

      public static <T, N extends javafx.scene.Node, C extends Cell<T, N>> CellWrapper<T,N,C> afterUpdateIndex(C cell, IntConsumer action)
    • getDelegate

      public C getDelegate()
    • getNode

      public N getNode()
      Specified by:
      getNode in interface Cell<T,N extends javafx.scene.Node>
    • isReusable

      public boolean isReusable()
      Description copied from interface: Cell
      Indicates whether this cell can be reused to display different items.

      Default implementation returns false.

      Specified by:
      isReusable in interface Cell<T,N extends javafx.scene.Node>
    • updateItem

      public void updateItem(T item)
      Description copied from interface: Cell
      If this cell is reusable (as indicated by Cell.isReusable()), this method is called to display a different item. Cell.reset() will have been called before a call to this method.

      The default implementation throws UnsupportedOperationException.

      Specified by:
      updateItem in interface Cell<T,N extends javafx.scene.Node>
      Parameters:
      item - the new item to display
    • updateIndex

      public void updateIndex(int index)
      Description copied from interface: Cell
      Called to update index of a visible cell.

      Default implementation does nothing.

      Specified by:
      updateIndex in interface Cell<T,N extends javafx.scene.Node>
    • reset

      public void reset()
      Description copied from interface: Cell
      Called when this cell is no longer used to display its item. If this cell is reusable, it may later be asked to display a different item by a call to Cell.updateItem(Object).

      Default implementation does nothing.

      Specified by:
      reset in interface Cell<T,N extends javafx.scene.Node>
    • dispose

      public void dispose()
      Description copied from interface: Cell
      Called when this cell is no longer going to be used at all. Cell.reset() will have been called before this method is invoked.

      Default implementation does nothing.

      Specified by:
      dispose in interface Cell<T,N extends javafx.scene.Node>
    • toString

      public String toString()
      Overrides:
      toString in class Object