Top Description Methods
org.fxmisc.flowless

public Interface Cell<T, N extends Node>

Known Direct Implementers
org.fxmisc.flowless.CellWrapper
Annotations
@FunctionalInterface
Imports
java.util.function.Consumer, .IntConsumer, javafx.scene.Node

Provides efficient memory usage by wrapping a Node within this object and reusing it when isReusable() is true.

Method Summary

Modifier and TypeMethod and Description
public default Cell<T, N>
public default Cell<T, N>
public default Cell<T, N>
public default Cell<T, N>
afterUpdateItem(Consumer<? super T> action)

public default Cell<T, N>
public default Cell<T, N>
public default Cell<T, N>
public default Cell<T, N>
beforeUpdateItem(Consumer<? super T> action)

public default void
dispose()

Called when this cell is no longer going to be used at all.

public N
public default boolean
isReusable()

Indicates whether this cell can be reused to display different items.

public default void
reset()

Called when this cell is no longer used to display its item.

public default void
updateIndex(int index)

Called to update index of a visible cell.

public default void
updateItem(T
the new item to display
item
)

If this cell is reusable (as indicated by isReusable()), this method is called to display a different item.

public static <T, N extends Node> Cell<T, N>
wrapNode(N node)

Method Detail

afterDisposeback to summary
public default Cell<T, N> afterDispose(Runnable action)
afterResetback to summary
public default Cell<T, N> afterReset(Runnable action)
afterUpdateIndexback to summary
public default Cell<T, N> afterUpdateIndex(IntConsumer action)
afterUpdateItemback to summary
public default Cell<T, N> afterUpdateItem(Consumer<? super T> action)
beforeDisposeback to summary
public default Cell<T, N> beforeDispose(Runnable action)
beforeResetback to summary
public default Cell<T, N> beforeReset(Runnable action)
beforeUpdateIndexback to summary
public default Cell<T, N> beforeUpdateIndex(IntConsumer action)
beforeUpdateItemback to summary
public default Cell<T, N> beforeUpdateItem(Consumer<? super T> action)
disposeback to summary
public 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.

getNodeback to summary
public N getNode()
isReusableback to summary
public default boolean isReusable()

Indicates whether this cell can be reused to display different items.

Default implementation returns false.

resetback to summary
public 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 to updateItem(Object).

Default implementation does nothing.

updateIndexback to summary
public default void updateIndex(int index)

Called to update index of a visible cell.

Default implementation does nothing.

updateItemback to summary
public default void updateItem(T item)

If this cell is reusable (as indicated by isReusable()), 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:T

the new item to display

wrapNodeback to summary
public static <T, N extends Node> Cell<T, N> wrapNode(N node)