|
|||||||||
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.AutoTextInputHelper
public class AutoTextInputHelper
Enriches the input helper with the autotext features which are: auto-capitalization, auto-period, and auto-substitution.
Field Summary | ||
---|---|---|
static long |
AUTOCAP
Do automatic capitalization based on preceding punctuation. |
|
static long |
AUTOCAP_OFF
Do no automatic capitalization based on preceding punctuation. |
|
static long |
AUTOPERIOD
Do automatic period insertion after two spaces. |
|
static long |
AUTOPERIOD_OFF
Do no automatic period insertion after two spaces. |
|
static long |
AUTOREPLACE
Do autotext substitution on this field. |
|
static long |
AUTOREPLACE_OFF
Do no autotext substitution on this field. |
Fields inherited from class net.rim.device.api.input.InputHelperBase |
---|
CONSUME_INPUT, NO_NEWLINE |
Constructor Summary | ||
---|---|---|
AutoTextInputHelper()
Constructs an AutoTextInputHelper instance. |
||
AutoTextInputHelper(long inputStyle)
Constructs an AutoTextInputHelper instance. |
||
AutoTextInputHelper(Screen scr)
Constructs an AutoTextInputHelper instance. |
||
AutoTextInputHelper(Screen scr,
long inputStyle)
Constructs an AutoTextInputHelper instance with specified input style. |
Method Summary | ||
---|---|---|
boolean |
backspace()
Deletes character to the left of the cursor, or deletes selection. |
|
boolean |
keyChar(char key,
int status,
int time)
Traps key generation events. |
|
protected boolean |
keyDown(int keycode,
int time)
Handles key-down events. |
|
boolean |
keyRepeat(int keycode,
int time)
Handles key repeat events. |
|
protected void |
setText(String text,
int context)
Sets the text value for this field, with indication of the source of this action. |
|
void |
update(int delta)
Updates this edit field. |
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 |
Field Detail |
---|
public static final long AUTOREPLACE
public static final long AUTOREPLACE_OFF
public static final long AUTOCAP
public static final long AUTOCAP_OFF
public static final long AUTOPERIOD
public static final long AUTOPERIOD_OFF
Constructor Detail |
---|
public AutoTextInputHelper()
public AutoTextInputHelper(long inputStyle)
inputStyle
- Combination of field style bits to specify display and
filter attributes, e.g. BasicEditField.FILTER_NUMERIC, Field.EDITABLE, Field.FOCUSABLE.public AutoTextInputHelper(Screen scr)
scr
- Screen instance associated with this helper.public AutoTextInputHelper(Screen scr, long inputStyle)
scr
- Associated with this helper Screen instanceinputStyle
- Combination of field style bits to specify display and
filter attributes, e.g. BasicEditField.FILTER_NUMERIC, Field.EDITABLE, Field.FOCUSABLE.Method Detail |
---|
public boolean backspace()
InputHelperBase
If some characters are currently selected, this method deletes the selection as if it were a single character.
If no characters are selected, this method deletes the character immediately to the left of the cursor. If the cursor is currently on the first character in the field, this method does nothing.
backspace
in class InputHelperBase
TextFieldBase.backspace()
public boolean keyChar(char key, int status, int time)
InputHelperBase
This method, invoked by this field's manager, handles all key
generation events, except for the special symbol screen event (triggered
with ALT+SPACE) which is handled by Field.keyDown(int, int)
.
This method consumes all key events, except in the following cases:
InputHelperBase.NO_NEWLINE
), and the ENTER key was pressed. EDITABLE
(exception: if in
select mode, and the ENTER key was pressed).
keyChar
in class InputHelperBase
key
- Character generated by the event.status
- Modifier key status.time
- Number of milliseconds since the device was turned on.
TextFieldBase.keyChar( char key, int status, int time)
protected boolean keyDown(int keycode, int time)
Field
By default, this method returns false
. Custom fields
that specially handle key down events must override this method.
keyDown
in class Field
keycode
- The code of the key that was pressed.time
- The number of milliseconds since the device was turned on.
false
. Classes that extend Field
must
override this method to provide specific handling.Field.keyDown(int keycode, int time)
public boolean keyRepeat(int keycode, int time)
Field
By default, this method returns false
. Custom fields
that specially handle key repeat events must override this method.
keyRepeat
in class Field
keycode
- The code of the key that was repeated.time
- The number of milliseconds since the device was turned on.
false
. Classes that extend Field
must
override this method to provide specific handling.Field.keyRepeat(int keycode, int time)
protected void setText(String text, int context)
InputHelperBase
setText
in class InputHelperBase
text
- New string value for this field; if null, this method clears
the field.context
- Information specifying the origin of the change.TextFieldBase.setText(String text, int context)
public void update(int delta)
InputHelperBase
This field invokes this method when text is inserted or deleted so this field can update itself.
update
in class InputHelperBase
delta
- Number of characters by which the field has changed,
negative or positive (negative means that characters have been
deleted).TextFieldBase.update(int delta)
|
|||||||||
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