|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmobilecore.ui.core.TextAreaComposer
public class TextAreaComposer
The TextAreaText
defines set of methods
that supports a text caret's handling and basic text editing.
Nested Class Summary | |
---|---|
static class |
TextAreaComposer.LineRange
LineRange represents 2 numbers - ranges for displayed text |
Field Summary | |
---|---|
protected int |
caretPosition
Current caret position in characters from the beginning of text |
protected int |
caretPositionX
Current caret position from the beginning of a row |
protected int |
caretPositionY
The caret vertical position from the top of component |
protected TextAreaComposer.LineRange |
currentRange
Current row where the caret is situated |
protected java.util.Vector |
linebreaks
Holds the LineRange classes. |
protected java.lang.StringBuffer |
text
The text to edit |
byte |
wrappingStyle
Current wrapping style |
Constructor Summary | |
---|---|
TextAreaComposer(int rows,
int compwidth,
javax.microedition.lcdui.Font font)
Constructs new instance of TextAreaText . |
Method Summary | |
---|---|
boolean |
addChar(char ch,
boolean insertMode)
Adds new symbol or replaces the current one |
void |
appendText(java.lang.String str)
Appends the given text to the text area's current text. |
boolean |
backspace()
Deletes previous symbol, moves cursor one position left |
protected boolean |
caretDown()
Moves the caret one position down |
boolean |
caretLeft()
Moves the caret one position left |
boolean |
caretRight()
Moves the caret one position right |
protected boolean |
caretUp()
Moves the caret one position up |
boolean |
deleteChar()
Deletes current symbol |
void |
destructor()
Default destructor. |
protected int |
findRange(int pos)
Returns the range for the specified offset |
int |
getCaretPosition()
Returns the caret position |
char[] |
getChars()
Returns the char array (mutable) that is presented by this text component. |
int |
getCurrentLength()
Returns the current text length |
java.lang.String |
getText()
Returns the text that is presented by this text component. |
void |
indexText()
Splits the text onto displayable substrings |
void |
insertText(java.lang.String str,
int pos)
Inserts the specified text at the specified position in this text area. |
void |
reset(javax.microedition.lcdui.Font font)
|
boolean |
setCaretPosition(int pos)
Sets cater position to specified position |
void |
setText(java.lang.String newText)
Sets the text that is presented by this text component to be the specified text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int caretPosition
protected int caretPositionX
protected int caretPositionY
protected TextAreaComposer.LineRange currentRange
protected java.util.Vector linebreaks
protected java.lang.StringBuffer text
public byte wrappingStyle
Constructor Detail |
---|
public TextAreaComposer(int rows, int compwidth, javax.microedition.lcdui.Font font)
TextAreaText
.
rows
- the number of rows to displaycompwidth
- font
- the current fontMethod Detail |
---|
public boolean addChar(char ch, boolean insertMode)
addChar
in interface AbstractComposer
ch
- new symbolinsertMode
- if true
then new symbol will be added, otherwise the current symbol
will be replaced
true
if the add/replace is possible, false
otherwisepublic void appendText(java.lang.String str)
public boolean backspace()
backspace
in interface AbstractComposer
true
if the delete and moving is possible/done, false
otherwiseprotected boolean caretDown()
true
if the moving is possible/done, false
otherwisepublic boolean caretLeft()
caretLeft
in interface AbstractComposer
true
if the moving is possible/done, false
otherwisepublic boolean caretRight()
caretRight
in interface AbstractComposer
true
if the moving is possible/done, false
otherwiseprotected boolean caretUp()
true
if the moving is possible/done, false
otherwisepublic boolean deleteChar()
deleteChar
in interface AbstractComposer
true
if the delete possible/done, false
otherwisepublic void destructor()
destructor
in interface AbstractComposer
protected int findRange(int pos)
public int getCaretPosition()
AbstractComposer
getCaretPosition
in interface AbstractComposer
public char[] getChars()
AbstractComposer
getChars
in interface AbstractComposer
public int getCurrentLength()
AbstractComposer
getCurrentLength
in interface AbstractComposer
public java.lang.String getText()
getText
in interface AbstractComposer
public void indexText()
public void insertText(java.lang.String str, int pos)
public void reset(javax.microedition.lcdui.Font font)
public boolean setCaretPosition(int pos)
setCaretPosition
in interface AbstractComposer
pos
- new caret position
true
if operation is successful, false
otherwisepublic void setText(java.lang.String newText)
setText
in interface AbstractComposer
newText
- the new text.
|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |