|
|||||||||
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.TextFieldBase
net.rim.device.api.input.InputHelperBase
net.rim.device.api.input.InputHelper
net.rim.device.api.input.EmailAddressInputHelper
public class EmailAddressInputHelper
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.input.InputHelperBase |
---|
CONSUME_INPUT, NO_NEWLINE |
Constructor Summary | ||
---|---|---|
EmailAddressInputHelper(String label,
String initialValue)
Constructs an EmailAddressEditField object. |
||
EmailAddressInputHelper(String label,
String initialValue,
int maxNumChars)
Constructs a smaller EmailAddressEditField object. |
||
EmailAddressInputHelper(String label,
String initialValue,
int maxNumChars,
long style)
Constructs an EmailAddressEditField object with a given set of style flags. |
Method Summary | ||
---|---|---|
boolean |
backspace()
Deletes character to the left of the cursor, or deletes selection. |
|
int |
insert(String text,
int context)
Inserts string into this field. |
|
boolean |
keyChar(char key,
int status,
int time)
Does special handling for SPACE character generation. |
Methods inherited from class net.rim.device.api.input.InputHelper |
---|
getLookupProperties, getVariantIterator, notifyLookupPropertiesChanged |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.rim.device.api.im.ITextInputStyle |
---|
getPreferredInputLocale, getTextInputStyle, isEditable, isUnicodeInputAllowed, updateInputStyle |
Constructor Detail |
---|
public EmailAddressInputHelper(String label, String initialValue)
This method builds an editable email-address field that can hold up to
EditField#DEFAULT_MAXCHARS
characters.
label
- Label for this field.initialValue
- Initial text to show in the editable portion of this
field.public EmailAddressInputHelper(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 EmailAddressInputHelper(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 |
---|
public boolean backspace()
If this method backspaces (and removes) an at symbol (@), it temporarily turns off replacing spaces with the at symbol.
backspace
in class InputHelperBase
public 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 InputHelperBase
key
- Character generated by the event.status
- Modifier key status.time
- Ticks since device reset.
public 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 InputHelperBase
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal