Main class for the tutorial. This application will show only a simple wizard in the given
Stage. It's mainly
the same wizard as discussed in tutorial 3. But here some new features were added.
The views of the wizard are defined by the DataFX controller API and shown in a DataFX flow.
As shown in tutorial 1 and 2 the
Flow.startInStage(javafx.stage.Stage) method of the Flow class is used to
visualize the wizard on screen.
The first view of the wizard is defined by the
WizardStartController class that is passed to the constructor
of the
Flow class.
In difference to the last tutorials a lot of actions are directly defined in the
Flow definition instead of
defining them in the view controller classes. Therefore the
Flow class provides a fluent API that can be used
to define actions for single views or the complete flow. All actions that are added to a flow have to implement the
FlowAction interface. The
Flow class provides a lot of methods
to add specific action types the the flow. Examples are
Flow.withGlobalBackAction(String) or
Flow.withLink(Class, String, Class). Some of them are used here to define the flow. As you can see in the
view controller classes of the wizard the actions are bound to controls by using the
ActionTrigger annotation with the unique id of the action that is defined
here. The flow defines two different types of actions: global actions that can be accessed in each view of the flow.
Examples are the "back", "help" and "finish" action in this example. In addition a action can be defined for a
specific view in the flow. To do so the view controller class of the view must be speficied. Examples are the "next"
actions that are added to the
WizardStartController,
Wizard1Controller,
Wizard2Controller and
Wizard3Controller controllers. The
WizardDoneController can't use this
actions, for example.