net.rim.device.api.ui.component
Class BasicEditField

java.lang.Object
  |
  +--net.rim.device.api.ui.Field
        |
        +--net.rim.device.api.ui.component.TextField
              |
              +--net.rim.device.api.ui.component.BasicEditField
All Implemented Interfaces:
FieldLabelProvider, Formatter.TextRenderer, IComponent, InputMethodListener, InputMethodRequests
Direct Known Subclasses:
EditField, PasswordEditField

public class BasicEditField
extends TextField

An editable simple text field with no formatting.

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+backsapce 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.
static long FILTER_FILENAME
          A style that causes a Filename input filter to be used.
static long FILTER_HEXADECIMAL
          A style that causes a hexadecimal text input filter to be used.
static long FILTER_INTEGER
          A style that causes an integer text input filter to be used.
static long FILTER_LOWERCASE
          A style that causes a lower case text input filter to be used.
static long FILTER_NUMERIC
          A style that causes a numeric text input filter to be used.
static long FILTER_PHONE
          A style that causes a phone text input filter to be used.
static long FILTER_PIN_ADDRESS
          A style that causes a PIN address text input filter to be used.
static long FILTER_REAL_NUMERIC
          A style that causes a real numeric text input filter to be used.
static long FILTER_UPPERCASE
          A style that causes an upper case text input filter to be used.
static long FILTER_URL
          A style that causes a URL text input filter to be used.
 
Fields inherited from class net.rim.device.api.ui.component.TextField
CONSUME_INPUT, DEFAULT_MAXCHARS, JUMP_FOCUS_AT_END, NO_COMPLEX_INPUT, NO_LEARNING, NO_NEWLINE
 
Fields inherited from class net.rim.device.api.ui.Field
ACTION_INVOKE, 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, STATUS_MOVE_FOCUS_HORIZONTALLY, STATUS_MOVE_FOCUS_VERTICALLY, USE_ALL_HEIGHT, USE_ALL_WIDTH
 
Constructor Summary
BasicEditField()
          Constructs an empty BasicEditField instance.
BasicEditField(long style)
          Constructs an empty BasicEditField instance of particular style.
BasicEditField(String label, String initialValue)
          Constructs an BasicEditField instance with label and initial contents.
BasicEditField(String label, String initialValue, int maxNumChars, long style)
          Constructs a smaller BasicEditField instance with label, initial contents, and particular style.
 
Method Summary
protected  boolean backspace()
          Deletes character to the left of the cursor, or deletes selection.
 int backspace(int count)
          Deletes specified number of characters to the left of the cursor.
protected  int backspace(int count, int context)
          Deletes specified number of characters to the left of the cursor, with indication of source of this action.
 char charAt(int offset)
          Retrieves the character at the specified offset.
 void clear(int context)
          Clears this field's contents.
protected  void displayFieldFullMessage()
          Displays a 'field full' message.
protected  void drawFocus(Graphics graphics, boolean on)
          Draws the focus indicator for this field.
 int getCursorPosition()
          Retrieves character offset for current cursor position in this field.
 TextFilter getFilter()
          Gets the text filter set for this field.
 String getLabel()
          Retrieves this field's label.
 int getLabelLength()
          Retrieves the length of this field's label The length returned includes any additional character appended for layout purposes.
 int getMaxSize()
          Retrieves the maximum number of characters allowed for this field's value.
 int getPreferredHeight()
          Retrieves this field's preferred height.
 int getPreferredWidth()
          Retrieves this field's preferred width.
 String getText()
          Retrieves this field's text, not including the label.
 String getText(int offset, int length)
          Retrieves a portion of this field's text.
 void getText(int srcBegin, int srcEnd, char[] dst, int dstBegin)
          Retrieves this field's text.
 AbstractString getTextAbstractString()
          Retrieves read-only handle to the underlying buffer.
 int getTextLength()
          Retrieves length of this field's text, not including the label.
 int insert(String text)
          Inserts string programmatically into this field.
protected  int insert(String text, int context)
          Inserts string into this field.
protected  boolean isSymbolScreenAllowed()
          Determines if this field supports use of the symbol screen.
protected  boolean keyChar(char key, int status, int time)
          Traps key generation events.
protected  boolean keyControl(char key, int status, int time)
          Handles control character generation events.
protected  boolean keyDown(int keycode, int time)
          Handles key down events.
protected  void layout(int width, int height)
          Lays out this field's contents.
protected  void makeContextMenu(ContextMenu contextMenu)
          Builds this field's context menu.
protected  int moveFocus(int amount, int status, int time)
          Handles moving focus within this field.
