Package org.fxmisc.flowless
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
N extends javafx.scene.Node, C extends Cell<T, N>>
CellWrapper<T, N, C> afterDispose
(C cell, Runnable action) static <T,
N extends javafx.scene.Node, C extends Cell<T, N>>
CellWrapper<T, N, C> afterReset
(C cell, Runnable action) static <T,
N extends javafx.scene.Node, C extends Cell<T, N>>
CellWrapper<T, N, C> afterUpdateIndex
(C cell, IntConsumer action) static <T,
N extends javafx.scene.Node, C extends Cell<T, N>>
CellWrapper<T, N, C> afterUpdateItem
(C cell, Consumer<? super T> action) static <T,
N extends javafx.scene.Node, C extends Cell<T, N>>
CellWrapper<T, N, C> beforeDispose
(C cell, Runnable action) static <T,
N extends javafx.scene.Node, C extends Cell<T, N>>
CellWrapper<T, N, C> beforeReset
(C cell, Runnable action) static <T,
N extends javafx.scene.Node, C extends Cell<T, N>>
CellWrapper<T, N, C> beforeUpdateIndex
(C cell, IntConsumer action) static <T,
N extends javafx.scene.Node, C extends Cell<T, N>>
CellWrapper<T, N, C> beforeUpdateItem
(C cell, Consumer<? super T> action) void
dispose()
Called when this cell is no longer going to be used at all.getNode()
boolean
Indicates whether this cell can be reused to display different items.void
reset()
Called when this cell is no longer used to display its item.toString()
void
updateIndex
(int index) Called to update index of a visible cell.void
updateItem
(T item) If this cell is reusable (as indicated byCell.isReusable()
), this method is called to display a different item.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.fxmisc.flowless.Cell
afterDispose, afterReset, afterUpdateIndex, afterUpdateItem, beforeDispose, beforeReset, beforeUpdateIndex, beforeUpdateItem
-
Field Details
-
delegate
-
-
Constructor Details
-
CellWrapper
-
-
Method Details
-
beforeDispose
public static <T,N extends javafx.scene.Node, CellWrapper<T,C extends Cell<T, N>> N, beforeDisposeC> (C cell, Runnable action) -
afterDispose
public static <T,N extends javafx.scene.Node, CellWrapper<T,C extends Cell<T, N>> N, afterDisposeC> (C cell, Runnable action) -
beforeReset
public static <T,N extends javafx.scene.Node, CellWrapper<T,C extends Cell<T, N>> N, beforeResetC> (C cell, Runnable action) -
afterReset
public static <T,N extends javafx.scene.Node, CellWrapper<T,C extends Cell<T, N>> N, afterResetC> (C cell, Runnable action) -
beforeUpdateItem
public static <T,N extends javafx.scene.Node, CellWrapper<T,C extends Cell<T, N>> N, beforeUpdateItemC> (C cell, Consumer<? super T> action) -
afterUpdateItem
public static <T,N extends javafx.scene.Node, CellWrapper<T,C extends Cell<T, N>> N, afterUpdateItemC> (C cell, Consumer<? super T> action) -
beforeUpdateIndex
public static <T,N extends javafx.scene.Node, CellWrapper<T,C extends Cell<T, N>> N, beforeUpdateIndexC> (C cell, IntConsumer action) -
afterUpdateIndex
public static <T,N extends javafx.scene.Node, CellWrapper<T,C extends Cell<T, N>> N, afterUpdateIndexC> (C cell, IntConsumer action) -
getDelegate
-
getNode
-
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 interfaceCell<T,
N extends javafx.scene.Node>
-
updateItem
Description copied from interface:Cell
If this cell is reusable (as indicated byCell.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 interfaceCell<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 interfaceCell<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 toCell.updateItem(Object)
.Default implementation does nothing.
-
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.
-
toString
-