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

  • All Implemented Interfaces:
    Cell<T,​N>

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

      • delegate

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

      • CellWrapper

        public CellWrapper​(C delegate)
    • Method Detail

      • beforeDispose

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

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

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

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

        public static <T,​N extends javafx.scene.Node,​C extends Cell<T,​N>> CellWrapper<T,​N,​C> beforeUpdateItem​(C cell,
                                                                                                                                            java.util.function.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,
                                                                                                                                           java.util.function.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,
                                                                                                                                             java.util.function.IntConsumer action)
      • afterUpdateIndex

        public static <T,​N extends javafx.scene.Node,​C extends Cell<T,​N>> CellWrapper<T,​N,​C> afterUpdateIndex​(C cell,
                                                                                                                                            java.util.function.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object