protected  void moveFocus(int x, int y, int status, int time)
          Handles moving the focus to an exact position within this field.
protected  void onUnfocus()
          Invoked when a field loses the focus.
protected  void paint(Graphics graphics)
          Redraws this field.
 boolean paste(Clipboard cb)
          Pastes text scrap into this field.
 void selectionDelete()
          Deletes character to the right of the cursor, or deletes selection.
 void setCursorPosition(int offset)
          Places cursor on specific character within this field, at user request.
protected  void setCursorPosition(int offset, int context)
          Places cursor on specific character within this field.
 void setFilter(TextFilter filter)
          Sets the text filter for this field.
 void setFont(Font font)
          Sets the font for this field and updates the display if necessary.
 void setLabel(String newLabel)
          Sets this field's label.
 void setMaxSize(int maxSize)
          Sets maximum number of characters allowed for this field's value.
 void setText(String text)
          Sets the text value for this field.
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 edit field.
 void wipe()
          Overwrites this field's unused contents.
 
Methods inherited from class net.rim.device.api.ui.component.TextField
drawText, getFocusRect, isPasteable, isSelectable, isSelecting, isSelectionCopyable, isSelectionDeleteable, navigationClick, navigationUnclick, onFocus, select, selectionCopy, toString
 
Methods inherited from class net.rim.device.api.ui.Field
drawHighlightRegion, fieldChangeNotify, focusAdd, focusRemove, getChangeListener, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFont, getHeight, getIndex, getLeafFieldWithFocus, getLeft, getManager, getOriginal, getScreen, getStyle, getTop, getWidth, invalidate, invalidate, invalidateAll, invokeAction, isDataValid, isDirty, isEditable, isFocus, isFocusable, isMuddy, isSelectionCutable, isStyle, isVisible, keyRepeat, keyStatus, keyUp, navigationMovement, onDisplay, onExposed, onMenuDismissed, onMenuDismissed, onObscured, onVisibilityChange, 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

FILTER_DEFAULT

public static final long FILTER_DEFAULT
A style that causes a default text input filter to be used.

FILTER_EMAIL

public static final long FILTER_EMAIL
A style that causes an email text input filter to be used.

Field accepts characters valid in an email address for input.


FILTER_FILENAME

public static final long FILTER_FILENAME
A style that causes a Filename input filter to be used.

Field accepts characters valid in a filename for FAT16 filesystem.

Since:
JDE 4.2.0

FILTER_HEXADECIMAL

public static final long FILTER_HEXADECIMAL
A style that causes a hexadecimal text input filter to be used.

Field accepts numeric characters and alpha characters a-f, A-F for input.


FILTER_INTEGER

public static final long FILTER_INTEGER
A style that causes an integer text input filter to be used. Accepts input of the form [-][0-9]*

In other words, it accepts an optional minus sign, followed by any combination of numeric characters.


FILTER_LOWERCASE

public static final long FILTER_LOWERCASE
A style that causes a lower case text input filter to be used.

Field accepts only lower case alpha characters for input. Upper case are converted into their lower case equivalents.


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.


FILTER_PHONE

public static final long FILTER_PHONE
A style that causes a phone text input filter to be used.

Field accepts numeric characters, the plus sign, minus sign, right and left parentheses, and the x character, for input.


FILTER_PIN_ADDRESS

public static final long FILTER_PIN_ADDRESS
A style that causes a PIN address text input filter to be used.

Field accepts characters valid in a PIN address for input.

Since:
JDE 4.0.0

FILTER_REAL_NUMERIC

public static final long FILTER_REAL_NUMERIC
A style that causes a real numeric text input filter to be used. Accepts input of the form [-][0-9.]*

In other words, it accepts an optional minus sign, followed by any combination of numeric characters and periods.

Since:
JDE 4.0.2

FILTER_UPPERCASE

public static final long FILTER_UPPERCASE
A style that causes an upper case text input filter to be used.

Field accepts only upper case alpha characters for input. Lower case characters are converted into their upper case equivalents.


FILTER_URL

public static final long FILTER_URL
A style that causes a URL text input filter to be used.

Field accepts characters valid in a URL for input.

Constructor Detail

BasicEditField

public BasicEditField()
Constructs an empty BasicEditField instance.

This method builds an empty, Field.EDITABLE edit field that has no label and can hold up to TextField.DEFAULT_MAXCHARS characters.


BasicEditField

public BasicEditField(long style)
Constructs an empty BasicEditField instance of particular style.

This method builds an empty edit field with a style that has no label and can hold up to TextField.DEFAULT_MAXCHARS characters.

Parameters:
style - Styles for this field (see Field for usable styles).

