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

public class For<Node extends javafx.scene.Node,Item> extends Object
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 Details

    • For

      protected For(ControllerManager controllerManager)
      Use the factory methods to create a new For loop.
  • Method Details

    • setParams

      protected void setParams(Map<String,Object> params)
    • 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

      public javafx.collections.ObservableList<Item> getItems()
    • setItems

      protected void setItems(javafx.collections.ObservableList<Item> list)
    • getProvider

      public javax.inject.Provider<Node> getProvider()
    • setProvider

      protected void setProvider(javax.inject.Provider<Node> node)
    • setBeforeInit

      protected void setBeforeInit(BiConsumer<Node,Item> beforeInit)
    • 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.