danger.ui
Class TextInputAlertWindow

java.lang.Object
  extended by danger.app.Listener
      extended by danger.ui.View
          extended by danger.ui.Container
              extended by danger.ui.Window
                  extended by danger.ui.DialogWindow
                      extended by danger.ui.AlertWindow
                          extended by danger.ui.TextInputAlertWindow


public class TextInputAlertWindow
extends AlertWindow

Alert with up to three text input fields.


Field Summary
static int GAP1
          Deprecated. For internal use only.
static int GAP4
          Deprecated. For internal use only.
protected  int m_fieldID1
          Deprecated. For internal use only.
protected  int m_fieldID2
          Deprecated. For internal use only.
protected  int m_fieldID3
          Deprecated. For internal use only.
protected  boolean mGSMMode
          Deprecated. For internal use only.
protected  TextField mTextField1
          Deprecated. For internal use only.
protected  TextField mTextField2
          Deprecated. For internal use only.
protected  TextField mTextField3
          Deprecated. For internal use only.
protected  StaticText mTextFieldLabel1
          Deprecated. For internal use only.
protected  StaticText mTextFieldLabel2
          Deprecated. For internal use only.
protected  StaticText mTextFieldLabel3
          Deprecated. For internal use only.
protected  int mTextFieldMaxChar1
          Deprecated. For internal use only.
protected  int mTextFieldMaxChar2
          Deprecated. For internal use only.
protected  int mTextFieldMaxChar3
          Deprecated. For internal use only.
 
Fields inherited from class danger.ui.AlertWindow
GAP3, IMAGE_TEXT_GAP, m_autoDismiss, m_autoDismissEvent, m_autoDismissMS, m_autoDismissTimer, m_forceNoButtons, MAX_BITMAP_SIZE, mImageView, mImageViewHeight, mImageViewWidth, mMessageView, mNeedLayout, mScrollView, TOP_ICON_MARGIN
 
Fields inherited from class danger.ui.DialogWindow
APP_ALERT_STYLE, APP_DIALOG_STYLE, BOTTOM_POSITION1, BOTTOM_POSITION2, BOTTOM_POSITION3, BUTTON_HEIGHT, m_autoCenter, m_bottomBorder, m_leftBorder, m_rightBorder, m_showTone, m_showToneID, m_toneAlarm, m_topBorder, mAutoSizeHeight, mAutoSizeWidth, MAX_BOTTOM_BUTTONS, MAX_BUTTONS, mBackEvent, mButtonIDs, mButtons, mCancelEvent, mCenterTitle, mDefaultButton, mDefaultButtonPosition, mHideOnButton, mLayoutButtonsVertically, mListener, mNeedToAddBottomFrameButtons, mNeedToAddTopFrameButtons, mRegisteredForKeyGuardEvent, mShortcutModifiers, mShortcuts, SHOW_STATE_HIDDEN, SHOW_STATE_SHOWING, SHOW_STATE_VISIBLE, SYSTEM_ALERT_TYPE_ALARM, SYSTEM_ALERT_TYPE_CONTROL, SYSTEM_ALERT_TYPE_GENERAL, SYSTEM_ALERT_TYPE_INCOMING_CALL, SYSTEM_ALERT_TYPE_MISSED_CALL, SYSTEM_ALERT_TYPE_PERSISTENT_CONTROL, SYSTEM_DIALOG_STYLE, SYSTEM_ERROR_STYLE, TOP_POSITION1, TOP_POSITION2
 
Fields inherited from class danger.ui.Window
mBusyPaintCount, mDefaultListener, STATE_AUTO_HIDE_IF_IDLE, STATE_DROP_ORPHANED_EVENTS, STATE_FULLSCREEN, STATE_UNUSED1
 
