Package org.fxmisc.flowless
Interface Cell<T,N extends javafx.scene.Node>
-
- All Known Implementing Classes:
CellWrapper
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Cell<T,N extends javafx.scene.Node>
Provides efficient memory usage by wrapping aNode
within this object and reusing it whenisReusable()
is true.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Cell<T,N>
afterDispose(java.lang.Runnable action)
default Cell<T,N>
afterReset(java.lang.Runnable action)
default Cell<T,N>
afterUpdateIndex(java.util.function.IntConsumer action)
default Cell<T,N>
afterUpdateItem(java.util.function.Consumer<? super T> action)
default Cell<T,N>
beforeDispose(java.lang.Runnable action)
default Cell<T,N>
beforeReset(java.lang.Runnable action)
default Cell<T,N>
beforeUpdateIndex(java.util.function.IntConsumer action)
default Cell<T,N>
beforeUpdateItem(java.util.function.Consumer<? super T> action)
default void
dispose()
Called when this cell is no longer going to be used at all.N
getNode()
default boolean
isReusable()
Indicates whether this cell can be reused to display different items.default void
reset()
Called when this cell is no longer used to display its item.default void
updateIndex(int index)
Called to update index of a visible cell.default void
updateItem(T item)
If this cell is reusable (as indicated byisReusable()
), this method is called to display a different item.static <T,N extends javafx.scene.Node>
Cell<T,N>wrapNode(N node)
-
-
-
Method Detail
-
wrapNode
static <T,N extends javafx.scene.Node> Cell<T,N> wrapNode(N node)
-
getNode
N getNode()
-
isReusable
default boolean isReusable()
Indicates whether this cell can be reused to display different items.Default implementation returns
false
.
-
updateItem
default void updateItem(T item)
If this cell is reusable (as indicated byisReusable()
), this method is called to display a different item.reset()
will have been called before a call to this method.The default implementation throws
UnsupportedOperationException
.- Parameters:
item
- the new item to display
-
updateIndex
default void updateIndex(int index)
Called to update index of a visible cell.Default implementation does nothing.
-
reset
default void reset()
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 toupdateItem(Object)
.Default implementation does nothing.
-
dispose
default void dispose()
Called when this cell is no longer going to be used at all.reset()
will have been called before this method is invoked.Default implementation does nothing.
-
beforeUpdateItem
default Cell<T,N> beforeUpdateItem(java.util.function.Consumer<? super T> action)
-
-