Class FXMLLoaderUtil.ViewLoader<T>

java.lang.Object
com.serinity.accesscontrol.util.FXMLLoaderUtil.ViewLoader<T>
Type Parameters:
T - The type of the controller associated with the FXML.
Enclosing class:
FXMLLoaderUtil

public static final class FXMLLoaderUtil.ViewLoader<T> extends Object
Wrapper class that holds both the loaded FXML root node and its controller.

This is typically used for navigation systems to access both the root node to add to a layout (e.g., StackPane) and the controller to inject dependencies or configure callbacks.

Since:
2026-01-28 FXMLLoaderUtil.java
Version:
1.0
Author:
@ZouariOmar (zouariomar20@gmail.com)
  • Constructor Details

    • ViewLoader

      public ViewLoader(javafx.scene.Parent root, T controller)
      Creates a holder for a loaded view and its controller.
      Parameters:
      root - loaded FXML root node
      controller - controller instance resolved by FXMLLoader
  • Method Details

    • getRoot

      public javafx.scene.Parent getRoot()
      Returns the loaded root node.
      Returns:
      loaded root node
    • getController

      public T getController()
      Returns the controller resolved by FXMLLoader.
      Returns:
      loaded controller