public class LoginViewController extends ViewController
A ViewController for the LoginView
. Use the setLoginViewDelegate(LoginViewDelegate)
to register
a delegate to handle common actions.
ViewController.DidSetViewEvent, ViewController.DidUnSetViewEvent, ViewController.ViewDecorator
Controller.CreateObjectRequest<T>, Controller.ObjectFactory
Constructor and Description |
---|
LoginViewController(Controller parent) |
Modifier and Type | Method and Description |
---|---|
protected LoginViewModel |
createViewModel()
Creates the view model to use for the loginview.
|
protected ViewNode |
createViewNode()
Creates the view node that should be used as the node for the controller’s view.
|
LoginViewDelegate |
getLoginViewDelegate()
Gets the registered LoginViewDelegate.
|
LoginViewModel |
getViewModel()
Gets the ViewModel.
|
protected void |
initControllerActions()
This is run just before
Controller.startController() . |
protected void |
onStartController()
A lifecycle method that shoudl be used to setup the controller.
|
protected void |
onStopController()
A lifecycle method that should be used to cleanup variables and listeners that were setup in
the
Controller.onStartController() method. |
void |
setLoginViewDelegate(LoginViewDelegate delegate)
Sets the delegate to handle events from the
LoginView . |
addViewDecorator, createViewContext, decorateView, deinitialize, getNearestViewModel, getTitle, getView, getViewController, getViewController, initController, removeViewDecorator, setTitle, setView
actionPerformed, addAction, addAction, addActionListener, addActions, addActions, addEventListener, addLookup, addLookup, addObjectFactory, createObjectWithFactory, dispatchEvent, extendAction, extendAction, fillSlot, getAction, getActions, getActionsNode, getApplicationController, getFormController, getFormController, getInheritedAction, getInheritedActions, getParent, getSectionController, getSingleActionsNode, getViewController, getViewNode, isStarted, lookup, lookupEntity, parentLookup, parentLookupEntity, refresh, removeActionListener, removeEventListener, setParent, start, startController, withLookup, withLookupEntity, withParentLookup, withParentLookupEntity
public LoginViewController(Controller parent)
protected void initControllerActions()
This is run just before Controller.startController()
. It can be overridden
by subclasses to modify the actions further.
initControllerActions
in class Controller
protected void onStopController()
Controller
A lifecycle method that should be used to cleanup variables and listeners that were setup in
the Controller.onStartController()
method. Lookups, actions, and the view node are automatically
cleared when the controller is stopped, so you don’t have to worry about cleaning up things like that.
However, you should clean up any variables that you initialized in Controller.onStartController()
.
When live-content reloading is enabled in the Codename One simulator, it will trigger Controller.refresh()
which stops and starts the controller hierarchy.
onStopController
in class Controller
Controller.onStartController()
,
Controller.refresh()
protected void onStartController()
Controller
A lifecycle method that shoudl be used to setup the controller. Use this instead of
the constructor as this will allow you to work nicely with live content reloading. When
live-content reloading is enabled in the Codename One simulator, it will trigger Controller.refresh()
which stops and starts the controller hierarchy.
When this method is run, you can assume that the parent controller is already in the "started" state.
onStartController
in class Controller
public LoginViewModel getViewModel()
ViewController
Gets the ViewModel.
getViewModel
in class ViewController
protected ViewNode createViewNode()
Controller
Creates the view node that should be used as the node for the controller’s view. This method should
be overridden by subclasses to define the default view node, but this method shouldn’t be called directly. Rather
the Controller.getViewNode()
method should be called so that the view node is only created once. Controller.getViewNode()
will also set the parent node to the view node of the parent controller to more easily benefit from inherited attributes
in the UI descriptor hierarchy.
createViewNode
in class Controller
protected LoginViewModel createViewModel()
Creates the view model to use for the loginview. Subclasses can override
this method to provide an alternate LoginViewModel
implementation.
public void setLoginViewDelegate(LoginViewDelegate delegate)
Sets the delegate to handle events from the LoginView
.
delegate
- The delegate to register.public LoginViewDelegate getLoginViewDelegate()
Gets the registered LoginViewDelegate.
Copyright © 2021. All Rights Reserved.