C
- the controller typepublic class FxmlLoadBuilder<C>
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
FxmlLoadBuilder(javafx.fxml.FXMLLoader loader) |
Modifier and Type | Method and Description |
---|---|
static FxmlLoadBuilder<java.lang.Object> |
build() |
static FxmlLoadBuilder<java.lang.Object> |
buildWith(javafx.fxml.FXMLLoader loader) |
FxmlLoadBuilder<C> |
classLoader(java.lang.ClassLoader classLoader) |
<D> FxmlLoadBuilder<D> |
controller(java.lang.Class<D> controllerClass)
Configure the builder to load into a controller of the given class via
FXMLLoader.setControllerFactory(javafx.util.Callback) . |
<D> FxmlLoadBuilder<D> |
controller(java.lang.Class<D> controllerClass,
D controller)
Configure the builder to load directly into the given controller instance.
|
<D> FxmlLoadBuilder<D> |
controller(D controller)
Configure the builder to load directly into the given controller instance.
|
javafx.util.Pair<C,javafx.scene.Node> |
load()
Load the TODO
|
C |
loadController()
Load the FXML item and return the controller. |
<T> T |
loadRoot()
Load the FXML item and return the root node. |
<D extends javafx.scene.Node> |
object(D object) |
FxmlLoadBuilder<C> |
resource(java.lang.String resourceName)
The FXML resource name, such that the resource be located according to
FxUtilities.getResource(Class, String) . |
FxmlLoadBuilder<C> |
resource(java.net.URL resource) |
FxmlLoadBuilder<C> |
root(javafx.scene.Node root) |
protected FxmlLoadBuilder(javafx.fxml.FXMLLoader loader)
loader
- The FXML loader to usepublic static FxmlLoadBuilder<java.lang.Object> buildWith(javafx.fxml.FXMLLoader loader)
loader
- the FXMLLoader
to back the builderFxmlLoadBuilder
over the given backing loaderpublic static FxmlLoadBuilder<java.lang.Object> build()
FxmlLoadBuilder
over the default backing loaderpublic <D> FxmlLoadBuilder<D> controller(D controller)
Unless an exact resource
is given, the resource
location will be derived according to FxUtilities.getResource(Class)
,
or FxUtilities.getResource(Class, String)
if a
resource name
is specified.
D
- the type of the controller objectcontroller
- the controller object to load intopublic <D> FxmlLoadBuilder<D> controller(java.lang.Class<D> controllerClass, D controller)
Unless an exact resource
is given, the resource
location will be derived according to FxUtilities.getResource(Class)
,
or FxUtilities.getResource(Class, String)
if a
resource name
is specified.
D
- the type of the controller objectcontrollerClass
- the controller class to load intocontroller
- the controller object to load intopublic <D> FxmlLoadBuilder<D> controller(java.lang.Class<D> controllerClass)
FXMLLoader.setControllerFactory(javafx.util.Callback)
.
Unless an exact resource
is given, the resource
location will be derived according to FxUtilities.getResource(Class)
,
or FxUtilities.getResource(Class, String)
if a
resource name
is specified.
D
- the type of the controller classcontrollerClass
- the controller class to load intopublic FxmlLoadBuilder<C> resource(java.lang.String resourceName)
FxUtilities.getResource(Class, String)
.resourceName
- the name of the FXML resourcepublic FxmlLoadBuilder<C> resource(java.net.URL resource)
resource
- the exact FXML resourcepublic FxmlLoadBuilder<C> root(javafx.scene.Node root)
root
- the root node to load the FXML intopublic FxmlLoadBuilder<C> classLoader(java.lang.ClassLoader classLoader)
classLoader
- the new class loader for the FXMLLoader
.public <D extends javafx.scene.Node> FxmlLoadBuilder<D> object(D object)
D
- the type of the controller/root objectobject
- the root node and the controller to load the FXML intopublic <T> T loadRoot()
Load
the FXML item and return the root node.T
- the expected type of the root nodepublic C loadController()
Load
the FXML item and return the controller.public javafx.util.Pair<C,javafx.scene.Node> load()