Fields inherited from class danger.ui.View
DEFAULT_SCROLL_FOCUS_MARGIN, FOCUS_DEFAULT, FOCUS_DOWNWARD, FOCUS_LEFTWARD, FOCUS_NONE, FOCUS_RIGHTWARD, FOCUS_UPWARD, mOriginX, mOriginY, mStyle, POSITION_ABOVE, POSITION_ALIGN_BASELINE, POSITION_ALIGN_BOTTOM, POSITION_ALIGN_HORIZONTALLY, POSITION_ALIGN_LEFT, POSITION_ALIGN_PARENT_BOTTOM, POSITION_ALIGN_PARENT_RIGHT, POSITION_ALIGN_RIGHT, POSITION_ALIGN_TOP, POSITION_ALIGN_VERTICALLY, POSITION_BELOW, POSITION_CENTER_HORIZONTALLY, POSITION_CENTER_VERTICALLY, POSITION_TO_LEFT, POSITION_TO_RIGHT, PREFER_DIRECTION_NONE, PREFER_HORIZONTAL_DIRECTION, PREFER_VERTICAL_DIRECTION, STATE_AT_AND_SPACE_PAGE, STATE_CAN_FOCUS, STATE_DEBUG_BOUNDS, STATE_ENABLED, STATE_FOCUSED, STATE_MAKE_DING, STATE_PARTIAL_FOCUS_OK, STATE_TRANSPARENT, STATE_VISIBLE, WIDTH_FILL_TO_RIGHT
 
Constructor Summary
TextInputAlertWindow()
          Default constructor.
TextInputAlertWindow(CharSequence message)
          Construct an instance with the given message.
TextInputAlertWindow(int windowStyle, CharSequence message)
          Construct an instance with the given message and style.
TextInputAlertWindow(int windowStyle, CharSequence message, boolean showCancel)
          Construct an instance with the given message and style.
TextInputAlertWindow(int windowStyle, String message)
          Construct an instance with the given message and style.
TextInputAlertWindow(int windowStyle, String message, boolean showCancel)
          Construct an instance with the given message and style.
TextInputAlertWindow(String message)
          Construct an instance with the given message.
 
Method Summary
 boolean addTextField(CharSequence inLabel, CharSequence defaultText, int inMaxChar, boolean isPassword)
          Set the text field for the alert window.
 boolean addTextField(CharSequence inLabel, CharSequence defaultText, int inMaxChar, boolean isPassword, boolean disabled)
          Set the text field for the alert window.
 boolean addTextField(CharSequence inLabel, CharSequence defaultText, int inMaxChar, boolean isPassword, boolean disabled, int id)
          Set the text field for the alert window.
 TextField addTextField(CharSequence inLabel, int inMaxChar, boolean isPassword, int id)
          Set the text field for the alert window.
 TextField addTextField(String inLabel, int inMaxChar, boolean isPassword, int id)
          Set the text field for the alert window.
 boolean addTextField(String inLabel, String defaultText, int inMaxChar, boolean isPassword)
          Set the text field for the alert window.
 boolean addTextField(String inLabel, String defaultText, int inMaxChar, boolean isPassword, boolean disabled)
          Set the text field for the alert window.
 boolean addTextField(String inLabel, String defaultText, int inMaxChar, boolean isPassword, boolean disabled, int id)
          Set the text field for the alert window.
 void enableTextField(int id, boolean enable)
          Enables or disables the text field with the given id.
 boolean eventKeyDown(char c, Event event)
          This method is called when the user presses a key.
 View getDescendantWithID(int id)
          Get the descendant view with the given id.
protected  int getMaxMessageHeight()
          Returns the maximum message height (in pixels).
static String getTextFieldValue(IPCMessage ipcMsg, int id)
          Returns the text in the text field with the given id.
 TextField getTextFieldWithID(int id)
          Returns the text field with the given id, or null if no such field exists.
protected  boolean layout()
          Lays out the alert.
protected  int layoutTextField(int textColLeft, int textColWidth, int windowHeight)
          Lays out the text fields.
 boolean receiveEvent(Event e)
          Receive an event from the alert window.
 void setGSMPINPUKMode(boolean gsmMode)
          For internal use only.
 void setTextField(int id, CharSequence value)
          Sets the text in the text field with the given id.
 void setTextField(int id, String value)
          Sets the text in the text field with the given id.
 
