Module app.supernaut.fx.micronaut
Package app.supernaut.fx.micronaut.fxml
Class MicronautFxmlLoaderFactory
java.lang.Object
app.supernaut.fx.micronaut.fxml.MicronautFxmlLoaderFactory
- All Implemented Interfaces:
FxmlLoaderFactory
Factory for providing FXMLLoaders that do full DI. This
singleton is added to the Micronaut BeanContext with BeanContext#registerSingleton.
-
Constructor Summary
ConstructorsConstructorDescriptionMicronautFxmlLoaderFactory(io.micronaut.context.BeanContext context) Constructor that gets BeanContext of the SupernautFX application injected. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.fxml.FXMLLoaderget()Get an FXMLLoader without setting a locationjavafx.fxml.FXMLLoaderGet an FXMLLoader for the given location<T> TgetControllerFactory(Class<T> clazz) Get the FXML controller from the BeanContext
-
Constructor Details
-
MicronautFxmlLoaderFactory
Constructor that gets BeanContext of the SupernautFX application injected.- Parameters:
context- The BeanContext of the SupernautFX application
-
-
Method Details
-
getControllerFactory
Get the FXML controller from the BeanContext- Specified by:
getControllerFactoryin interfaceFxmlLoaderFactory- Type Parameters:
T- The class type of the controller- Parameters:
clazz- The controller class we are looking for- Returns:
- A controller instance
-
get
Get an FXMLLoader without setting a location- Specified by:
getin interfaceFxmlLoaderFactory- Returns:
- An FXMLLoader
-
get
Get an FXMLLoader for the given location- Specified by:
getin interfaceFxmlLoaderFactory- Parameters:
location- The location of the FXML resource- Returns:
- An FXMLLoader
-