Behaviour
Displays a label in front of the text contents. If the contents occupy more
than one line the text will flow around the label. The caret position is
behaves as if it were between characters in the text contents, however it
appears as a full inverted box on the character immediately following the
caret.

The trackwheel moves the focus caret in the major direction (usually
vertical), and using alt+trackwheel will move the focus caret in a less
significant direction (usually horizontal).

If this field is Field.EDITABLE, typing inserts text into the
contents at the caret position. The BACKSPACE character removes the
character prior to the caret, and the DELETE character removes the
character after the caret. Some subclasses of this may choose to support
special symbols: typing a Sym brings up the symbol screen from which
the user can select a symbol. Depending on the keyboard Sym could alternatively
be Alt+Space or Alt+ZX.

Select Mode
In select mode, the selection is first anchored to a caret position, and
moving the caret selects the text between the caret and the anchor. The
following table summarizes the keystroke behaviour in select mode.

keystroke

action taken

backspace

nothing

alt+backspace

nothing

shift+backspace

nothing

delete

delete

alt+delete

delete

shift+delete

cut

escape

exit selection mode

alt+click

copy

shift+click

paste

shift+scroll

select word

When not in select mode, these keystrokes should provide cut and paste
functionality:

keystroke

action taken

alt+click

enter select mode

shift+click

paste

shift+roll

enter select mode and select word

Field Summary

static long

FILTER_DEFAULT
A style that causes a default text input filter to be used.

static long

FILTER_EMAIL
A style that causes an email text input filter to be used.

FILTER_EMAIL

FILTER_NUMERIC

public static final long FILTER_NUMERIC

A style that causes a numeric text input filter to be used.
Accepts input of the form [0-9]*

In other words, it accepts any combination of numeric characters. This constant
represents a style that enables a BasicEditField to use a TextFilter.NUMERIC object
to filter text. This is equivalent to invoking this field's setFilter() method with
a TextFilter.NUMERIC as the parameter.

onUnfocus

protected void onUnfocus()

Invoked when a field loses the focus.

The method will not be invoked if this field does not already have
the focus.

By default, this method clears the muddy bit and removes selection.
If your custom field requires special handling upon losing the focus, you
must override this method. Don't forget to call super.onUnFocus() though
or the muddy bit won't get cleared.

backspace

This method ignores the current selection and deletes a number of
characters to the left of the current cursor position. If this method
runs into the beginning of this field's editable value, it deletes as
many characters as possible.

backspace

Deletes specified number of characters to the left of the cursor, with
indication of source of this action.

This method ignores the current selection and deletes a number of
characters to the left of the current cursor position. If this method
runs into the beginning of this field's editable value, it deletes as
many characters as possible.

You can specify whether this method was invoked programmatically, or
as an event prompted by the user.

insert

This method attempts to insert your specified string 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

This method attempts to insert your specified string 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.

moveFocus

This field's manager invokes this method to prompt this field to
handle a focus move event. If the event is an ALT-roll, then focus
movement happens horizontally (character by character for trackwheel,
begin/end of line for trackball); otherwise, focus
movement happens vertically (line by line for trackwheel, page by page
for trackball).

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