public abstract class AbstractAlertDialog
extends java.lang.Object
implements com.softwareag.mobile.runtime.nui.nUIEventListener
AbstractAlertDialog
acts as a super class for all generated
alert dialogs. It provides the open()
and close()
methods
as well as the default event listener implementation. An application can
only have one dialog open at a time. AbstractAlertDialog dialog = ...; dialog.open();Or use the methods provided by the
AbstractApplicationController
:
AbstractAlertDialog dialog = ...; AbstractApplicationController.getInstance().openDialog(dialog);To create the
AbstractAlertDialog
, the user has to deliver an
instance of the IDialogDelegate
interface with the constructor. Each
abstract view controller implements this interface per default. This also
means that there a two ways of creating the dialog:
final AbstractAlertDialog dialog = new MyDialog(this);
IDialogDelegate
.
final AbstractAlertDialog dialog = new MyDialog(new MyDialogDelegate());
IDialogDelegate.onAlertDialogButtonPressed(AbstractAlertDialog, int)
method from a specific view controller or delegate implementation. The passed
AbstractAlertDialog
represents the current instance. The integer
value corresponds to the button id, the user entered in the outline editor.
This id, stored in the Constants interface, can be used to determine
different behaviors for different buttons, e.g.:
public void onAlertDialogButtonPressed(final AbstractAlertDialog dialog, final int id) { switch (id) { case Constants.BUTTON_1: // ... break; case Constants.BUTTON_2: // ... break; } }This class is also just a wrapper for the Mobile Designer
nUIAlertDialog
. Each sub class has to override the
getDialog()
method to create the underlying nUIAlertDialog
.
bottom, center, centre, CREATE, CUSTOM_EVENT_CODE0, EVT_BACK_BUTTON, EVT_COMPLETED_EDIT, EVT_DOUBLE_TAP, EVT_GAIN_FOCUS, EVT_LONG_PRESS, EVT_LOSE_FOCUS, EVT_ON_ADDITION, EVT_PICKER_CANCEL, EVT_PICKER_OK, EVT_POST_EDIT, EVT_PRE_EDIT, EVT_SWIPE_LEFT, EVT_SWIPE_RIGHT, EVT_TIMER_COMPLETE, EVT_TRANSITION_FROM_COMPLETE, EVT_TRIGGER, EVT_TRIGGER_HTTP_FAIL, EVT_TRIGGER_HTTP_SUCCESS, GESTURE_DOUBLE_TAP, GESTURE_LONG_PRESS, GESTURE_NONE, GESTURE_SWIPE, left, MAX_DY_FOR_SWIPE, MIN_DX_FOR_SWIPE, MIN_SCROLL_START_THRESHOLD, NO_YES, OFF_ON, POINTER_STATE_DRAGGED, POINTER_STATE_PRESSED, POINTER_STATE_PRESSED_AND_RELEASED, POINTER_STATE_RELEASED, REMOVE, right, size_absolute, size_huge, size_large, size_medium, size_relative, size_small, size_tiny, style_bold, style_default, style_italic, style_underlined, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, top
Constructor and Description |
---|
AbstractAlertDialog(IDialogDelegate delegate)
Creates a new AbstractAlertDialog by passing an IDialogDelegate.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this dialog.
|
abstract com.softwareag.mobile.runtime.nui.nUIAlertDialog |
getDialog()
Returns the Mobile Designer
nUIAlertDialog this class wraps. |
boolean |
nUIEventCallback(com.softwareag.mobile.runtime.nui.nUIObject object,
int eventType) |
void |
open()
Opens this dialog.
|
public AbstractAlertDialog(IDialogDelegate delegate)
delegate
- public boolean nUIEventCallback(com.softwareag.mobile.runtime.nui.nUIObject object, int eventType)
nUIEventCallback
in interface com.softwareag.mobile.runtime.nui.nUIEventListener
public void open()
public void close()
public abstract com.softwareag.mobile.runtime.nui.nUIAlertDialog getDialog()
nUIAlertDialog
this class wraps.