Methods Summary |
---|
void | callHideNotify(Display d)Notify this Displayable it is being hidden on the given Display
super.callHideNotify(d);
form.callHideNotify(d);
|
void | callInvalidate(Item src)Called by the event thread to invalidate the contents
of this TextBox
form.callInvalidate(src);
|
void | callItemStateChanged(Item src)Called by the event thread to notify an ItemStateChangeListener
that an item has changed
form.callItemStateChanged(src);
|
void | callKeyPressed(int keyCode)Handle a key pressed event
form.callKeyPressed(keyCode);
|
void | callKeyReleased(int keyCode)Handle a key released event
form.callKeyReleased(keyCode);
|
void | callKeyRepeated(int keyCode)Handle a key repeated event
form.callKeyRepeated(keyCode);
|
void | callKeyTyped(char keyCode)Handle a key typed event
form.callKeyTyped(keyCode);
|
void | callPaint(Graphics g, java.lang.Object target)Paint the content of this TextBox
super.callPaint(g, target);
form.callPaint(g, target);
|
void | callShowNotify(Display d)Notify this Displayable it is being shown on the given Display
super.callShowNotify(d);
form.callShowNotify(d);
|
void | commitPendingInteraction()Called to commit any pending user interaction for the textfield.
Override the no-op in Displayable.
textField.commitPendingInteraction();
|
public void | delete(int offset, int length)Deletes characters from the TextBox .
The offset and length parameters must
specify a valid range of characters within
the contents of the TextBox .
The offset parameter must be within the
range [0..(size())] , inclusive.
The length parameter
must be a non-negative integer such that
(offset + length) <= size() .
textField.delete(offset, length);
|
public int | getCaretPosition()Gets the current input position. For some UIs this may block and ask
the user for the intended caret position, and on other UIs this may
simply return the current caret position.
// returns a value relative to the flat input text
return textField.getCaretPosition();
|
public int | getChars(char[] data)Copies the contents of the TextBox into a
character array starting at
index zero. Array elements beyond the characters copied are left
unchanged.
return textField.getChars(data);
|
public int | getConstraints()Gets the current input constraints of the TextBox .
return textField.getConstraints();
|
public int | getMaxSize()Returns the maximum size (number of characters) that can be
stored in this TextBox .
return textField.getMaxSize();
|
public java.lang.String | getString()Gets the contents of the TextBox as a string value.
return textField.getString();
|
public void | insert(java.lang.String src, int position)Inserts a string into the contents of the TextBox .
The string is
inserted just prior to the character indicated by the
position parameter, where zero specifies the first
character of the contents of the TextBox . If
position is
less than or equal to zero, the insertion occurs at the beginning of
the contents, thus effecting a prepend operation. If
position is greater than or equal to the current size of
the contents, the insertion occurs immediately after the end of the
contents, thus effecting an append operation. For example,
text.insert(s, text.size()) always appends the string
s to the current contents.
The current size of the contents is increased by the number of
inserted characters. The resulting string must fit within the current
maximum capacity.
If the application needs to simulate typing of characters it can
determining the location of the current insertion point
("caret")
using the with {@link #getCaretPosition() getCaretPosition()} method.
For example,
text.insert(s, text.getCaretPosition()) inserts the string
s at the current caret position.
textField.insert(src, position);
|
public void | insert(char[] data, int offset, int length, int position)Inserts a subrange of an array of characters into the contents of
the TextBox . The offset and
length parameters indicate the subrange of
the data array to be used for insertion. Behavior is otherwise
identical to {@link #insert(String, int) insert(String, int)}.
The offset and length parameters must
specify a valid range of characters within
the character array data .
The offset parameter must be within the
range [0..(data.length)] , inclusive.
The length parameter
must be a non-negative integer such that
(offset + length) <= data.length .
textField.insert(data, offset, length, position);
|
public void | setChars(char[] data, int offset, int length)Sets the contents of the TextBox from a character
array, replacing the
previous contents. Characters are copied from the region of the
data array
starting at array index offset and running for
length characters.
If the data array is null , the TextBox
is set to be empty and the other parameters are ignored.
The offset and length parameters must
specify a valid range of characters within
the character array data .
The offset parameter must be within the
range [0..(data.length)] , inclusive.
The length parameter
must be a non-negative integer such that
(offset + length) <= data.length .
textField.setChars(data, offset, length);
|
public void | setConstraints(int constraints)Sets the input constraints of the TextBox . If the
current contents
of the TextBox do not match the new constraints,
the contents are
set to empty.
textField.setConstraints(constraints);
|
public void | setInitialInputMode(java.lang.String characterSubset)Sets a hint to the implementation as to the input mode that should be
used when the user initiates editing of this
TextBox . The
characterSubset parameter names a subset of Unicode
characters that is used by the implementation to choose an initial
input mode. If null is passed, the implementation should
choose a default input mode.
See Input Modes for a full
explanation of input modes.
textField.setInitialInputMode(characterSubset);
|
public int | setMaxSize(int maxSize)Sets the maximum size (number of characters) that can be
contained in this
TextBox . If the current contents of the
TextBox are larger than
maxSize , the contents are truncated to fit.
return textField.setMaxSize(maxSize);
|
public void | setString(java.lang.String text)Sets the contents of the TextBox as a string
value, replacing the previous contents.
textField.setString(text);
|
public void | setTicker(Ticker ticker)Sets a ticker for use with this Displayable ,
replacing any
previous ticker.
If null , removes the ticker object
from this Displayable . The same ticker may be shared by
several Displayable
objects within an application. This is done by calling
setTicker()
with the same Ticker object on several
different Displayable objects.
If the Displayable is actually visible on the display,
the implementation should update
the display as soon as it is feasible to do so.
The existence of a ticker may affect the size
of the area available for Displayable's contents.
If the application adds, removes, or sets the ticker text at runtime,
this can dynamically change the size of the content area.
This is most important to be aware of when using the
Canvas class.
super.setTicker(ticker);
// We override this method from Displayable to set the ticker
// on our internal Form which is doing all our rendering
form.setTicker(ticker);
|
public void | setTitle(java.lang.String s)Sets the title of the Displayable . If
null is given,
removes the title.
If the Displayable is actually visible on
the display,
the implementation should update
the display as soon as it is feasible to do so.
The existence of a title may affect the size
of the area available for Displayable content.
If the application adds, removes, or sets the title text at runtime,
this can dynamically change the size of the content area.
This is most important to be aware of when using the
Canvas class.
super.setTitle(s);
// We override this method from Displayable to set the title
// on our internal Form which is doing all our rendering
form.setTitle(s);
|
public int | size()Gets the number of characters that are currently stored in this
TextBox .
// returns a value relative to the display text including formatting
return textField.size();
|