public class Flow
extends java.lang.Object
| ?????? |
|---|
Flow(java.lang.Class<?> startViewControllerClass)
Creates a new Flow with the given controller for the start view.
|
Flow(java.lang.Class<?> startViewControllerClass,
ViewConfiguration viewConfiguration)
Creates a new Flow with the given controller for the start view and a
view configuration for all views.
|
| ?????? | ????? |
|---|---|
<U> void |
addActionsToView(FlowView<U> newView)
This methods adds all registered actions to the given flow view.
|
Flow |
addActionToView(java.lang.Class<?> controllerClass,
java.lang.String actionId,
FlowAction action)
Adds an action to the defined view of the flow.
|
Flow |
addGlobalAction(java.lang.String actionId,
FlowAction action)
Adds a global action to the flow.
|
FlowHandler |
createHandler()
Creates a handler that can be used to run the flow.
|
FlowHandler |
createHandler(ViewFlowContext flowContext)
Creates a handler that can be used to run the flow.
|
FlowAction |
getGlobalActionById(java.lang.String actionId)
Returns the action that is registered by the given unique id
|
java.lang.Class<?> |
getStartViewControllerClass()
Returns the class of the view controller that is defined as the start view.
|
ViewConfiguration |
getViewConfiguration()
Returns the view configuration for all views of the flow
|
javafx.scene.layout.StackPane |
start()
Start the flow with a default handler and a default FlowContainer
This will start the flow using a DefaultFlowContainer, which returns a
StackPane.
|
<T extends javafx.scene.Node> |
start(FlowContainer<T> flowContainer)
Start the flow with a default handler and a provided FlowContainer
|
void |
startInPane(javafx.scene.layout.StackPane pane) |
void |
startInStage(javafx.stage.Stage stage)
Starts the flow directly in a Stage.
|
javafx.scene.control.Tab |
startInTab()
Creates a
Tab that contains a running instance of the flow. |
<T extends javafx.scene.Node> |
startInTab(FlowContainer<T> container)
Creates a
Tab that contains a running instance of the flow. |
Flow |
withAction(java.lang.Class<?> controllerClass,
java.lang.String actionId,
FlowAction action)
Adds a action to the view of the given view controller.
|
Flow |
withBackAction(java.lang.Class<?> controllerClass,
java.lang.String actionId)
Adds a back action to the defined view of the flow that navigates back to the last view of a flow.
|
Flow |
withGlobalAction(java.lang.String actionId,
FlowAction action)
Adds a global action to the flow.
|
Flow |
withGlobalBackAction(java.lang.String actionId)
Adds a global back action to the flow that navigates back to the last view of a flow.
|
Flow |
withGlobalLink(java.lang.String actionId,
java.lang.Class<?> controllerClass)
Adds a link action as a global action to the flow.
|
Flow |
withGlobalTaskAction(java.lang.String actionId,
java.lang.Class<? extends java.lang.Runnable> actionClass)
Adds a task action as a global action to the flow.
|
Flow |
withGlobalTaskAction(java.lang.String actionId,
java.lang.Runnable action)
Adds a task action as a global action to the flow.
|
Flow |
withLink(java.lang.Class<?> fromControllerClass,
java.lang.String actionId,
java.lang.Class<?> toControllerClass)
Adds a navigation action to the flow that will navigate from one view to another.
|
Flow |
withTaskAction(java.lang.Class<?> controllerClass,
java.lang.String actionId,
java.lang.Class<? extends java.lang.Runnable> actionClass)
Adds a task action to the defined view of the flow.
|
Flow |
withTaskAction(java.lang.Class<?> controllerClass,
java.lang.String actionId,
java.lang.Runnable action)
Adds a task action to the defined view of the flow.
|
public Flow(java.lang.Class<?> startViewControllerClass,
ViewConfiguration viewConfiguration)
ViewController for more informationstartViewControllerClass - Controller class of the start viewviewConfiguration - Configuration for all views of the flowViewControllerpublic Flow(java.lang.Class<?> startViewControllerClass)
ViewController.
See ViewController for more information.
Using this constructor will create a new ViewConfiguration.startViewControllerClass - Controller class of the start viewViewControllerpublic ViewConfiguration getViewConfiguration()
public FlowHandler createHandler(ViewFlowContext flowContext)
FlowHandler is neededflowContext - The context for the flowpublic FlowHandler createHandler()
FlowHandler is neededpublic Flow withGlobalAction(java.lang.String actionId, FlowAction action)
actionId - unique action idaction - the actionpublic Flow withGlobalTaskAction(java.lang.String actionId, java.lang.Class<? extends java.lang.Runnable> actionClass)
FlowTaskAction will be created and
added to the flow. As you can read in the documentation of FlowTaskAction a instance of the given
actionClass will be created and executed whenever the action will be called.actionId - unique action idactionClass - class that defines the runnable that will be called whenever the action is calledFlowTaskActionpublic Flow withGlobalTaskAction(java.lang.String actionId, java.lang.Runnable action)
FlowTaskAction will be created and
added to the flow.actionId - unique action idaction - a runnable that will be called whenever the action is calledFlowTaskActionpublic Flow withGlobalLink(java.lang.String actionId, java.lang.Class<?> controllerClass)
FlowLink will be created and added
to the flow.actionId - unique action idcontrollerClass - the controller of the view that should be shown whenever the action will be calledFlowLinkpublic Flow withGlobalBackAction(java.lang.String actionId)
FlowBackAction will be created and added to the flow.actionId - unique action idFlowBackActionpublic Flow withAction(java.lang.Class<?> controllerClass, java.lang.String actionId, FlowAction action)
controllerClass - controller class for the view of the actionactionId - unique action idaction - the actionpublic Flow withLink(java.lang.Class<?> fromControllerClass, java.lang.String actionId, java.lang.Class<?> toControllerClass)
FlowLink will be
created and added to the flow.fromControllerClass - the controller class of the view that is the origin of the navigationactionId - unique action idtoControllerClass - the controller class of the view that is the destination of the navigationFlowLinkpublic Flow withTaskAction(java.lang.Class<?> controllerClass, java.lang.String actionId, java.lang.Class<? extends java.lang.Runnable> actionClass)
FlowTaskAction will be created and
added to the flow. As you can read in the documentation of FlowTaskAction a instance of the given
actionClass will be created and executed whenever the action will be called.controllerClass - the controller class of the view to that the action will be registeredactionId - unique action idactionClass - class that defines the runnable that will be called whenever the action is calledFlowTaskActionpublic Flow withTaskAction(java.lang.Class<?> controllerClass, java.lang.String actionId, java.lang.Runnable action)
FlowTaskAction will be created and
added to the flow.controllerClass - the controller class of the view to that the action will be registeredactionId - unique action idaction - a runnable that will be called whenever the action is calledFlowTaskActionpublic Flow withBackAction(java.lang.Class<?> controllerClass, java.lang.String actionId)
FlowBackAction will be created and added to the flow.controllerClass - the controller class of the view to that the action will be registeredactionId - unique action idFlowBackActionpublic Flow addActionToView(java.lang.Class<?> controllerClass, java.lang.String actionId, FlowAction action)
controllerClass - the controller class of the view to that the action will be registeredactionId - unique action idaction - the action that will be addedFlowActionpublic Flow addGlobalAction(java.lang.String actionId, FlowAction action)
actionId - unique action idaction - the action that will be addedFlowActionpublic FlowAction getGlobalActionById(java.lang.String actionId)
actionId - the idpublic java.lang.Class<?> getStartViewControllerClass()
public <U> void addActionsToView(FlowView<U> newView)
U - Class of the view controllernewView - the view that shoudl be prepairedpublic javafx.scene.layout.StackPane start()
throws FlowException
FlowException - in case something goes wrongpublic void startInStage(javafx.stage.Stage stage)
throws FlowException
By using the method a flow based application can be created by only a few lines of code as shown in this example:
public class Example extends Application {
public static void main(String[] args) {
launch(args);
}
public void start(Stage primaryStage) throws Exception {
new Flow(SimpleController.class).startInStage(primaryStage);
}
}
stage - The stage in that the flow should be displayed.FlowException - If the flow can't be created or startedpublic void startInPane(javafx.scene.layout.StackPane pane)
throws FlowException
FlowExceptionpublic javafx.scene.control.Tab startInTab()
throws FlowException
Tab that contains a running instance of the flow. A DefaultFlowContainer is used as the flow
container.FlowException - if the flow instance can't be createdpublic <T extends javafx.scene.Node> javafx.scene.control.Tab startInTab(FlowContainer<T> container) throws FlowException
Tab that contains a running instance of the flow.T - node type of the flow containercontainer - the flow container in that the flow instance should runFlowException - if the flow instance can't be createdpublic <T extends javafx.scene.Node> T start(FlowContainer<T> flowContainer) throws FlowException
T - node type of the flow containerflowContainer - the FlowContainer used to visualize this flowFlowException