BasicEditField

public BasicEditField(String label,
                      String initialValue)
Constructs an BasicEditField instance with label and initial contents.

This method builds an Field.EDITABLE edit field with a specified label and initial contents that can hold up to TextField.DEFAULT_MAXCHARS characters.

Parameters:
label - Label for this field.
initialValue - Initial text to show in this field.

BasicEditField

public BasicEditField(String label,
                      String initialValue,
                      int maxNumChars,
                      long style)
Constructs a smaller BasicEditField instance with label, initial contents, and particular style.

This class's other constructors build an Field.EDITABLE field by default. Use this method to build an edit field with some other style.

Parameters:
label - Label for this field.
initialValue - Initial text to show in the field.
maxNumChars - Maximum number of characters this field can hold.
style - Styles for this field (see Field for usable styles).
Throws:
IllegalArgumentException - If maxNumChars is less than 1, or the initialValue argument is invalid given the style.
Method Detail

backspace

protected boolean backspace()
Description copied from class: TextField
Deletes character to the left of the cursor, or deletes selection.

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.

Overrides:
backspace in class TextField
See Also:
TextField.backspace(int)

backspace

public int backspace(int count)
Description copied from class: TextField
Deletes specified number of characters to the left of the cursor.

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.

Overrides:
backspace in class TextField
See Also:
TextField.backspace(int)

backspace

protected int backspace(int count,
                        int context)
Description copied from class: TextField
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.

Overrides:
backspace in class TextField
See Also:
TextField.backspace(int)

charAt

public char charAt(int offset)
Description copied from class: TextField
Retrieves the character at the specified offset.

Index zero is the first character position after this field's label.

Overrides:
charAt in class TextField
See Also:
TextField.charAt(int)

clear

public void clear(int context)
Description copied from class: TextField
Clears this field's contents.

Override this method if you want the default text to be non empty when the field is cleared. For example, a URLEditField might call setText("http://", context).

Overrides:
clear in class TextField
See Also:
TextField.clear(int)

displayFieldFullMessage

protected void displayFieldFullMessage()
Description copied from class: TextField
Displays a 'field full' message.
Overrides:
displayFieldFullMessage in class TextField
See Also:
TextField.displayFieldFullMessage()

drawFocus

protected void drawFocus(Graphics graphics,
                         boolean on)
Description copied from class: TextField
Draws the focus indicator for this field.

This field's manager invokes this method after painting the field, in order to overpaint the focus indicator. By default, this method simply inverts the pixels in the focus's extent.

Note that if currently selecting more than one character in this field, then the focus region occupies the entire extent of the selected text.

Overrides:
drawFocus in class TextField
Since:
JDE 3.7.0
See Also:
TextField.drawFocus(net.rim.device.api.ui.Graphics, boolean)

getCursorPosition

public int getCursorPosition()
Description copied from class: TextField
Retrieves character offset for current cursor position in this field.

