Class FxFor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<Node extends javafx.scene.Node,
Item>
For<Node,Item> of
(@NotNull javafx.scene.Parent container, @NotNull javafx.collections.ObservableList<@NotNull Item> items, @NotNull javax.inject.Provider<@NotNull Node> nodeProvider) Creates a new For loop for use in code and initializes it.<Node extends javafx.scene.Node,
Item>
For<Node,Item> of
(@NotNull javafx.scene.Parent container, @NotNull javafx.collections.ObservableList<@NotNull Item> items, @NotNull javax.inject.Provider<@NotNull Node> nodeProvider, @NotNull BiConsumer<@NotNull Node, @Nullable Item> beforeInit) Creates a new For loop for use in code and initializes it.<Node extends javafx.scene.Node,
Item>
For<Node,Item> of
(@NotNull javafx.scene.Parent container, @NotNull javafx.collections.ObservableList<@NotNull Item> items, @NotNull javax.inject.Provider<@NotNull Node> nodeProvider, @NotNull Map<@NotNull String, @Nullable Object> params, @NotNull BiConsumer<@NotNull Node, @Nullable Item> beforeInit) Creates a new For loop for use in code and initializes it.
-
Constructor Details
-
FxFor
-
-
Method Details
-
of
public <Node extends javafx.scene.Node,Item> For<Node,Item> of(@NotNull @NotNull javafx.scene.Parent container, @NotNull @NotNull javafx.collections.ObservableList<@NotNull Item> items, @NotNull @NotNull javax.inject.Provider<@NotNull Node> nodeProvider, @NotNull @NotNull Map<@NotNull String, @Nullable Object> params, @NotNull @NotNull BiConsumer<@NotNull Node, @Nullable Item> beforeInit) Creates a new For loop for use in code and initializes it.This factory will use the provider to create a new node for each item in the list. The nodes will be added to the children of the container. If the provided type is a
Component
, it will be initialized and rendered.Example: For.of(myVbox, myListOfItems, myControllerProvider, Map.of("argument", value), (controller, item) -> controller.setItem(item));
- Parameters:
container
- The container to add the nodes toitems
- The list of items to displaynodeProvider
- The provider to create the controller for each itembeforeInit
- The method to call when the controller is created (useful for setting the item)params
- The parameters to pass to the created controller- Returns:
- The For loop
-
of
public <Node extends javafx.scene.Node,Item> For<Node,Item> of(@NotNull @NotNull javafx.scene.Parent container, @NotNull @NotNull javafx.collections.ObservableList<@NotNull Item> items, @NotNull @NotNull javax.inject.Provider<@NotNull Node> nodeProvider, @NotNull @NotNull BiConsumer<@NotNull Node, @Nullable Item> beforeInit) Creates a new For loop for use in code and initializes it.This factory will use the provider to create a new node for each item in the list. The nodes will be added to the children of the container. If the provided type is a
Component
, the controller will be initialized and rendered.Example: For.of(myVbox, myListOfItems, myControllerProvider, (controller, item) -> controller.setItem(item));
- Parameters:
container
- The container to add the nodes toitems
- The list of items to displaynodeProvider
- The provider to create the controller for each itembeforeInit
- The method to call when the controller is created (useful for setting the item)- Returns:
- The For loop
-
of
public <Node extends javafx.scene.Node,Item> For<Node,Item> of(@NotNull @NotNull javafx.scene.Parent container, @NotNull @NotNull javafx.collections.ObservableList<@NotNull Item> items, @NotNull @NotNull javax.inject.Provider<@NotNull Node> nodeProvider) Creates a new For loop for use in code and initializes it.This factory will use the provider to create a new node for each item in the list. The nodes will be added to the children of the container. If the provided type is a
Component
, the controller will be initialized and rendered.Example: For.of(myVbox, myListOfItems, () -> new Button());
Example: For.of(myVbox, myListOfItems, myControllerProvider);
- Parameters:
container
- The container to add the nodes toitems
- The list of items to displaynodeProvider
- The provider to create the controller for each item- Returns:
- The For loop
-