Methods inherited from class danger.ui.AlertWindow
addChildBelowMessageArea, getAutoDismiss, getAutoDismissEvent, getAutoDismissMS, getBitmap, getForceNoButtons, getImageView, getMessage, getMessageFont, getMessageSequence, getMessageView, getScrollView, getSleepScreenImage, getSleepScreenMessage, getSleepScreenMessageCharSequence, layoutBitmap, layoutMessage, onHide, paint, removeContentChildren, setAutoDismiss, setAutoDismiss, setBitmap, setForceNoButtons, setMessage, setMessage, setMessageFont, setMessageFormatDate, setMessageFormatText, setMessageFormatText, setMessageFormatText, setMessageFormatText, setMessageFormatText, setWindowStyle, showInternal
 
Methods inherited from class danger.ui.DialogWindow
activateFrameButton, addBottomFrameButton, addBottomFrameButton, addBottomFrameButtons, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addTopFrameButton, addTopFrameButton, addTopFrameButtons, blocksChooser, calcBottom, convertShortcutKeyToButtonIndex, convertShortcutKeyToButtonIndex, disableBottomRightButtonOnEmptyField, disableButtonOnEmptyField, drawDialogStyleFrame, eventKeyUp, eventShortcut, eventWidgetDown, eventWidgetUp, getCancelButton, getChildWithID, getContentRect, getDefaultFrameButton, getFrameButtonWithID, getNumTopFrameButtons, getShowState, getTitle, getTitleBarHeight, getTitleFont, getTitleSequence, getWidthToFitTitle, getWindowStyle, handleButtonShortcut, handleFrameButtonShortcut, handleShortcutKey, hasVisibleFrameButtons, hide, layoutTopFrameButtons, positionDialog, reflowFrameButtons, removeAllChildren, removeFrameButtonWithID, setAutoCenter, setAutoSize, setAutoSizeHeight, setAutoSizeWidth, setBackEvent, setBorders, setCancelButtonEvent, setCenterTitle, setContentSize, setDefaultFrameButton, setDefaultFrameButton, setDrawBottomFrame, setEventForControlWithID, setEventForFrameButtonWithID, setFocusedChild, setFocusedDescendant, setForceDrawBottomFrame, setFrameButtonShortcut, setFrameButtonShortcut, setHideOnButtonEvent, setHideOnButtonWithID, setHideOnButtonWithPosition, setLayoutBottomFrameButtonsVertically, setListener, setNoDefaultFrameButton, setShowCancel, setShowTone, setShowTone, setSize, setSleepScreenMessage, setSleepScreenMessage, setTitle, setTitle, setWidthToFitTitle, show, show, show, snapToChildren, startShowTone, stopShowTone, updateBottomButtonWidths, updateFrameButtonColors, wantsEndButton, wantsSendButton
 
Methods inherited from class danger.ui.Window
adjustActionMenuState, advanceFocus, autoHide, autoHideIfIdle, autoHideIfIdle, blocksBackButton, blocksFloatingControls, blocksKeyGuard, blocksVolumeButtons, centerHorizontal, centerOnScreen, centerUnderTitleBar, centerVertical, disableControlWithID, dropOrphanedEvents, enableControlWithID, forwardQueuedEvents, getApplication, getDefaultFocus, getIDOfChild, getListener, getWindowBelow, hideActiveMenu, hideControlWithID, incrementMaxChildID, isActionMenuVisible, isFullScreen, isUnresponsive, onActivate, onDeactivate, onPeriodicPulse, onWindowPaint, receiveMessage, reverseFocus, setDefaultFocus, setDefaultListener, setEventArgForControlWithID, setFullScreen, setMaxChildID, setMaxControlID, setPosition, setTitled, setTitleFormatDate, setTitleFormatText, setTitleFormatText, setTitleFormatText, setTitleFormatText, setTitleFormatText, shouldDropEvent, showControlWithID, startQueueingEvents, willPassEventToWindow
 