This method does not include the label as part of its accounting (that is, a returned offset of zero means that the cursor is currently sitting on the first character in this field's value).

Overrides:
getCursorPosition in class TextField
See Also:
TextField.getCursorPosition()

getFilter

public TextFilter getFilter()
Description copied from class: TextField
Gets the text filter set for this field.
Overrides:
getFilter in class TextField
Since:
JDE 4.0.0
See Also:
TextField.getFilter()

getLabel

public String getLabel()
Description copied from class: TextField
Retrieves this field's label.
Overrides:
getLabel in class TextField
See Also:
TextField.getLabel()

getLabelLength

public int getLabelLength()
Description copied from class: TextField
Retrieves the length of this field's label

The length returned includes any additional character appended for layout purposes. Therefore the value may not be the same as #getLabel().length()

Overrides:
getLabelLength in class TextField
See Also:
TextField.getLabelLength()

getMaxSize

public int getMaxSize()
Description copied from class: TextField
Retrieves the maximum number of characters allowed for this field's value.

This method does not include this field's label as part of its accounting.

Overrides:
getMaxSize in class TextField
See Also:
TextField.getMaxSize()

getPreferredHeight

public int getPreferredHeight()
Description copied from class: TextField
Retrieves this field's preferred height.

Managers make use of this value during layout. Edit fields determine their preferred height based on the height of the font they're using to display their text contents.

Overrides:
getPreferredHeight in class TextField
See Also:
TextField.getPreferredHeight()

getPreferredWidth

public int getPreferredWidth()
Description copied from class: TextField
Retrieves this field's preferred width.

Managers make use of this value during layout. All editable fields to be as wide as possible. Non editable fields to be layed out with as little space as possible.

Overrides:
getPreferredWidth in class TextField
See Also:
TextField.getPreferredWidth()

getText

public String getText()
Description copied from class: TextField
Retrieves this field's text, not including the label.
Overrides:
getText in class TextField
See Also:
TextField#getText

getText

public String getText(int offset,
                      int length)
Description copied from class: TextField
Retrieves a portion of this field's text.

Provide a character offset and length to retrieve a substring of this field's contents.

Note: This method includes the label in the field's contents, so if you pass in an offset of zero, the first character returned is the first character of the label.

Note: Different system themes may modify the contents of the label.

Overrides:
getText in class TextField
See Also:
TextField#getText

getText

public void getText(int srcBegin,
                    int srcEnd,
                    char[] dst,
                    int dstBegin)
Description copied from class: TextField
Retrieves this field's text.

Note: This method adjusts for the label in the field's contents, so the srcBegin and srcEnd parameters decribe the field's actual contents.

Overrides:
getText in class TextField
Since:
JDE 4.0.0
See Also:
TextField#getText

getTextAbstractString

public AbstractString getTextAbstractString()
Description copied from class: TextField
Retrieves read-only handle to the underlying buffer.

Note: The underlying buffer can be modified by this field if methods such as TextField.insert(java.lang.String) or TextField.selectionDelete() are invoked.

Overrides:
getTextAbstractString in class TextField
See Also:
TextField.getTextAbstractString()

getTextLength

public int getTextLength()
Description copied from class: TextField
Retrieves length of this field's text, not including the label.
Overrides:
getTextLength in class TextField
See Also:
TextField.getTextLength()

insert

public int insert(String text)
Description copied from class: TextField
Inserts string programmatically into this field.

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.

Note: use this method for programmatic changes to this field; be default, this method simply invokes insert(yourString,FieldChangeListener.PROGRAMMATIC).

Overrides:
insert in class TextField
See Also:
TextField.insert(java.lang.String)

insert

protected int insert(String text,
                     int context)
Description copied from class: TextField
Inserts string into this field.

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.

Overrides:
insert in class TextField
See Also:
TextField.insert(java.lang.String)

isSymbolScreenAllowed

protected boolean isSymbolScreenAllowed()
Description copied from class: TextField
Determines if this field supports use of the symbol screen.

Use this method to determine if this field supports the symbol screen (all edit fields do by default). The user can press ALT+SPACE to show the symbol screen.

Overrides:
isSymbolScreenAllowed in class TextField
See Also:
TextField.isSymbolScreenAllowed()

keyChar

protected boolean keyChar(char key,
                          int status,
                          int time)
Description copied from class: TextField
Traps key generation events.

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:

  • This field does not accept new lines (was built with TextField.NO_NEWLINE), and the ENTER key was pressed.
  • This field is not EDITABLE (exception: if in select mode, and the ENTER key was pressed).
  • The BACKSPACE key was pressed while the cursor was over the first character in the field.
  • The ESCAPE key was pressed.
  • This method attempted to insert a typed character into this field, and the insertion failed.
Overrides:
keyChar in class TextField
See Also:
TextField.keyChar(char, int, int)

keyControl

protected boolean keyControl(char key,
                             int status,
                             int time)
Description copied from class: TextField
Handles control character generation events.

This field's manager invokes this method to send this field a control character event.

Overrides:
keyControl in class TextField
See Also:
TextField.keyControl(char, int, int)

keyDown

protected boolean keyDown(int keycode,
                          int time)
Description copied from class: Field
Handles key down events.

By default, this method returns false; custom fields that specially handle key down events must override this method.

Overrides:
keyDown in class Field
See Also:
Field.keyDown(int, int)

layout

protected void layout(int width,
                      int height)
Description copied from class: TextField
Lays out this field's contents.

This field's manager invokes this method during the layout process to instruct this field to arrange its contents, given an amount of available space.

Overrides:
layout in class TextField
See Also:
TextField.layout(int, int)

makeContextMenu

protected void makeContextMenu(ContextMenu contextMenu)
Builds this field's context menu.

Field.getContextMenu() invokes this method to construct this field's context menu.

This method populates the context menu with cut, copy, paste, and clear selection entries, if appropriate (i.e., the field is Field.EDITABLE).

Overrides:
makeContextMenu in class TextField

Following copied from class: Field
Parameters:
contextMenu - Context menu to build.
See Also:
ContextMenu

moveFocus

protected int moveFocus(int amount,
                        int status,
                        int time)
Description copied from class: TextField
Handles moving focus within this field.

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); otherwise, focus movement happens vertically (line by line).

