U - The actual JavaFX UI type.public abstract class FXMLController<U>
extends java.lang.Object
Controller classes must conform to the name pattern (.+)Controller and must be derived from one of this class' subclasses. In addition a FXML file has to be created for defining the scene content as well as a resource bundle for text resources. All these artifacts are bound together by their names as follows:
| Constructor and Description |
|---|
FXMLController() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.ResourceBundle |
getResources()
Get the UI resource bundle.
|
U |
getUI()
Get the UI object.
|
abstract javafx.stage.Window |
getWindow()
Get the UI window.
|
protected static <U,C extends FXMLController<U>> |
loadUI(@Nullable javafx.stage.Window owner,
java.util.function.Function<C,U> uiFactory,
java.lang.Class<C> controllerClass)
Perform the basic UI setup by loading the UI resource bundle, the scene content as well as the controller class
and bind all together.
|
protected abstract void |
setupUI(@Nullable javafx.stage.Window owner,
U ui,
javafx.scene.Parent fxmlRoot)
This function is called during UI initialization to perform the actual UI setup.
|
protected final java.util.ResourceBundle getResources()
public final U getUI()
public abstract javafx.stage.Window getWindow()
protected static <U,C extends FXMLController<U>> C loadUI(@Nullable javafx.stage.Window owner, java.util.function.Function<C,U> uiFactory, java.lang.Class<C> controllerClass) throws java.io.IOException
U - The JavaFX UI object type.C - The actual FXMLController type.owner - The UI object's owner (may by null).uiFactory - The factory function used to create the actual UI object by invoking it with the constructed
controller.controllerClass - The controller class to use.java.io.IOException - if an I/O error occurs during stage setup.protected abstract void setupUI(@Nullable javafx.stage.Window owner,
U ui,
javafx.scene.Parent fxmlRoot)
owner - The UI object's owner (may by null).ui - The constructed UI object.fxmlRoot - The scene's root node as defined by the FXML resource.