|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--net.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.AutoTextEditField
An editable text field designed to provide autotext support.
Behaviour
When a word is entered that is in the autotext database for the current
locale, this field replaces it, including any effects of macro
expansion. Pressing backspace when the caret is on the the most recent
autotext expansion reverses all effects of the autotext substitution.
| Field Summary |
| Fields inherited from class net.rim.device.api.ui.component.BasicEditField |
DEFAULT_MAXCHARS, FILTER_DEFAULT, FILTER_EMAIL, FILTER_HEXADECIMAL, FILTER_INTEGER, FILTER_LOWERCASE, FILTER_NUMERIC, FILTER_PHONE, FILTER_UPPERCASE, FILTER_URL, JUMP_FOCUS_AT_END, NO_NEWLINE |
| Fields inherited from class net.rim.device.api.ui.Field |
EDITABLE, EDITABLE_MASK, FIELD_BOTTOM, FIELD_HALIGN_MASK, FIELD_HCENTER, FIELD_LEFT, FIELD_RIGHT, FIELD_TOP, FIELD_VALIGN_MASK, FIELD_VCENTER, FOCUSABLE, FOCUSABLE_MASK, HIGHLIGHT_FOCUS, HIGHLIGHT_SELECT, NON_FOCUSABLE, READONLY, USE_ALL_HEIGHT, USE_ALL_WIDTH |
| Constructor Summary | ||
AutoTextEditField()
Constructs a default AutoTextEditField. |
||
AutoTextEditField(String label,
String initialValue)
Constructs an AutoTextEditField object. |
||
AutoTextEditField(String label,
String initialValue,
int maxNumChars,
long style)
Constructs a smaller AutoTextEditField object, of a given style. |
||
| 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. |
|
protected boolean |
keyChar(char key,
int status,
int time)
Traps key generation events. |
|
protected boolean |
keyDown(int keycode,
int time)
Handles symbol screen key sequences. |
|
protected boolean |
keyRepeat(int keycode,
int time)
Handles key repeat events. |
|
protected int |
moveFocus(int amount,
int status,
int time)
This field's manager invokes this method to prompt this field to handle a focus move event. |
|
protected void |
setText(String text,
int context)
Sets the text value for this field, with indication of the source of this action. |
|
protected void |
update(int delta)
Updates this field. |
|
| Methods inherited from class net.rim.device.api.ui.component.EditField |
isEnteringRollerCharacter |
| Methods inherited from class net.rim.device.api.ui.component.BasicEditField |
backspace, backspace, charAt, clear, displayFieldFullMessage, drawFocus, getCursorPosition, getFocusRect, getLabel, getLabelLength, getMaxSize, getPreferredHeight, getPreferredWidth, getText, getText, getTextAbstractString, getTextLength, insert, insert, isPasteable, isSelectable, isSelecting, isSelectionCopyable, isSelectionDeleteable, isSymbolScreenAllowed, keyControl, layout, makeContextMenu, moveFocus, onFocus, onUnfocus, onVisibilityChange, paint, paste, select, selectionCopy, selectionDelete, setCursorPosition, setCursorPosition, setFilter, setFont, setLabel, setMaxSize, setText, toString |
| Methods inherited from class net.rim.device.api.ui.Field |
drawHighlightRegion, fieldChangeNotify, focusAdd, focusRemove, getChangeListener, getContextMenu, getCookie, getExtent, getFieldStyle, getFocusListener, getFont, getHeight, getIndex, getLeafFieldWithFocus, getLeft, getManager, getOriginal, getScreen, getStyle, getTop, getWidth, invalidate, invalidate, isDirty, isEditable, isFocusable, isMuddy, isSelectionCutable, isVisible, keyStatus, keyUp, selectionCut, setChangeListener, setCookie, setDirty, setEditable, setExtent, setFocus, setFocusListener, setMuddy, setPosition, trackwheelClick, trackwheelUnclick, updateLayout |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
| Constructor Detail |
public AutoTextEditField()
public AutoTextEditField(String label, String initialValue)
This method builds an editable autotext field that can hold up to
BasicEditField.DEFAULT_MAXCHARS.
label - Label for this field.initialValue - Initial text to show in the buffer.public AutoTextEditField(String label, String initialValue, int maxNumChars, long style)
This method builds an autotext field of a specified style, 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 buffer.maxNumChars - Maximum number of characters this field can hold.style - Styles to apply to this field (for an editable field,
specify the style Field.EDITABLE.| Method Detail |
protected boolean backspace()
If some characters are currently selected, this method deletes the selection as if it were a single character.
If no characters were 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.
If the last key pressed generated an autotext replacement, this method undoes that replacement.
backspace in class BasicEditField
protected boolean insert(char key,
int status)
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.
If inserting the character would trigger an autotext expansion, then this method attempts to perform that insertion instead.
insert in class BasicEditFieldkey - Character to insert.
protected boolean keyChar(char key,
int status,
int time)
This field's manager invokes this event to handle all key generation
events, except for the special symbol screen event (triggered with
ALT+SPACE) which is handled by keyDown(int, int).
This method consumes all key events, except in the following cases:
BasicEditField.NO_NEWLINE, and the ENTER key was pressed.
EDITABLE (exception: if in
select mode, and the ENTER key was pressed).
keyChar in class BasicEditFieldkey - Character generated by the event.status - Modifier key status.time - Ticks since device reset.
protected boolean keyDown(int keycode,
int time)
This method traps the ALT+SPACE key sequence, consumes the key generation event, and opens the symbol screen.
Note that, whatever key sequence is pressed, this method stores the keycode as the last key pressed, even if it doesn't handle the key press event (i.e. even if the key wasn't ALT+SPACE).
keycode - character generated by the event.time - Ticks since device reset.
protected boolean keyRepeat(int keycode,
int time)
This method behaves as follows:
keycode - Key held down.time - Ticks since device reset.
protected int moveFocus(int amount,
int status,
int time)
If a key is being held down while the user rolls the track wheel, and that key supports rolling character selection, then this method does not move the focus but instead uses the move amount to do rolling character selection. In this case, the method always consumes the entire roll amount and returns zero.
Prior to invoking this method, this field's manager invokes
Field.focusRemove(). After invoking this method, the framework
invokes Field.focusAdd(boolean). This method also clears this field's
muddy state (but only if the focus actually gets moved).
amount - The number of trackwheel positions to handle. A negative
value indicates the focus entered from the bottom of this field; a
positive value, that the focus came from the top.status - Modifier key status.time - Ticks since device reset.protected void setText(String text, int context)
setText in class BasicEditFieldtext - New text for this field's buffer; if null, this method clears
the field.context - Information specifying the origin of the change.protected void update(int delta)
This field's manager invokes this method to prompt this field to update itself. When invoked, this field determines the affected region's new line lengths, adjusts the master line length array, adjusts the focus, and resizes this field (if necessary).
update in class BasicEditFielddelta - Number of characters by which this field has changed,
negative or positive (negative means that many characters have been
added).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.