Prior to invoking this method, this field's manager ivnokes Field.focusRemove(). After invoking this method, the framework invokes Field.focusAdd(boolean). This method also clears this field's muddy state.

Overrides:
moveFocus in class TextField
See Also:
TextField.moveFocus(int, int, int)

moveFocus

protected void moveFocus(int x,
                         int y,
                         int status,
                         int time)
Description copied from class: TextField
Handles moving the focus to an exact position within this field.

This field's manager invokes this method when moving the focus to an exact position within this field, and only when this field already has the focus.

Overrides:
moveFocus in class TextField
Since:
JDE 3.6.0
See Also:
TextField.moveFocus(int, int, int)

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.

Overrides:
onUnfocus in class Field
Since:
JDE 3.7.0

paint

protected void paint(Graphics graphics)
Description copied from class: TextField
Redraws this field.

This field's manager invokes this method during the repainting process to instruct this field to repaint itself.

Overrides:
paint in class TextField
See Also:
TextField.paint(net.rim.device.api.ui.Graphics)

paste

public boolean paste(Clipboard cb)
Description copied from class: TextField
Pastes text scrap into this field.

If this field is EDITABLE, this method pastes the scrap currently on the clipboard after the current cursor position.

This method attempts to insert as many characters as it can into this field. If this field's capacity is reached before all characters are pasted, then only those that fit are pasted.

If this field currently has some text selected, this method replaces the selection with the scrap from the clipboard.

Overrides:
paste in class TextField
See Also:
TextField.paste(net.rim.device.api.system.Clipboard)

selectionDelete

public void selectionDelete()
Description copied from class: TextField
Deletes character to the right of the cursor, or deletes selection.

If some characters are currently selected, this method deletes the selection as if they were a single character.

If no characters are selected, this method deletes the character immediately to the right of the cursor. If the cursor is currently on the last character in the field, this method does nothing.

Overrides:
selectionDelete in class TextField
See Also:
TextField.selectionDelete()

setCursorPosition

public void setCursorPosition(int offset)
Description copied from class: TextField
Places cursor on specific character within this field, at user request.

This method does not include the label as part of its accounting (that is, an offset of zero represents the first character in this field's text value).

This method assumes the repositioning request was user-initiated.

Overrides:
setCursorPosition in class TextField
See Also:
TextField.setCursorPosition(int)

setCursorPosition

protected void setCursorPosition(int offset,
                                 int context)
Description copied from class: TextField
Places cursor on specific character within this field.

This method does not include the label as part of its accounting (that is, an offset of zero represents the first character in this field's text value).

Overrides:
setCursorPosition in class TextField
See Also:
TextField.setCursorPosition(int)

setFilter

public void setFilter(TextFilter filter)
Description copied from class: TextField
Sets the text filter for this field.
Overrides:
setFilter in class TextField
See Also:
TextField.setFilter(net.rim.device.api.ui.text.TextFilter)

setFont

public void setFont(Font font)
Description copied from class: TextField
Sets the font for this field and updates the display if necessary.
Overrides:
setFont in class TextField
Since:
JDE 3.7.0
See Also:
TextField.setFont(net.rim.device.api.ui.Font)

setLabel

public void setLabel(String newLabel)
Description copied from class: TextField
Sets this field's label.
Overrides:
setLabel in class TextField
See Also:
TextField.setLabel(java.lang.String)

setMaxSize

public void setMaxSize(int maxSize)
Description copied from class: TextField
Sets maximum number of characters allowed for this field's value.

If this field currently holds more than your provided number, this method truncates this field's contents to fit.

This method does not include the label in its accounting.

Overrides:
setMaxSize in class TextField
See Also:
TextField.setMaxSize(int)

setText

public void setText(String text)
             throws IllegalArgumentException
Description copied from class: TextField
Sets the text value for this field. The current text in the field is REPLACED by text.
Overrides:
setText in class TextField
See Also:
TextField.setText(java.lang.String)

setText

protected void setText(String text,
                       int context)
                throws IllegalArgumentException
Description copied from class: TextField
Sets the text value for this field, with indication of the source of this action.
Overrides:
setText in class TextField
See Also:
TextField.setText(java.lang.String)

update

protected void update(int delta)
Description copied from class: TextField
Updates this edit field.

This field invokes this method when text is inserted or deleted so this field can update itself.

Overrides:
update in class TextField
See Also:
TextField.update(int)

wipe

public void wipe()
Description copied from class: TextField
Overwrites this field's unused contents.
Overrides:
wipe in class TextField
Since:
JDE 4.0.0
See Also:
TextField.wipe()


Copyright 1999-2007 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.