|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmobilecore.ui.core.TextFieldComposer
com.jmobilecore.ui.TextBlockComposer
public class TextBlockComposer
The TextBlockComposer
defines set of methods
that supports a custom text field handling and editing
Field Summary | |
---|---|
char |
fillChar
Characted for filling out "empty" symbols |
static byte |
FIXED_SIZE
Fixed size style - Block size id predefined, user is scrolling though each symbol of the block |
static byte |
STATIC_FOCUSABLE
Static but focusable style - modification is possible for whole block only |
protected byte |
STYLE
The current TextBlockComposer formatting style. |
static byte |
VARIABLE_SIZE
Variable size style - Max length of the block is defined only, user is scrolling though entered symbols only |
Fields inherited from class com.jmobilecore.ui.core.TextFieldComposer |
---|
caretPosition, curLen, text |
Constructor Summary | |
---|---|
TextBlockComposer(byte style,
int length)
Constructs new instance of TextBlockComposer with specified style and length |
|
TextBlockComposer(byte style,
int length,
char fillChar)
Constructs new instance of TextBlockComposer with specified style, length
and filling characted |
|
TextBlockComposer(byte style,
java.lang.String staticContent)
Constructs new instance of TextBlockComposer with static style. |
|
TextBlockComposer(java.lang.String staticContent)
Constructs new instance of TextBlockComposer with static style. |
Method Summary | |
---|---|
boolean |
addChar(char ch,
boolean insertMode)
Adds new symbol or replaces the current one |
boolean |
backspace()
Deletes previous symbol, moves cursor one position left |
boolean |
caretLeft()
Moves the caret one position left |
boolean |
caretRight()
Moves the caret one position right |
void |
clear()
Clear out the field |
boolean |
deleteChar()
Deletes the current symbol for variable size field Replace the burrent symbol for fixed size field Do nothing for static field |
int |
getCaretPosition()
Returns the caret position |
boolean |
isComplete()
Tests if editing of the field is complete |
boolean |
setCaretPosition(int caretPosition)
Sets the caret 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 com.jmobilecore.ui.core.TextFieldComposer |
---|
destructor, getChars, getCurrentLength, getCursorOffset, getMaxSize, getText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public char fillChar
public static final byte FIXED_SIZE
public static final byte STATIC_FOCUSABLE
protected final byte STYLE
public static final byte VARIABLE_SIZE
Constructor Detail |
---|
public TextBlockComposer(byte style, int length)
TextBlockComposer
with specified style and length
style
- TextBlockComposer
style, cannot be STATIC
length
- the length for fixed size style, the max length for variable size style
java.lang.RuntimeException
- if style is STATIC
or STATIC_FOCUSABLE
public TextBlockComposer(byte style, int length, char fillChar)
TextBlockComposer
with specified style, length
and filling characted
style
- TextBlockComposer
style, cannot be STATIC
length
- the length for fixed size style, the max length for variable size stylefillChar
- the characted for filling out "empty" symbols
java.lang.RuntimeException
- if style is STATIC
or STATIC_FOCUSABLE
public TextBlockComposer(byte style, java.lang.String staticContent)
TextBlockComposer
with static style.
style
- TextBlockComposer
style, can be STATIC
or STATIC_FOCUSABLE
onlystaticContent
- the static (non-editable) contentpublic TextBlockComposer(java.lang.String staticContent)
TextBlockComposer
with static style.
staticContent
- the static (non-editable) contentMethod Detail |
---|
public boolean addChar(char ch, boolean insertMode)
addChar
in interface AbstractComposer
addChar
in class TextFieldComposer
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 boolean backspace()
backspace
in interface AbstractComposer
backspace
in class TextFieldComposer
true
if the delete and moving is possible/done, false
otherwisepublic boolean caretLeft()
caretLeft
in interface AbstractComposer
caretLeft
in class TextFieldComposer
true
if the moving is possible/done, false
otherwisepublic boolean caretRight()
caretRight
in interface AbstractComposer
caretRight
in class TextFieldComposer
true
if the moving is possible/done, false
otherwisepublic void clear()
public boolean deleteChar()
deleteChar
in interface AbstractComposer
deleteChar
in class TextFieldComposer
true
if the delete possible/done, false
otherwisepublic int getCaretPosition()
TextFieldComposer
getCaretPosition
in interface AbstractComposer
getCaretPosition
in class TextFieldComposer
public boolean isComplete()
true
if field is valid (complete and has correct value), false
otherwisepublic boolean setCaretPosition(int caretPosition)
TextFieldComposer
setCaretPosition
in interface AbstractComposer
setCaretPosition
in class TextFieldComposer
caretPosition
- new caret position
true
if operation is successful, false
otherwisepublic void setText(java.lang.String newText)
TextFieldComposer
setText
in interface AbstractComposer
setText
in class TextFieldComposer
newText
- the new text.
|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |