public abstract class AbstractViewController extends java.lang.Object implements IViewController, IResourceController, IDialogDelegate
Constructor and Description |
---|
AbstractViewController() |
Modifier and Type | Method and Description |
---|---|
void |
bind(com.softwareag.mobile.runtime.nui.nUIDisplayObject control,
IDatasource ds,
IDataTransformer transformer,
java.lang.String expression)
Fetches the expression value and passes this value
bind(nUIDisplayObject, IDataTransformer, Object) . |
void |
bind(com.softwareag.mobile.runtime.nui.nUIDisplayObject control,
IDatasource ds,
java.lang.String expression)
Binds a given control to it's value defined within a datasource.
|
void |
bind(com.softwareag.mobile.runtime.nui.nUIDisplayObject control,
IListDatasource ds,
IDataTransformer transformer,
int rowIndex,
java.lang.String expression)
Binds a given control to it's value defined within a datasource.
|
void |
bind(com.softwareag.mobile.runtime.nui.nUIDisplayObject control,
IListDatasource ds,
IDataTransformer transformer,
java.lang.String expression)
Binds a given control to it's value defined within a datasource.
|
void |
bind(com.softwareag.mobile.runtime.nui.nUIDisplayObject control,
IListDatasource ds,
java.lang.String expression)
Binds a given control to it's value defined within a datasource.
|
boolean |
forceHide(com.softwareag.mobile.runtime.nui.nUIObject element)
Hides the delivered elements
|
java.lang.String |
getBackButtonText()
Returns the default back button text.
|
javax.microedition.lcdui.Image |
getDefaultPlaceHolderImage()
Return the default place holder image that will be used if requested
image was not found.
|
java.util.Hashtable |
getMappedTransitionStackControllers()
Returns all
TransitionStackController , which were stored by
stackTransition(nUIObject, int, AbstractViewController, int, int)
method calls. |
TransitionStackController |
getTransitionStackController()
Returns the assigned
TransitionStackController or null if no
TransitionStackController is used for the observed element. |
int |
getWindowPane()
Returns the Integer representation of the pane, which displays the
observed UI element.
|
boolean |
hasSideView()
Returns a boolean value indicating if a SideView should be used in
combination with the underlying view.
|
boolean |
isVisible(com.softwareag.mobile.runtime.nui.nUIObject element)
Checks if the given element is visible.
|
javax.microedition.lcdui.Image |
loadImage(java.lang.String imageName)
Tries to find and load image with the given name.
|
javax.microedition.lcdui.Image |
loadImage(java.lang.String imageName,
int viewBackGroundColor)
Tries to find and load image with the given name.
|
javax.microedition.lcdui.Image |
loadImage(java.lang.String imageName,
int viewBackGroundColor,
int parentsWidth)
Tries to find and load image with the given name.
|
java.lang.String |
loadWWWResource(com.softwareag.mobile.runtime.nui.nUIObject target,
java.lang.String fileName,
java.lang.String prefix,
java.lang.String encoding)
Loads the given html file to the string
|
void |
onAlertDialogButtonPressed(AbstractAlertDialog dialog,
int buttonId)
implement IDialogDelegate interface
|
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.
|
javax.microedition.lcdui.Image |
resizeImage(javax.microedition.lcdui.Image image,
int width,
int height)
Resize the given image.
|
boolean |
setVisible(com.softwareag.mobile.runtime.nui.nUIObject element,
boolean visible)
Hides or makes the given element visible in the view.
|
void |
setWindowPane(int pane)
The integer identifier of the pane will be set automatically using this
method by
TransitionStackController or by
AbstractApplicationController . |
void |
stackTransition(com.softwareag.mobile.runtime.nui.nUIObject sender,
int evtType,
AbstractViewController controller,
int transition,
int pane)
This method creates a new
TransitionStackController (TSC)
using sender as identifier if it does not already exist and
navigates to the view created by the given controller into
the given pane. |
void |
transition(com.softwareag.mobile.runtime.nui.nUIObject sender,
int evtType,
AbstractViewController controller,
int transition,
int pane)
Navigates to the view created by
controller . |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBackButton, createView, getViewDisplay, hidesBackButton
public void transition(com.softwareag.mobile.runtime.nui.nUIObject sender, int evtType, AbstractViewController controller, int transition, int pane)
IController
controller
. The view with
given transition effect appears on the given pane. If there is a
StackTransitionController, which is associated with the pane, the
controller
will be pushed to it.transition
in interface IController
sender
- The nUIObject
which triggers the event.evtType
- The type of the event. Possible types are declared in
nUIConstants
.controller
- The controller which contains a View to push.transition
- The type of the transition. Transition types are defined in
nUIController
.pane
- The Integer representation of the pane to push the View on.IController.getTransitionStackController()
,
IController.getWindowPane()
public void stackTransition(com.softwareag.mobile.runtime.nui.nUIObject sender, int evtType, AbstractViewController controller, int transition, int pane)
IController
TransitionStackController
(TSC)
using sender
as identifier if it does not already exist and
navigates to the view created by the given controller
into
the given pane. The new created TSC will be mapped to sender
and saved in the current controller.
If a TransitionStackController
exists, the
controller
will be ignored. Depending on which controller is
currently associated with the target pane, methods navigates either to
stackTransition
in interface IController
sender
- object that triggered this call. Its NUIID is used as key to
store/retrieve TSC.evtType
- type of the event that triggered the call.controller
- if TSC does not exist, controller
is used as root
controller for the TSCtransition
- transition effect.pane
- target panepublic java.util.Hashtable getMappedTransitionStackControllers()
TransitionStackController
, which were stored by
stackTransition(nUIObject, int, AbstractViewController, int, int)
method calls.Hashtable
, whereby Key - NUIID, value -
TransitionStackController
public TransitionStackController getTransitionStackController()
IController
TransitionStackController
or null if no
TransitionStackController is used for the observed element. TransitionStackController
assigned to the controller, which
observes a given View the Template is assigned to. TransitionStackController
assigned to the View's controller.getTransitionStackController
in interface IController
TransitionStackController
or null.public void setWindowPane(int pane)
IViewController
TransitionStackController
or by
AbstractApplicationController
. This value is accessible by
IController.getWindowPane()
setWindowPane
in interface IViewController
pane
- integer identifier of pane defined in Constants
public int getWindowPane()
IController
Constants
interface.getWindowPane
in interface IController
public java.lang.String getBackButtonText()
Controller implementations may overwrite this method.
public void onBackButtonEvent(com.softwareag.mobile.runtime.nui.nUINavbuttonElement backButton)
IViewController
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.
onBackButtonEvent
in interface IViewController
backButton
- the nUINavbuttonElement
instance that was selectedpublic void onTransitionTo()
IViewController
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.
onTransitionTo
in interface IViewController
TransitionStackController}
public void onTransitionFrom()
IViewController
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.
onTransitionFrom
in interface IViewController
TransitionStackController}
public void onShowView()
IViewController
AbstractApplicationController.showPane(int)
triggers this call.onShowView
in interface IViewController
public void onHideView()
IViewController
AbstractApplicationController.hidePane(int)
triggers this call.onHideView
in interface IViewController
public void resetView()
IViewController
Removes reference to the view and destroys it.
resetView
in interface IViewController
#createView()}
public void onAlertDialogButtonPressed(AbstractAlertDialog dialog, int buttonId)
onAlertDialogButtonPressed
in interface IDialogDelegate
dialog
- The AbstractAlertDialog
containing the button.buttonId
- The id of the triggered button as modeled with the editor.public void onUISynced()
IViewController
nUIViewDisplay
are done.onUISynced
in interface IViewController
public boolean hasSideView()
This method will be overwritten by each specific view controller. The returned boolean value is true, if the modeled view contains a OpenSideView action.
public void bind(com.softwareag.mobile.runtime.nui.nUIDisplayObject control, IListDatasource ds, java.lang.String expression)
Just delegates to
bind(nUIDisplayObject, IListDatasource, IDataTransformer, String)
.
control
- ds
- expression
- public void bind(com.softwareag.mobile.runtime.nui.nUIDisplayObject control, IListDatasource ds, IDataTransformer transformer, java.lang.String expression)
Just delegates to
bind(nUIDisplayObject, IListDatasource, IDataTransformer, int, String)
.
control
- ds
- transformer
- expression
- public void bind(com.softwareag.mobile.runtime.nui.nUIDisplayObject control, IDatasource ds, java.lang.String expression)
Just delegates to
#bind(nUIDisplayObject, IDatasource, IDataTransformer, int, String)
.
control
- ds
- transformer
- expression
- public void bind(com.softwareag.mobile.runtime.nui.nUIDisplayObject control, IDatasource ds, IDataTransformer transformer, java.lang.String expression)
bind(nUIDisplayObject, IDataTransformer, Object)
.control
- ds
- transformer
- expression
- public void bind(com.softwareag.mobile.runtime.nui.nUIDisplayObject control, IListDatasource ds, IDataTransformer transformer, int rowIndex, java.lang.String expression)
Uses IListDatasource.getExpressionValue(String, int)
and passes
this value to the specific updateBinding methods.
control
- ds
- transformer
- rowIndex
- expression
- public boolean isVisible(com.softwareag.mobile.runtime.nui.nUIObject element)
IViewController
Checks if the given element is visible.
isVisible
in interface IViewController
element
- the given elementpublic boolean setVisible(com.softwareag.mobile.runtime.nui.nUIObject element, boolean visible)
IViewController
setVisible
in interface IViewController
element
- target element, which belongs to the viewvisible
- if true makes the element visible, otherwise hides itpublic boolean forceHide(com.softwareag.mobile.runtime.nui.nUIObject element)
element
- public java.lang.String loadWWWResource(com.softwareag.mobile.runtime.nui.nUIObject target, java.lang.String fileName, java.lang.String prefix, java.lang.String encoding)
IResourceController
loadWWWResource
in interface IResourceController
target
- object that triggers the callfileName
- requested html fileprefix
- relative path, where the given file is supposed to be found.encoding
- this encoding will be used by reading the html file.
return content of the given file.public javax.microedition.lcdui.Image getDefaultPlaceHolderImage()
IResourceController
getDefaultPlaceHolderImage
in interface IResourceController
public javax.microedition.lcdui.Image loadImage(java.lang.String imageName)
IResourceController
IResourceController.loadImage(String, int, int)
for more details.loadImage
in interface IResourceController
public javax.microedition.lcdui.Image loadImage(java.lang.String imageName, int viewBackGroundColor)
IResourceController
IResourceController.loadImage(String, int, int)
for more details.loadImage
in interface IResourceController
public javax.microedition.lcdui.Image loadImage(java.lang.String imageName, int viewBackGroundColor, int parentsWidth)
IResourceController
#defaultPlaceHolderImage
will be returned. Following paths
are used for searching in the given ordering:
AbstractApplicationController#getAndroidGraphicsFolder(int, int)
AbstractApplicationController#getBlackBerryGraphicsFolder(int, int, int)
AbstractApplicationController#getIOSGraphicsFolders(int, int)
AbstractApplicationController#getWinPhoneGraphicFolder(int, int, int)
see also
AbstractApplicationController#getWinPhoneThemeFolder(int)
AbstractApplicationController#getGeneralGraphicsFolder(int, int)
loadImage
in interface IResourceController
imageName
- filename to loadviewBackGroundColor
- background color of view, where image will be shownparentsWidth
- width of container, where image will be shown. if value is -1,
then the smallest side of screen will used as containerWidthpublic javax.microedition.lcdui.Image resizeImage(javax.microedition.lcdui.Image image, int width, int height)
IResourceController
ImageHandler#resizeImage(Image, int, int, boolean)
for more
details.resizeImage
in interface IResourceController