public abstract class AbstractListViewController extends AbstractViewController implements com.softwareag.mobile.runtime.nui.IListListener, com.softwareag.mobile.runtime.nui.IListProvider, Observer, IComparator
AbstractListViewController
acts as a default implementation
for IListListener
and IListProvider
and will be used as super
class for any RecordView in the AML model.
Constructor and Description |
---|
AbstractListViewController() |
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Object left,
java.lang.Object right)
Compares two objects and returns either -1, 0 or 1 to tell the caller if
the first argument object is less than, equal to, or greater than the
second.
|
com.softwareag.mobile.runtime.nui.nUIDisplayObject |
createEmptyListCell()
Creates the
nUIDisplayObject , which will be displayed when the
list datasource does not hold any elements. |
com.softwareag.mobile.runtime.nui.nUIDisplayObject |
createOfflineListCell()
Creates a
nUIDisplayObject , which will be displayed when
isOnline() returns false. |
void |
doReload()
Call this method to trigger the reload process.
|
com.softwareag.mobile.runtime.nui.nUIDisplayObject |
getCell(int rowIndex,
com.softwareag.mobile.runtime.nui.nUIDisplayObject reusableObject) |
com.softwareag.mobile.runtime.nui.nUIDisplayObject |
getEmptyListCell()
Returns a boolean value indicating if the list empty cell should be used
if the datasource does not contain any elements after reloading.
|
int |
getNumberOfRows() |
com.softwareag.mobile.runtime.nui.nUIDisplayObject |
getOfflineListCell()
Returns the list offline cell.
|
com.softwareag.mobile.runtime.nui.nUIDisplayObject |
getSeparator() |
int |
getTypeForCell(int rowIndex) |
void |
onDatasourceError(IListDatasource datasource,
java.lang.Exception exception)
Will be called when reloading returns in an exception.
|
void |
onFocusGained(int rowIndex,
com.softwareag.mobile.runtime.nui.nUIDisplayObject element) |
void |
onFocusLost(int rowIndex,
com.softwareag.mobile.runtime.nui.nUIDisplayObject element) |
void |
onRefresh() |
void |
onRowSelected(int rowIndex,
com.softwareag.mobile.runtime.nui.nUIDisplayObject element) |
void |
onScrollBoundReached(int type) |
void |
onScrollStateChanged(int state) |
void |
onScrollThresholdReached() |
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 |
reloadDatasources()
Reloads the assigned list datasource.
|
void |
update(Observable observable,
java.lang.Object object)
This method will be called if the underlying
Observable has been
changed. |
bind, bind, bind, bind, bind, createNavButton, createNavButton, getBackButtonText, getDefaultPlaceHolderImage, getMappedTransitionStackControllers, getTransitionStackController, getWindowPane, hasSideView, initBindings, loadImage, loadImage, loadImage, loadWWWResource, onAlertDialogButtonPressed, onBackButtonEvent, onHideView, onShowView, onUISynced, resetView, resizeImage, setTransitionStackController, setWindowPane, stackTransition, transition
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBackButton, createView, getViewDisplay, hidesBackButton
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
onTransitionFrom
in class AbstractViewController
TransitionStackController}
public 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
onTransitionTo
in class AbstractViewController
TransitionStackController}
public void update(Observable observable, java.lang.Object object)
Observer
Observable
has been
changed.update
in interface Observer
observable
- the changed Observable
object
- any passed data Object, can be nullpublic void reloadDatasources()
If no datasource is assigned to the RecordView, clients need to overwrite
this method to implement the reload theirselves. Make sure to call the
update(Observable, Object)
method once the reload is completed.
public void onDatasourceError(IListDatasource datasource, java.lang.Exception exception)
Clients need to overwrite this method in order to properly react on exceptions. The default implementation only forces the underlying ListView to update.
datasource
- exception
- public void doReload()
This method determines if an offline list cell needs to be displayed
while calling isOnline()
.
public com.softwareag.mobile.runtime.nui.nUIDisplayObject createOfflineListCell()
nUIDisplayObject
, which will be displayed when
isOnline()
returns false.public com.softwareag.mobile.runtime.nui.nUIDisplayObject getOfflineListCell()
Calls createOfflineListCell()
if the actual instance is null.
public com.softwareag.mobile.runtime.nui.nUIDisplayObject createEmptyListCell()
nUIDisplayObject
, which will be displayed when the
list datasource does not hold any elements.
If null is returned, the ListView will remain empty.
public com.softwareag.mobile.runtime.nui.nUIDisplayObject getEmptyListCell()
This method will be used internally. It's not recommended to overwrite it.
public int compare(java.lang.Object left, java.lang.Object right)
IComparator
compare
in interface IComparator
left
- the first object for comparingright
- the second object for comparingpublic int getNumberOfRows()
getNumberOfRows
in interface com.softwareag.mobile.runtime.nui.IListProvider
public int getTypeForCell(int rowIndex)
getTypeForCell
in interface com.softwareag.mobile.runtime.nui.IListProvider
public com.softwareag.mobile.runtime.nui.nUIDisplayObject getCell(int rowIndex, com.softwareag.mobile.runtime.nui.nUIDisplayObject reusableObject)
getCell
in interface com.softwareag.mobile.runtime.nui.IListProvider
public com.softwareag.mobile.runtime.nui.nUIDisplayObject getSeparator()
getSeparator
in interface com.softwareag.mobile.runtime.nui.IListProvider
public void onRowSelected(int rowIndex, com.softwareag.mobile.runtime.nui.nUIDisplayObject element)
onRowSelected
in interface com.softwareag.mobile.runtime.nui.IListListener
public void onFocusGained(int rowIndex, com.softwareag.mobile.runtime.nui.nUIDisplayObject element)
onFocusGained
in interface com.softwareag.mobile.runtime.nui.IListListener
public void onFocusLost(int rowIndex, com.softwareag.mobile.runtime.nui.nUIDisplayObject element)
onFocusLost
in interface com.softwareag.mobile.runtime.nui.IListListener
public void onScrollBoundReached(int type)
onScrollBoundReached
in interface com.softwareag.mobile.runtime.nui.IListListener
public void onScrollThresholdReached()
onScrollThresholdReached
in interface com.softwareag.mobile.runtime.nui.IListListener
public void onScrollStateChanged(int state)
onScrollStateChanged
in interface com.softwareag.mobile.runtime.nui.IListListener
public void onRefresh()
onRefresh
in interface com.softwareag.mobile.runtime.nui.IListListener