|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.app.Listener
danger.ui.View
danger.ui.Container
danger.ui.Window
danger.ui.DialogWindow
danger.ui.AlertWindow
danger.ui.TextInputAlertWindow
public class TextInputAlertWindow
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.Window |
|---|
mBusyPaintCount, mDefaultListener, STATE_AUTO_HIDE_IF_IDLE, STATE_DROP_ORPHANED_EVENTS, STATE_FULLSCREEN, STATE_UNUSED1 |
| 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.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 |
|---|
protected TextField mTextField1
protected TextField mTextField2
protected TextField mTextField3
protected int m_fieldID1
protected int m_fieldID2
protected int m_fieldID3
protected StaticText mTextFieldLabel1
protected StaticText mTextFieldLabel2
protected StaticText mTextFieldLabel3
protected int mTextFieldMaxChar1
protected int mTextFieldMaxChar2
protected int mTextFieldMaxChar3
protected boolean mGSMMode
public static final int GAP1
public static final int GAP4
| Constructor Detail |
|---|
public TextInputAlertWindow()
public TextInputAlertWindow(String message)
message - the message to displaypublic TextInputAlertWindow(CharSequence message)
message - the message to display
public TextInputAlertWindow(int windowStyle,
String message)
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
public TextInputAlertWindow(int windowStyle,
CharSequence message)
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
public TextInputAlertWindow(int windowStyle,
String message,
boolean showCancel)
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 displayshowCancel - whether the alert should include a cancel button
public TextInputAlertWindow(int windowStyle,
CharSequence message,
boolean showCancel)
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 displayshowCancel - whether the alert should include a cancel button| Method Detail |
|---|
public boolean addTextField(String inLabel,
String defaultText,
int inMaxChar,
boolean isPassword)
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.
public boolean addTextField(CharSequence inLabel,
CharSequence defaultText,
int inMaxChar,
boolean isPassword)
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.
public boolean addTextField(String inLabel,
String defaultText,
int inMaxChar,
boolean isPassword,
boolean disabled)
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.
public boolean addTextField(CharSequence inLabel,
CharSequence defaultText,
int inMaxChar,
boolean isPassword,
boolean disabled)
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.
public boolean addTextField(String inLabel,
String defaultText,
int inMaxChar,
boolean isPassword,
boolean disabled,
int id)
Window.setMaxChildID(int) with a value larger than or equal to
the largest id you intend to use for this window.
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).
public boolean addTextField(CharSequence inLabel,
CharSequence defaultText,
int inMaxChar,
boolean isPassword,
boolean disabled,
int id)
Window.setMaxChildID(int) with a value larger than or equal to
the largest id you intend to use for this window.
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).
public TextField addTextField(String inLabel,
int inMaxChar,
boolean isPassword,
int id)
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).
public TextField addTextField(CharSequence inLabel,
int inMaxChar,
boolean isPassword,
int id)
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).
public void setGSMPINPUKMode(boolean gsmMode)
protected int getMaxMessageHeight()
getMaxMessageHeight in class AlertWindow
protected int layoutTextField(int textColLeft,
int textColWidth,
int windowHeight)
textColLeft - the left edge of the text fieldstextColWidth - the maximum width of the text fieldswindowHeight - the top edge of the first text fieldprotected boolean layout()
AlertWindow.showInternal().
layout in class AlertWindow
public boolean eventKeyDown(char c,
Event event)
ViewView.setAtAndSpacePage(boolean).
eventKeyDown in class ContainerContainer.eventKeyDown(char, danger.app.Event)public boolean receiveEvent(Event e)
receiveEvent in class AlertWindowe - An Event containing the event received.
true) or not (false) this
method actually handled the event to completionListener.receiveEvent(danger.app.Event)public TextField getTextFieldWithID(int id)
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).public View getDescendantWithID(int id)
DialogWindowContainer.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.
getDescendantWithID in class DialogWindowid - the id of the descendant to obtain
Container.getChildWithID(int)
public void setTextField(int id,
String value)
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.
public void setTextField(int id,
CharSequence value)
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.
public void enableTextField(int id,
boolean enable)
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.
public static String getTextFieldValue(IPCMessage ipcMsg,
int id)
ipcMsg - the event argument of the event sent from a text
input alertid - 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).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||