|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jmobilecore.ui.core.Component com.jmobilecore.ui.core.TextComponent
public abstract class TextComponent
The TextComponent
class is the superclass of
any component that allows the editing of some text.
TextComponent
class defines a set of methods
that supports text editing using phone keypad.
Field Summary | |
---|---|
protected static java.lang.String |
ALL_SPEC_CHARS
All special character |
static int |
BORDER_GAP
The gap between the textfield frame and textfield text |
static int |
BORDER_WIDTH
The gap between the screen border and the textfield frame |
static int |
C_ALL_SPEC_CHARS
Allows all special characters in the document |
static int |
C_ALPHA
Allows all alphabet characters and space in the document |
static int |
C_ALPHA_NUMERIC
Allows alphanumeric characters in the document |
static int |
C_ANY
Allows any characters in the document |
static int |
C_EMAIL
Allows all email characters in the document |
static int |
C_EMAIL_SPEC_CHARS
Allows email special letters in the document |
static int |
C_LOWER_CASE
Allows lowercase letters in the document |
static int |
C_NO_CHARS
Do not allows any chars |
static int |
C_NUMERIC
Allows numbers in the document |
static int |
C_SPACE
Allows spaces in the document |
static int |
C_UPPER_CASE
Allows uppercase letters in the document |
protected java.util.Timer |
cHandler
The timer is used to determine if key input time is elapsed |
protected static char[][] |
CHAR_OPTIONS
The characters, mapped to the number keys |
protected int |
charOptionCounter
Index into charOptionCounter for the last character used. |
protected int |
constraint
Constraints for the document |
protected static int |
CURSOR_DELAY
Blinking rate for the curson in milliseconds |
static byte |
CURSOR_TYPE_LINE
|
static byte |
CURSOR_TYPE_SYMBOL
|
boolean |
editable
The flag that determines whether or not this text component is editable. |
protected static java.lang.String |
EMAIL_SPEC_CHARS
Email special characters |
protected boolean |
insertMode
Indicated if text component is in insert mode |
protected static int[] |
KEY_OPTIONS
Phone keys used for data input. |
protected int |
lastKeyCode
|
protected static java.lang.String |
LC_CHARS
Lowercase characters |
protected static java.lang.String |
NUMERIC_CHARS
Numeric characters |
protected static java.lang.String |
SPACE_CHARS
Space character |
protected static java.lang.String |
UC_CHARS
Uppercase characters |
protected char[] |
validChars
The array of allowed characted |
Fields inherited from class com.jmobilecore.ui.core.Component |
---|
alignment, background, CENTER, focusable, focusedBackground, focusedForeground, font, foreground, height, isCompletelyVisible, isFocused, isVisible, LEFT, parentScreen, RIGHT, screenY, valid, width |
Constructor Summary | |
---|---|
TextComponent(int constr)
Creates a new TextComponent instance. |
Method Summary | |
---|---|
void |
addValidChars(java.lang.String str)
Adds valid characters for the component. |
void |
destructor()
Default destructor. |
int |
getCaretPosition()
Gets the position of the text insertion caret for this text component. |
protected abstract AbstractComposer |
getComposer()
Gets current input composer |
protected int |
getKeyOption(int keyCode)
|
protected void |
initCursor()
Initializes new timer |
protected boolean |
isCharValid(char ch)
Checks if the character is allows symbol |
protected boolean |
preProcessKeyCode(int keyCode)
|
protected char |
processKeyCode(int keyCode)
|
protected void |
resetCursor()
Cancels the timer |
protected void |
resetCursorHandler()
|
boolean |
setCaretPosition(int caretPosition)
Sets the position of the text insertion caret for this text component. |
Methods inherited from class com.jmobilecore.ui.core.Component |
---|
getBackground, getFont, getForeground, getHeight, getWidth, invalidate, isFocusOwner, keyPressed, keyReleased, keyRepeated, paint, paintBackground, pointerDragged, pointerPressed, pointerReleased, prepareForeground, releaseFocus, requestFocus, setFont, setHeight |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String ALL_SPEC_CHARS
public static final int BORDER_GAP
public static final int BORDER_WIDTH
public static final int C_ALL_SPEC_CHARS
ALL_SPEC_CHARS
,
Constant Field Valuespublic static final int C_ALPHA
public static final int C_ALPHA_NUMERIC
public static final int C_ANY
public static final int C_EMAIL
public static final int C_EMAIL_SPEC_CHARS
EMAIL_SPEC_CHARS
,
Constant Field Valuespublic static final int C_LOWER_CASE
LC_CHARS
,
Constant Field Valuespublic static final int C_NO_CHARS
public static final int C_NUMERIC
NUMERIC_CHARS
,
Constant Field Valuespublic static final int C_SPACE
SPACE_CHARS
,
Constant Field Valuespublic static final int C_UPPER_CASE
UC_CHARS
,
Constant Field Valuesprotected java.util.Timer cHandler
protected static final char[][] CHAR_OPTIONS
protected volatile int charOptionCounter
charOptionCounter
for the last character used.
protected int constraint
protected static final int CURSOR_DELAY
public static final byte CURSOR_TYPE_LINE
public static final byte CURSOR_TYPE_SYMBOL
public boolean editable
protected static final java.lang.String EMAIL_SPEC_CHARS
protected volatile boolean insertMode
protected static final int[] KEY_OPTIONS
protected int lastKeyCode
protected static final java.lang.String LC_CHARS
protected static final java.lang.String NUMERIC_CHARS
protected static final java.lang.String SPACE_CHARS
protected static final java.lang.String UC_CHARS
protected char[] validChars
Constructor Detail |
---|
public TextComponent(int constr)
TextComponent
instance.
constr
- Constraints for this documentMethod Detail |
---|
public void addValidChars(java.lang.String str)
str
- string of valid characterspublic void destructor()
destructor
in class Component
public int getCaretPosition()
protected abstract AbstractComposer getComposer()
protected int getKeyOption(int keyCode)
protected void initCursor()
protected boolean isCharValid(char ch)
ch
- test character
true
if the characted is allwed symbol
for the component, false
otherwiseprotected boolean preProcessKeyCode(int keyCode)
protected char processKeyCode(int keyCode)
protected void resetCursor()
protected void resetCursorHandler()
public boolean setCaretPosition(int caretPosition)
caretPosition
- the position of the text insertion caret
true
if setting of caret position is possible false
|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |