|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.dtv.lwuit.Component
com.sun.dtv.lwuit.TextArea
com.sun.dtv.lwuit.TextField
public class TextField
Allows in place editing using a lightweight API without necessarily moving to the external native text box. The main drawback in this approach is that editing can't support features such as T9 and might not have the same key mapping or behavior of the native text input.
Notice that due to limitations of text area and text field input modes in text area aren't properly supported since they won't work properly across devices. To limit input modes please use the setInputModeOrder method. All constants declared in TextArea are ignored with the exception of PASSWORD.
Field Summary |
---|
Fields inherited from class com.sun.dtv.lwuit.TextArea |
---|
ANY, DECIMAL, EMAILADDR, INITIAL_CAPS_SENTENCE, INITIAL_CAPS_WORD, NON_PREDICTIVE, NUMERIC, PASSWORD, PHONENUMBER, SENSITIVE, UNEDITABLE, URL |
Fields inherited from class com.sun.dtv.lwuit.Component |
---|
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Fields inherited from interface com.sun.dtv.ui.Animated |
---|
ALTERNATING, LOOP, REPEATING |
Constructor Summary | |
---|---|
TextField()
Default constructor. |
|
TextField(int columns)
Construct a text field with space reserved for columns. |
|
TextField(String text)
Construct text field. |
|
TextField(String text,
int columns)
Construct text field. |
Method Summary | |
---|---|
void |
addDataChangeListener(DataChangedListener d)
Adds a listener for data change events it will be invoked for every change made to the text field. |
static void |
addInputMode(String name,
Hashtable values,
boolean firstUpcase)
Adds a new input mode hashtable with the given name and set of values. |
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false. |
int |
getCommitTimeout()
The amount of time in milliseconds it will take for a change to get committed into the field. |
int |
getCursorBlinkTimeOff()
The amount of time in milliseconds in which the cursor is invisible. |
int |
getCursorBlinkTimeOn()
The amount of time in milliseconds in which the cursor is visible. |
int |
getCursorPosition()
Returns the position of the cursor. |
static String[] |
getDefaultInputModeOrder()
Returns the order in which input modes are toggled by default. |
String |
getInputMode()
Returns the currently selected input mode. |
String[] |
getInputModeOrder()
Returns the order in which input modes are toggled. |
static char[] |
getSymbolTable()
Returns the symbol table for the device. |
boolean |
isPendingCommit()
Returns true if the text field is waiting for a commit on editing. |
static boolean |
isQwertyAutoDetect()
Indicates whether the text field should try to auto detect qwerty and switch the qwerty device flag implicitly. |
static boolean |
isQwertyDevice()
The default value for the qwerty flag so it doesn't need setting for every text field individually. |
boolean |
isQwertyInput()
True is this is a qwerty device or a device that is currently in qwerty mode. |
boolean |
isReplaceMenu()
Indicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text field. |
static boolean |
isReplaceMenuDefault()
Indicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text field. |
boolean |
isUseSoftkeys()
When set to true softkeys are used to enable delete functionality. |
void |
keyPressed(int keyCode)
If this Component is focused, the key pressed event will call this method. |
void |
keyReleased(int keyCode)
If this Component is focused, the key released event will call this method. |
void |
paint(Graphics g)
This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering. |
void |
pointerReleased(int x,
int y)
If this Component is focused, the pointer released event will call this method. |
void |
removeDataChangeListener(DataChangedListener d)
Removes the listener for data change events. |
static void |
setClearText(String text)
Set the text that should appear on the clear soft key. |
void |
setCommitTimeout(int commitTimeout)
The amount of time in milliseconds it will take for a change to get committed into the field. |
void |
setCursorBlinkTimeOff(int time)
The amount of time in milliseconds in which the cursor is invisible. |
void |
setCursorBlinkTimeOn(int time)
The amount of time in milliseconds in which the cursor is visible. |
void |
setCursorPosition(int pos)
Set the position of the cursor. |
static void |
setDefaultInputModeOrder(String[] order)
Sets the order in which input modes are toggled by default and allows disabling/hiding an input mode. |
void |
setEditable(boolean b)
Sets this text area to be editable or readonly. |
void |
setInputMode(String mode)
Sets the current selected input mode matching one of the existing input modes. |
void |
setInputModeOrder(String[] order)
Sets the order in which input modes are toggled and allows disabling/hiding an input mode. |
static void |
setQwertyAutoDetect(boolean v)
Indicates whether the text field should try to auto detect qwerty and switch the qwerty device flag implicitly. |
static void |
setQwertyDevice(boolean v)
The default value for the qwerty flag so it doesn't need setting for every text field individually. |
void |
setQwertyInput(boolean qwerty)
Set this device to operate in or no longer operate in qwerty mode. |
void |
setReplaceMenu(boolean replaceMenu)
Indicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text field. |
static void |
setReplaceMenuDefault(boolean replaceMenu)
Indicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text field. |
static void |
setSymbolTable(char[] table)
Sets the symbol table to show when the user clicks the symbol table key. |
static void |
setT9Text(String text)
Set the text that should appear on the T9 soft key. |
void |
setText(String text)
Sets the text within this text area. |
void |
setUseSoftkeys(boolean useSoftkeys)
When set to true softkeys are used to enable delete functionality. |
Methods inherited from class com.sun.dtv.lwuit.TextArea |
---|
addActionListener, getColumns, getConstraint, getLines, getMaxSize, getRows, getRowsGap, getText, getTextAt, getUnsupportedChars, isAutoDegradeMaxSize, isEditable, isGrowByContent, isScrollableY, removeActionListener, setAutoDegradeMaxSize, setColumns, setConstraint, setDefaultMaxSize, setGrowByContent, setMaxSize, setRows, setRowsGap, setUnsupportedChars |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextField()
public TextField(int columns)
columns
- number of columnspublic TextField(String text)
text
- content of textfieldpublic TextField(String text, int columns)
text
- content of text fieldcolumns
- number of columnsMethod Detail |
---|
public static void setClearText(String text)
text
- the text for clear soft keypublic static void setT9Text(String text)
text
- the text for T9 soft keypublic boolean isPendingCommit()
public void setCommitTimeout(int commitTimeout)
commitTimeout
- indicates the amount of time that should elapse for a commit
to automatically occurgetCommitTimeout()
public int getCommitTimeout()
setCommitTimeout(int)
public void setInputMode(String mode)
mode
- the display name of the input mode by default the following modes
are supported: Abc, ABC, abc, 123getInputMode()
public String getInputMode()
setInputMode(java.lang.String)
public static void addInputMode(String name, Hashtable values, boolean firstUpcase)
name
- a unique display name for the input mode e.g. ABC, 123 etc...values
- The key for the hashtable is an Integer keyCode and the value
is a String containing the characters to toggle between for the given keycodefirstUpcase
- indicates if this input mode in an input mode used for the special
case where the first letter is an upper case letterpublic String[] getInputModeOrder()
setInputModeOrder(java.lang.String[])
public void setInputModeOrder(String[] order)
order
- the order for the input modes in this fieldgetInputModeOrder()
public static String[] getDefaultInputModeOrder()
setDefaultInputModeOrder(java.lang.String[])
public static void setDefaultInputModeOrder(String[] order)
order
- the order for the input modes in all future created fieldsgetDefaultInputModeOrder()
public void setCursorPosition(int pos)
pos
- the position of the cursorgetCursorPosition()
public int getCursorPosition()
setCursorPosition(int)
public void setText(String text)
TextArea
setText
in class TextArea
text
- new value for the text areaTextArea.getText()
public boolean isQwertyInput()
public void setQwertyInput(boolean qwerty)
qwerty
- indicate whether device should be set to qwerty mode or notpublic void keyReleased(int keyCode)
Component
keyReleased
in class TextArea
keyCode
- the key code value to indicate a physical key.public static char[] getSymbolTable()
setSymbolTable(char[])
public static void setSymbolTable(char[] table)
table
- the symbol tablegetSymbolTable()
public void setEditable(boolean b)
TextArea
setEditable
in class TextArea
b
- true is text are is editable; otherwise falsepublic void keyPressed(int keyCode)
Component
keyPressed
in class TextArea
keyCode
- the key code value to indicate a physical key.public void paint(Graphics g)
Component
paint
in interface Animation
paint
in class TextArea
g
- the component graphicspublic void setCursorBlinkTimeOn(int time)
time
- time in milliseconds in which the cursor is visiblegetCursorBlinkTimeOn()
public void setCursorBlinkTimeOff(int time)
time
- time in milliseconds in which the cursor is invisiblegetCursorBlinkTimeOff()
public int getCursorBlinkTimeOn()
setCursorBlinkTimeOn(int)
public int getCursorBlinkTimeOff()
setCursorBlinkTimeOff(int)
public boolean animate()
Animation
animate
in interface Animation
animate
in class Component
public void pointerReleased(int x, int y)
Component
pointerReleased
in class TextArea
x
- the pointer x coordinatey
- the pointer y coordinatepublic boolean isUseSoftkeys()
public void setUseSoftkeys(boolean useSoftkeys)
useSoftkeys
- value indicating whether softkeys are used to enable
delete functionalitypublic void addDataChangeListener(DataChangedListener d)
d
- the DataChangedListenerremoveDataChangeListener(com.sun.dtv.lwuit.events.DataChangedListener)
public void removeDataChangeListener(DataChangedListener d)
d
- the DataChangedListeneraddDataChangeListener(com.sun.dtv.lwuit.events.DataChangedListener)
public boolean isReplaceMenu()
public void setReplaceMenu(boolean replaceMenu)
replaceMenu
- true if the menu of the form should be replaced with
the T9/Clear commands for the duration of interactivity with the text fieldpublic static boolean isReplaceMenuDefault()
isReplaceMenu()
,
setReplaceMenuDefault(boolean)
public static void setReplaceMenuDefault(boolean replaceMenu)
replaceMenu
- default value for isReplaceMenu() return valueisReplaceMenu()
,
isReplaceMenuDefault()
public static void setQwertyAutoDetect(boolean v)
v
- value indicating whether the text field should try to auto
detect qwerty and switch the qwerty device flag implicitlypublic static void setQwertyDevice(boolean v)
v
- default value for the qwerty flag so it doesn't need setting for every
text field individuallypublic static boolean isQwertyAutoDetect()
public static boolean isQwertyDevice()
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |