Active AutoText edit field
Use an active AutoText edit field to check for patterns in text that a BlackBerry® device user types in the field. When a pattern is found, the text becomes active and the user can click on the active text to access special menu items. For example, email addresses and phone numbers are two of the patterns that are recognized by default.
In addition, when the user presses the Space key, text is corrected based on the AutoText definition list, which lists common typographic errors and corrections.
| Classes | ActiveAutoTextEditField |
| Supported since | BlackBerry® Java® SDK 5.0 |
| Example |
|
For more information about active autocomplete text fields, see the UI Guidelines.
Code sample: Creating an active AutoText edit field
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.component.ActiveAutoTextEditField;
public class ActiveAutoTextEditFieldDemo extends UiApplication
{
public static void main(String[] args)
{
ActiveAutoTextEditFieldDemo theApp = new ActiveAutoTextEditFieldDemo();
theApp.enterEventDispatcher();
}
public ActiveAutoTextEditFieldDemo()
{
pushScreen(new ActiveAutoTextEditFieldDemoScreen());
}
}
class ActiveAutoTextEditFieldDemoScreen extends MainScreen
{
public ActiveAutoTextEditFieldDemoScreen()
{
setTitle("Active AutoText Edit Field Demo");
ActiveAutoTextEditField myField = new ActiveAutoTextEditField("Send a message to Mike: \n \n", "");
add(myField);
}
}
Next topic: Choice fields
Previous topic: AutoText edit field