Methods inherited from class danger.ui.Container
addChild, addChild, addChildAt, addChildAt, addFromContainerResource, addFromContainerResource, addFromContainerResource, addFromDialogResource, addFromDialogResource, advanceFocusInWindow, childCount, childIsOnScreen, disable, enable, eventKeyHeld, eventKeyRepeat, eventPeriodicPulse, eventRawKeyDown, eventRawKeyHeld, eventRawKeyRepeat, eventRawKeyUp, eventWidgetHeld, focusedDescendantIsValid, getBottomChild, getBottomChild, getChildAt, getChildIndex, getControlWithID, getFirstChild, getFirstFocusableChild, getFocusableChildInWindow, getFocusedChild, getFocusedLeaf, getInterestingRect, getLastChild, getLastFocusableChild, getLeftMostChild, getNextFocusableChild, getNextFocusableChild, getPageHeight, getPrevFocusableChild, getPrevFocusableChild, getRightMostChild, getRightMostChild, hideAllChildren, isDescendant, keepRectInView, loseFocus, moveChildToIndex, onChildPositionChanged, onChildSizeChanged, onChildVisibilityChanged, pageToEnd, pageToHome, paintChildren, reflowChildren, removeChild, setFocusedChild, setFocusedChild, setFocusedDescendant, setFocusedDescendant, setFocusToFirstDescendant, setFormatDateForControlWithID, setFormatDateForTextControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setListenerForAllControls, setReflowAdjustHeight, setWindow, showAllChildren, snapHeightToChildren, snapHeightToChildren, snapWidthToChildren, snapWidthToChildren, takeFocus, willFocusWithin, willFocusWithin
 
Methods inherited from class danger.ui.View
boundsIntersect, boundsIntersect, canLoseFocus, clear, clear, copyStyle, getAcceptFocus, getBackgroundColor, getBottom, getBounds, getBounds, getFocusTraversalDirection, getFocusTraversalFrom, getFocusTraversalPolicy, getFrame, getFrame, getGlobalBottom, getGlobalLeft, getGlobalRight, getGlobalTop, getHeight, getID, getInterestingRect, getLabelFont, getLabelFont, getLeft, getOrigin, getOrigin, getOriginX, getOriginY, getParent, getParentContainer, getPartialFocusOK, getRight, getScrollFocusMargin, getSibling, getState, getStyle, getStyleColor, getStyleFont, getTop, getWidth, getWindow, globalToLocal, globalToLocalH, globalToLocalV, invalidate, invalidate, invalidate, invalidateIndependentOfOrigin, invalidateIndependentOfOrigin, isEnabled, isFocusable, isFocused, isOnScreen, isTransparent, isVisible, isVisibleInHierarchy, isVisibleOnScreen, justSetVisible, localToGlobal, localToGlobal, localToGlobalH, localToGlobalV, localToWindow, moveBy, notifyWhenParentSizeChanges, notifyWhenPositionChanges, notifyWhenSizeChanges, offsetOrigin, offsetOrigin, onAddedToParent, onDecoded, onEnabledStateChanged, onPositionChanged, onRemovedFromParent, onShortcut, onShortcut, onShortcutConsumed, onShow, onSizeChanged, onStyleChanged, onViewPositionChanged, onViewSizeChanged, playLimitSound, receiveEventInternal, resetOrigin, sendEventToWindow, setAcceptFocus, setAtAndSpacePage, setBackground, setBackgroundColor, setBottom, setDebugBounds, setDynamicPosition, setDynamicWidth, setEnabled, setFocusTraversalDirection, setFocusTraversalFrom, setFocusTraversalPolicy, setFrame, setHeight, setKeyedValue, setLabelFont, setLeft, setMakeLimitNoise, setOrigin, setOrigin, setPartialFocusOK, setPreferredDirection, setRight, setScrollFocusMargin, setStyle, setStyleColor, setStyleFont, setStyleFrameColor, setTop, setTransparent, setVisible, setWidth, showContextMenu, styleIsDefault, swapStyleColors, windowToLocal
 
