Package org.fulib.fx.constructs.forloop
Class For<Node extends javafx.scene.Node,Item>
java.lang.Object
org.fulib.fx.constructs.forloop.For<Node,Item>
- Type Parameters:
Node
- The type of the node to display for each item (e.g. a component or a node)Item
- The type of the items in the list
A For loop for use in Code. Creates a node for each item in a list and adds them to the children of a container.
This allows you to easily display a list of items in a container like a friend list or a list of products.
-
Constructor Summary
ModifierConstructorDescriptionprotected
For
(ControllerManager controllerManager) Use the factory methods to create a new For loop. -
Method Summary
Modifier and TypeMethodDescription@NotNull io.reactivex.rxjava3.disposables.CompositeDisposable
Returns the disposable used for cleaning up the For loop.void
dispose()
Destroys the For loop and all controllers.javafx.scene.Parent
Returns the container to which the nodes are added.javafx.collections.ObservableList<Item>
getItems()
javax.inject.Provider<Node>
protected void
init()
Binds the list to the container and the node by adding and removing nodes when the list changes.protected void
setBeforeInit
(BiConsumer<Node, Item> beforeInit) protected void
setContainer
(javafx.scene.Parent container) protected void
protected void
protected void
setProvider
(javax.inject.Provider<Node> node)
-
Constructor Details
-
For
Use the factory methods to create a new For loop.
-
-
Method Details
-
setParams
-
getContainer
public javafx.scene.Parent getContainer()Returns the container to which the nodes are added.- Returns:
- The container
-
setContainer
protected void setContainer(javafx.scene.Parent container) -
getItems
-
setItems
-
getProvider
-
setProvider
-
setBeforeInit
-
init
protected void init()Binds the list to the container and the node by adding and removing nodes when the list changes.This method is called automatically when the container, list or node is set. You only need to call it manually if you want to rebind the list.
Initializes the For loop by adding all existing nodes to the container.
-
disposable
@NotNull public @NotNull io.reactivex.rxjava3.disposables.CompositeDisposable disposable()Returns the disposable used for cleaning up the For loop. This- Returns:
- The disposable
-
dispose
public void dispose()Destroys the For loop and all controllers.
-