public interface IViewController extends IController
The IViewController
interface defines methods and delegates
supported to manage the lifecycle of views and it's controllers. The default
implementation is AbstractViewController
. It provides a default
implementation that you can overwrite in your controller implementations. The
IViewController
interface is designed
TransitionStackController
,
AbstractViewController
,
IController
Modifier and Type | Method and Description |
---|---|
void |
addBackButton()
This method is called to creat and add a back button as part of the
IViewController implementation. |
com.softwareag.mobile.runtime.nui.nUIViewDisplay |
createView()
Creates a new instance of the
nUIViewDisplay subclass managed by this
IViewController implementation. |
com.softwareag.mobile.runtime.nui.nUIViewDisplay |
getViewDisplay()
Returns the
nUIViewDisplay instance managed by this
IViewController implementation. |
boolean |
hidesBackButton()
Returns
true if this IViewController implementation
hides the back button even if it is not the first view controller in the
TransitionStackController stack hierarchy. |
void |
onBackButtonEvent(com.softwareag.mobile.runtime.nui.nUINavbuttonElement backButton)
This method is called when the back button is selected.
|
void |
onHideView()
This methods gets called when the view becomes hidden on a pane.
|
void |
onShowView()
This method is called when the view becomes visible on a pane.
|
void |
onTransitionFrom()
This method is called right before the view is transitioned off the screen by
a
TransitionStackController . |
void |
onTransitionTo()
This method is called right after the view is created and before it is
transitioned on to the screen by a
TransitionStackController . |
void |
onUISynced()
This method will be called to notify the controller that all UI calculations
made for the underlying
nUIViewDisplay are done. |
void |
resetView()
Removes reference to the view and destroys it.
|
void |
setWindowPane(int pane)
The integer identifier of the pane will be set automatically using this
method by
TransitionStackController or by
AbstractApplicationController . |
getTransitionStackController, getWindowPane, stackTransition, transition
initBindings
void onTransitionTo()
This method is called right after the view is created and before it is
transitioned on to the screen by a TransitionStackController
.
Overwrite to add, remove or customize controls programmatically or load data
in the background. This is the entry point for all business logic that needs
to be executed for a view.
TransitionStackController}
void onTransitionFrom()
This method is called right before the view is transitioned off the screen by
a TransitionStackController
. Overwrite to save data or execute any
logic needed right before the view will be removed.
TransitionStackController}
void onShowView()
AbstractApplicationController.showPane(int)
triggers this call.void onHideView()
AbstractApplicationController.hidePane(int)
triggers this call.void setWindowPane(int pane)
TransitionStackController
or by
AbstractApplicationController
. This value is accessible by
IController.getWindowPane()
pane
- integer identifier of pane defined in Constants
com.softwareag.mobile.runtime.nui.nUIViewDisplay createView()
Creates a new instance of the nUIViewDisplay
subclass managed by this
IViewController
implementation. Overwrite this method if you
want to be notified when a view is created or if you need to do any changes
programmatically at runtime.
If you want to get the IViewController
managing a given view,
use AbstractApplicationController.getViewController(nUIViewDisplay)
IViewController
void resetView()
Removes reference to the view and destroys it.
#createView()}
com.softwareag.mobile.runtime.nui.nUIViewDisplay getViewDisplay()
Returns the nUIViewDisplay
instance managed by this
IViewController
implementation.
nUIViewDisplay
instance associated with this
controller.#createView()}
boolean hidesBackButton()
Returns true
if this IViewController
implementation
hides the back button even if it is not the first view controller in the
TransitionStackController
stack hierarchy.
Overwrite to change the default behavior of adding back buttons. To customize
the back button overwrite addBackButton()
. If you are not using
TransitionStackController
, use addBackButton()
to add
back buttons programmatically.
true
if the back button should not be addedTransitionStackController}
void addBackButton()
This method is called to creat and add a back button as part of the
IViewController
implementation. The default implementation in
AbstractViewController
, based on TransitionStackController
,
uses the header text of the previous AbstractViewController
in the
stack hierarchy. If there is no header text to be used, BACKBUTTON_DEFAULT
value from the language text resources will be loaded and used.
void onBackButtonEvent(com.softwareag.mobile.runtime.nui.nUINavbuttonElement backButton)
This method is called when the back button is selected. The default
implementation based on AbstractViewController
and
TransitionStackController
will just go back in the stack hierarchy by
calling TransitionStackController.popViewController()
-
Overwrite this method to implement custom workflow or behavior.
backButton
- the nUINavbuttonElement
instance that was selectedvoid onUISynced()
nUIViewDisplay
are done.