Methods inherited from class danger.app.Listener
cancelEvents, childEventPump, childEventPumpDone, eventProblem, isDispatchingThread, sendEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendLowPriorityEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mTextField1

protected TextField mTextField1
Deprecated. For internal use only.

mTextField2

protected TextField mTextField2
Deprecated. For internal use only.

mTextField3

protected TextField mTextField3
Deprecated. For internal use only.

m_fieldID1

protected int m_fieldID1
Deprecated. For internal use only.

m_fieldID2

protected int m_fieldID2
Deprecated. For internal use only.

m_fieldID3

protected int m_fieldID3
Deprecated. For internal use only.

mTextFieldLabel1

protected StaticText mTextFieldLabel1
Deprecated. For internal use only.

mTextFieldLabel2

protected StaticText mTextFieldLabel2
Deprecated. For internal use only.

mTextFieldLabel3

protected StaticText mTextFieldLabel3
Deprecated. For internal use only.

mTextFieldMaxChar1

protected int mTextFieldMaxChar1
Deprecated. For internal use only.

mTextFieldMaxChar2

protected int mTextFieldMaxChar2
Deprecated. For internal use only.

mTextFieldMaxChar3

protected int mTextFieldMaxChar3
Deprecated. For internal use only.

mGSMMode

protected boolean mGSMMode
Deprecated. For internal use only.

GAP1

public static final int GAP1
Deprecated. For internal use only.
See Also:
Constant Field Values

GAP4

public static final int GAP4
Deprecated. For internal use only.
See Also:
Constant Field Values
Constructor Detail

TextInputAlertWindow

public TextInputAlertWindow()
Default constructor. The alert will have APP_DIALOG_STYLE, a cancel button, no bitmap, and no text input fields.


TextInputAlertWindow

public TextInputAlertWindow(String message)
Construct an instance with the given message. The alert will have APP_DIALOG_STYLE, a cancel button, no bitmap, and no text input fields.

Parameters:
message - the message to display

TextInputAlertWindow

public TextInputAlertWindow(CharSequence message)
Construct an instance with the given message. The alert will have APP_DIALOG_STYLE, a cancel button, no bitmap, and no text input fields.

Parameters:
message - the message to display

TextInputAlertWindow

public TextInputAlertWindow(int windowStyle,
                            String message)
Construct an instance with the given message and style. The alert will a cancel button, no bitmap, and no text input fields.

Parameters:
windowStyle - the window style to use. This should be one of APP_DIALOG_STYLE, APP_ALERT_STYLE, SYSTEM_DIALOG_STYLE, or SYSTEM_ERROR_STYLE. See DialogWindow.setWindowStyle(int) for a description of the styles.
message - the message to display

TextInputAlertWindow

public TextInputAlertWindow(int windowStyle,
                            CharSequence message)
Construct an instance with the given message and style. The alert will a cancel button, no bitmap, and no text input fields.

Parameters:
windowStyle - the window style to use. This should be one of APP_DIALOG_STYLE, APP_ALERT_STYLE, SYSTEM_DIALOG_STYLE, or SYSTEM_ERROR_STYLE. See DialogWindow.setWindowStyle(int) for a description of the styles.
message - the message to display

TextInputAlertWindow

public TextInputAlertWindow(int windowStyle,
                            String message,
                            boolean showCancel)
Construct an instance with the given message and style. The alert will no bitmap and no text input fields.

Parameters:
windowStyle - the window style to use. This should be one of APP_DIALOG_STYLE, APP_ALERT_STYLE, SYSTEM_DIALOG_STYLE, or SYSTEM_ERROR_STYLE. See DialogWindow.setWindowStyle(int) for a description of the styles.
message - the message to display
showCancel - whether the alert should include a cancel button

TextInputAlertWindow

public TextInputAlertWindow(int windowStyle,
                            CharSequence message,
                            boolean showCancel)
Construct an instance with the given message and style. The alert will no bitmap and no text input fields.

