|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.Field
net.rim.device.api.ui.component.TextField
net.rim.device.api.ui.component.BasicEditField
net.rim.device.api.ui.component.EditField
net.rim.device.api.ui.component.EmailAddressEditField
public class EmailAddressEditField
An editable text field designed specifically to handle internet email addresses.
Behaviour
This field replaces the first space you type with the at symbol (@), and
replaces any subsequent space you type with a period. In addition, this field
does validation on text entered, and permits only characters that are valid
in an internet email address.
Field Summary |
---|
Fields inherited from class net.rim.device.api.ui.component.BasicEditField |
---|
FILTER_DEFAULT, FILTER_EMAIL, FILTER_FILENAME, FILTER_HEXADECIMAL, FILTER_INTEGER, FILTER_LOWERCASE, FILTER_NUMERIC, FILTER_PHONE, FILTER_PIN_ADDRESS, FILTER_REAL_NUMERIC, FILTER_UPPERCASE, FILTER_URL |
Fields inherited from class net.rim.device.api.ui.component.TextField |
---|
CONSUME_INPUT, DEFAULT_MAXCHARS, JUMP_FOCUS_AT_END, NO_COMPLEX_INPUT, NO_EDIT_MODE_INPUT, NO_LEARNING, NO_NEWLINE, NO_SWITCHING_INPUT |
Constructor Summary | ||
---|---|---|
EmailAddressEditField(String label,
String initialValue)
Constructs an EmailAddressEditField object. |
||
EmailAddressEditField(String label,
String initialValue,
int maxNumChars)
Constructs a smaller EmailAddressEditField object. |
||
EmailAddressEditField(String label,
String initialValue,
int maxNumChars,
long style)
Constructs an EmailAddressEditField object with a given set of style flags. |
Method Summary | ||
---|---|---|
protected boolean |
backspace()
Deletes character to the left of the cursor, or deletes selection. |
|
protected boolean |
insert(char key,
int status)
Inserts character into this field with modifier key status. |
|
protected int |
insert(String text,
int context)
Inserts string into this field. |
|
protected boolean |
keyChar(char key,
int status,
int time)
Does special handling for SPACE character generation. |
Methods inherited from class net.rim.device.api.ui.component.EditField |
---|
isEnteringRollerCharacter, keyDown, keyRepeat, moveFocus |
Methods inherited from class net.rim.device.api.ui.component.BasicEditField |
---|
backspace, backspace, charAt, clear, displayFieldFullMessage, drawFocus, getAccessibleContext, getCursorPosition, getFilter, getLabel, getLabelLength, getMaxSize, getPreferredHeight, getPreferredWidth, getText, getText, getText, getTextAbstractString, getTextLength, insert, isSymbolScreenAllowed, keyControl, layout, makeContextMenu, moveFocus, onUnfocus, paint, paste, selectionDelete, setCursorPosition, setCursorPosition, setFilter, setFont, setLabel, setMaxSize, setText, setText, update, wipe |
Methods inherited from class net.rim.device.api.ui.component.TextField |
---|
drawText, fieldChangeNotify, getFocusRect, isPasteable, isSelectable, isSelecting, isSelectionCopyable, isSelectionDeleteable, navigationClick, navigationUnclick, onFocus, select, selectionCopy, toString, touchEvent |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.rim.device.api.im.ITextInputStyle |
---|
getPreferredInputLocale, getTextInputStyle, isEditable, isUnicodeInputAllowed, updateInputStyle |
Constructor Detail |
---|
public EmailAddressEditField(String label, String initialValue)
This method builds an editable email-address field that can hold up to
TextField.DEFAULT_MAXCHARS
characters.
label
- Label for this field.initialValue
- Initial text to show in the editable portion of this
field.public EmailAddressEditField(String label, String initialValue, int maxNumChars)
This method builds an editable email-address field that can hold a number of characters up to the amount you specify.
label
- Label for this field.initialValue
- Initial text to show in the editable portion of this
field.maxNumChars
- Maximum number of characters this field can hold.public EmailAddressEditField(String label, String initialValue, int maxNumChars, long style)
label
- Label for this field.initialValue
- Initial text to show in the editable portion of this
field.maxNumChars
- Maximum number of characters this field can hold.style
- Field style bitsMethod Detail |
---|
protected boolean backspace()
If this method backspaces (and removes) an at symbol (@), it temporarily turns off replacing spaces with the at symbol.
backspace
in class BasicEditField
protected boolean keyChar(char key, int status, int time)
If the user types SHIFT+SPACE, then this method traps that event and forces the insertion of a literal space character, rather than the usual space translation provided by default (see class description).
keyChar
in class BasicEditField
key
- Character generated by the event.status
- Modifier key status.time
- Ticks since device reset.
protected int insert(String text, int context)
This method attempts to insert your specified string at the current cursor position. If this method (even partially) succeeds with the insertion, it then moves the cursor to just after the last character successfully inserted.
If the maximum size of the field is exceeded while inserting the string, as many characters as possible are inserted.
insert
in class BasicEditField
text
- String to insert; if the provided string starts with a
"mailto:" protocol specifier, this is stripped so only the pure email
address is inserted.context
- Information describing the origin of the change.
protected boolean insert(char key, int status)
TextField
This method attempts to insert your specified character at the current cursor position. If this method succeeds with the insertion, it then moves the cursor to just after the inserted character.
insert
in class TextField
key
- Character to insert.status
- Modifier key status.
TextField.insert(java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.