-
Notifications
You must be signed in to change notification settings - Fork 104
FluentViewLoader
Manuel Mauky edited this page Jul 6, 2015
·
6 revisions
The FluentViewLoader
class provides a fluent API to load views. You can use it for both FxmlViews and JavaViews. The result of the loading is a ViewTuple that contains the loaded codeBehind, viewModel and the root element.
For views that extend from de.saxsys.mvvmfx.FxmlView
:
ViewTuple viewTuple = FluentViewLoader.fxmlView(MyViewClass.class).load();
Parent root = viewTuple.getView();
For views that extend from de.saxsys.mvvmfx.JavaView
:
ViewTuple viewTuple = FluentViewLoader.javaView(MyViewClass.class).load();
Parent root = viewTuple.getView();
ResourceBundle resources = ...;
ViewTuple viewTuple = FluentViewLoader.fxmlView(MyViewClass.class).resourceBundle(resources).load();
Parent root = viewTuple.getView();
There are other parameters for special use cases like creating a custom controll with the fx:root-Element. This can be seen in the Example helloworld-fx-root-example.