jMobileCore toolkit

com.jmobilecore.ui.core
Interface AbstractComposer

All Known Implementing Classes:
CustomFieldComposer, DigitalBlockComposer, TextAreaComposer, TextBlockComposer, TextFieldComposer

public interface AbstractComposer

The AbstractComposer interface defines set of methods that supports a text caret's handling and basic text editing.

Author:
Greg Gridin

Method Summary
 boolean addChar(char ch, boolean insertMode)
           
 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
 boolean deleteChar()
          Deletes current symbol
 void destructor()
          Default destructor.
 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 immutable string that is presented by this text component.
 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.
 

Method Detail

addChar

boolean addChar(char ch,
                boolean insertMode)

backspace

boolean backspace()
Deletes previous symbol, moves cursor one position left

Returns:
true if the delete and moving is possible/done, false otherwise

caretLeft

boolean caretLeft()
Moves the caret one position left

Returns:
true if the moving is possible/done, false otherwise

caretRight

boolean caretRight()
Moves the caret one position right

Returns:
true if the moving is possible/done, false otherwise

deleteChar

boolean deleteChar()
Deletes current symbol

Returns:
true if the delete possible/done, false otherwise

destructor

void destructor()
Default destructor. Helps VM to perform garbage collection


getCaretPosition

int getCaretPosition()
Returns the caret position


getChars

char[] getChars()
Returns the char array (mutable) that is presented by this text component. Usually works faster and more efficient than #getText


getCurrentLength

int getCurrentLength()
Returns the current text length


getText

java.lang.String getText()
Returns the immutable string that is presented by this text component.


setCaretPosition

boolean setCaretPosition(int caretPosition)
Sets the caret position

Parameters:
caretPosition - new caret position
Returns:
true if operation is successful, false otherwise

setText

void setText(java.lang.String newText)
Sets the text that is presented by this text component to be the specified text.

Parameters:
newText - the new text.

jMobileCore toolkit