Parameters:
windowStyle - the window style to use. This should be one of APP_DIALOG_STYLE, APP_ALERT_STYLE, SYSTEM_DIALOG_STYLE, or SYSTEM_ERROR_STYLE. See DialogWindow.setWindowStyle(int) for a description of the styles.
message - the message to display
showCancel - whether the alert should include a cancel button
Method Detail

addTextField

public boolean addTextField(String inLabel,
                            String defaultText,
                            int inMaxChar,
                            boolean isPassword)
Set the text field for the alert window. This method creates a text field in the alert window. Up to three text fields can be added per alert window. The text parameter specifies the initial text to be displayed in the field. The inMaxChar parameter specifies the maximum length for the text entered into the field. The isPassword parameter specifies whether or not the text should be protected. If true, an asterisk is displayed for each character actually entered into the field.

Parameters:
inLabel - A string for the label of the text field.
defaultText - A String containing the initial text to be displayed.
inMaxChar - An int specifying the maximum number of characters that can be entered into the field.
isPassword - A boolean specifying whether or not the text should be protected.
Returns:
false if there are already three text fields and the new one could therefore not be added

addTextField

public boolean addTextField(CharSequence inLabel,
                            CharSequence defaultText,
                            int inMaxChar,
                            boolean isPassword)
Set the text field for the alert window. This method creates a text field in the alert window. Up to three text fields can be added per alert window. The text parameter specifies the initial text to be displayed in the field. The inMaxChar parameter specifies the maximum length for the text entered into the field. The isPassword parameter specifies whether or not the text should be protected. If true, an asterisk is displayed for each character actually entered into the field.

Parameters:
inLabel - A string for the label of the text field.
defaultText - A String containing the initial text to be displayed.
inMaxChar - An int specifying the maximum number of characters that can be entered into the field.
isPassword - A boolean specifying whether or not the text should be protected.
Returns:
false if there are already three text fields and the new one could therefore not be added

addTextField

public boolean addTextField(String inLabel,
                            String defaultText,
                            int inMaxChar,
                            boolean isPassword,
                            boolean disabled)
Set the text field for the alert window. This method creates a text field in the alert window. Up to three text fields can be added per alert window. The text parameter specifies the initial text to be displayed in the field. The inMaxChar parameter specifies the maximum length for the text entered into the field. The isPassword parameter specifies whether or not the text should be protected. If true, an asterisk is displayed for each character actually entered into the field.

Parameters:
inLabel - A string for the label of the text field.
defaultText - A String containing the initial text to be displayed.
inMaxChar - An int specifying the maximum number of characters that can be entered into the field.
isPassword - A boolean specifying whether or not the text should be protected.
disabled - A boolean specifying whether or not the text field should be disabled.
Returns:
false if there are already three text fields and the new one could therefore not be added

addTextField

public boolean addTextField(CharSequence inLabel,
                            CharSequence defaultText,
                            int inMaxChar,
                            boolean isPassword,
                            boolean disabled)
Set the text field for the alert window. This method creates a text field in the alert window. Up to three text fields can be added per alert window. The text parameter specifies the initial text to be displayed in the field. The inMaxChar parameter specifies the maximum length for the text entered into the field. The isPassword parameter specifies whether or not the text should be protected. If true, an asterisk is displayed for each character actually entered into the field.

Parameters:
inLabel - A string for the label of the text field.
defaultText - A String containing the initial text to be displayed.
inMaxChar - An int specifying the maximum number of characters that can be entered into the field.
isPassword - A boolean specifying whether or not the text should be protected.
disabled - A boolean specifying whether or not the text field should be disabled.
Returns:
false if there are already three text fields and the new one could therefore not be added

addTextField

public boolean addTextField(String inLabel,
                            String defaultText,
                            int inMaxChar,
                            boolean isPassword,
                            boolean disabled,
                            int id)
Set the text field for the alert window. This method creates a text field in the alert window. Up to three text fields can be added per alert window. The text parameter specifies the initial text to be displayed in the field. The inMaxChar parameter specifies the maximum length for the text entered into the field. The isPassword parameter specifies whether or not the text should be protected. If true, an asterisk is displayed for each character actually entered into the field. PLEASE NOTE: Before you call this method, you must call Window.setMaxChildID(int) with a value larger than or equal to the largest id you intend to use for this window.

Parameters:
inLabel - A string for the label of the text field.
defaultText - A String containing the initial text to be displayed.
inMaxChar - An int specifying the maximum number of characters that can be entered into the field.
isPassword - A boolean specifying whether or not the text should be protected.
disabled - A boolean specifying whether or not the text field should be disabled.
id - the id associated with this text field. This id can be used in later methods such as DialogWindow.disableButtonOnEmptyField(int, int), getTextFieldWithID(int), and getTextFieldValue(danger.app.IPCMessage, int).
Returns:
false if there are already three text fields and the new one could therefore not be added

addTextField

public boolean addTextField(CharSequence inLabel,
                            CharSequence defaultText,
                            int inMaxChar,
                            boolean isPassword,
                            boolean disabled,
                            int id)
Set the text field for the alert window. This method creates a text field in the alert window. Up to three text fields can be added per alert window. The text parameter specifies the initial text to be displayed in the field. The inMaxChar parameter specifies the maximum length for the text entered into the field. The isPassword parameter specifies whether or not the text should be protected. If true, an asterisk is displayed for each character actually entered into the field. PLEASE NOTE: Before you call this method, you must call Window.setMaxChildID(int) with a value larger than or equal to the largest id you intend to use for this window.

Parameters:
inLabel - A string for the label of the text field.
defaultText - A String containing the initial text to be displayed.
inMaxChar - An int specifying the maximum number of characters that can be entered into the field.
isPassword - A boolean specifying whether or not the text should be protected.
disabled - A boolean specifying whether or not the text field should be disabled.
id - the id associated with this text field. This id can be used in later methods such as DialogWindow.disableButtonOnEmptyField(int, int), getTextFieldWithID(int), and getTextFieldValue(danger.app.IPCMessage, int).
Returns:
false if there are already three text fields and the new one could therefore not be added

addTextField

public TextField addTextField(String inLabel,
                              int inMaxChar,
                              boolean isPassword,
                              int id)
Set the text field for the alert window. This method creates a text field in the alert window. Up to three text fields can be added per alert window. The inMaxChar parameter specifies the maximum length for the text entered into the field. The isPassword parameter specifies whether or not the text should be protected. If true, an asterisk is displayed for each character actually entered into the field.

Parameters:
inLabel - A string for the label of the text field.
inMaxChar - An int specifying the maximum number of characters that can be entered into the field.
isPassword - A boolean specifying whether or not the text should be protected.
id - the id associated with this text field. This id can be used in later methods such as DialogWindow.disableButtonOnEmptyField(int, int), getTextFieldWithID(int), and getTextFieldValue(danger.app.IPCMessage, int).
Returns:
the text field; null if there were already three text fields added and a new one could not be added

addTextField

public TextField addTextField(CharSequence inLabel,
                              int inMaxChar,
                              boolean isPassword,
                              int id)
Set the text field for the alert window. This method creates a text field in the alert window. Up to three text fields can be added per alert window. The inMaxChar parameter specifies the maximum length for the text entered into the field. The isPassword parameter specifies whether or not the text should be protected. If true, an asterisk is displayed for each character actually entered into the field.

Parameters:
inLabel - A string for the label of the text field.
inMaxChar - An int specifying the maximum number of characters that can be entered into the field.
isPassword - A boolean specifying whether or not the text should be protected.
id - the id associated with this text field. This id can be used in later methods such as DialogWindow.disableButtonOnEmptyField(int, int), getTextFieldWithID(int), and getTextFieldValue(danger.app.IPCMessage, int).
Returns:
the text field; null if there were already three text fields added and a new one could not be added

setGSMPINPUKMode

public void setGSMPINPUKMode(boolean gsmMode)
For internal use only.


getMaxMessageHeight

protected int getMaxMessageHeight()
Returns the maximum message height (in pixels).

Overrides:
getMaxMessageHeight in class AlertWindow
Returns:
the maximum height than can be used for the message

layoutTextField

protected int layoutTextField(int textColLeft,
                              int textColWidth,
                              int windowHeight)
Lays out the text fields. Generally, you will not have to call or override this method.

Parameters:
textColLeft - the left edge of the text fields
textColWidth - the maximum width of the text fields
windowHeight - the top edge of the first text field

layout

protected boolean layout()
Lays out the alert. Generally, you will not have to call or override this method. It is called automatically in AlertWindow.showInternal().

Overrides:
layout in class AlertWindow
Returns:
this method always returns true

eventKeyDown

public boolean eventKeyDown(char c,
                            Event event)
Description copied from class: View
This method is called when the user presses a key. The default implementation turns space and @ into page-down and page-up events if you have View.setAtAndSpacePage(boolean).

Overrides:
eventKeyDown in class Container
See Also:
Container.eventKeyDown(char, danger.app.Event)

receiveEvent

public boolean receiveEvent(Event e)
Receive an event from the alert window. Called whenever the alert window receives an event. The default behavior is to create and send an event to the listener for the alert window. Override this method to receive and process the events yourself.

Overrides:
receiveEvent in class AlertWindow
Parameters:
e - An Event containing the event received.
Returns:
whether (true) or not (false) this method actually handled the event to completion
See Also:
Listener.receiveEvent(danger.app.Event)

getTextFieldWithID

public TextField getTextFieldWithID(int id)
Returns the text field with the given id, or null if no such field exists.

Parameters:
id - the id of the text field. This may be an id specified in a resource file, or specified in a call to addTextField(java.lang.String, java.lang.String, int, boolean).

getDescendantWithID

public View getDescendantWithID(int id)
Description copied from class: DialogWindow
Get the descendant view with the given id. This will return the descendant with the given id, as long as that descendant has been added to this window or a descendant of this window, with a call to Container.addChild(danger.ui.View). It will also return a frame button with the given id, even if that button has not yet been automatically added with Container.addChild(danger.ui.View). Returns null if there is no descendant with the given id.

Overrides:
getDescendantWithID in class DialogWindow
Parameters:
id - the id of the descendant to obtain
Returns:
the descendant view with the given id
See Also:
Container.getChildWithID(int)

setTextField

public void setTextField(int id,
                         String value)
Sets the text in the text field with the given id. The text replaces any text currently in the text field. Does nothing if no such text field exists.

Parameters:
id - the id of the text field. This may be an id specified in a resource file, or specified in a call to addTextField(java.lang.String, java.lang.String, int, boolean).
value - the text to put into the text field.

setTextField

public void setTextField(int id,
                         CharSequence value)
Sets the text in the text field with the given id. The text replaces any text currently in the text field. Does nothing if no such text field exists.

Parameters:
id - the id of the text field. This may be an id specified in a resource file, or specified in a call to addTextField(java.lang.String, java.lang.String, int, boolean).
value - the text to put into the text field.

enableTextField

public void enableTextField(int id,
                            boolean enable)
Enables or disables the text field with the given id. Does nothing if no such text field exists.

Parameters:
id - the id of the text field. This may be an id specified in a resource file, or specified in a call to addTextField(java.lang.String, java.lang.String, int, boolean).
enable - true if the text field should be enabled, false otherwise.

getTextFieldValue

public static String getTextFieldValue(IPCMessage ipcMsg,
                                       int id)
Returns the text in the text field with the given id. When one of the alert buttons is selected, or a key is pressed, a text input alert will send an event containing an IPCMessage in the event's argument field. To obtain the text in the text fields, use this method.

Parameters:
ipcMsg - the event argument of the event sent from a text input alert
id - the id of the text field. This may be an id specified in a resource file, or specified in a call to addTextField(java.lang.String, java.lang.String, int, boolean).