public class FluentViewLoader extends Object
public class MyCoolViewModel implements ViewModel {...} public class MyCoolView implements FxmlViewThis class is implemented as a Step-Builder. You can choose between<MyCoolViewModel>
{...} public class MyApp extends Application { @Override public void start(Stage stage) { ViewTuple<MyCoolView, MyCoolViewModel>
viewTuple = FluentViewLoader.fxmlView(MyCoolView.class).load(); Parent root = viewTuple.getView(); stage.setScene(new Scene(root)); stage.show(); } }
FxmlView
and JavaView
with the
first method call. After that you will only get builder-methods that are suitable for the view type you have chosen.Modifier and Type | Class and Description |
---|---|
static class |
FluentViewLoader.FxmlViewStep<ViewType extends FxmlView<? extends ViewModelType>,ViewModelType extends ViewModel>
This class is the builder step to load a fxml based view.
|
static class |
FluentViewLoader.JavaViewStep<ViewType extends JavaView<? extends ViewModelType>,ViewModelType extends ViewModel>
This class is the builder step to load a java based view.
|
Constructor and Description |
---|
FluentViewLoader() |
Modifier and Type | Method and Description |
---|---|
static <ViewType extends FxmlView<? extends ViewModelType>,ViewModelType extends ViewModel> |
fxmlView(Class<? extends ViewType> viewType)
This method is the entry point of the Fluent API to load a fxml based View.
|
static <ViewType extends JavaView<? extends ViewModelType>,ViewModelType extends ViewModel> |
javaView(Class<? extends ViewType> viewType)
This method is the entry point of the Fluent API to load a java based view.
|
public static <ViewType extends JavaView<? extends ViewModelType>,ViewModelType extends ViewModel> FluentViewLoader.JavaViewStep<ViewType,ViewModelType> javaView(Class<? extends ViewType> viewType)
ViewType
- the type of the View that should be loaded. This type has to implement
JavaView
.ViewModelType
- the type of the ViewModel. This type has to implement ViewModel
.viewType
- the type of the view that should be loaded.public static <ViewType extends FxmlView<? extends ViewModelType>,ViewModelType extends ViewModel> FluentViewLoader.FxmlViewStep<ViewType,ViewModelType> fxmlView(Class<? extends ViewType> viewType)
ViewType
- the generic type of the View that should be loaded. This type has to implement
FxmlView
.ViewModelType
- the generic type of the ViewModel. This type has to implement ViewModel
.viewType
- the type of the view that should be loaded.Copyright © 2015 Saxonia Systems AG. All rights reserved.