public class TextField extends TextArea
A specialized version of TextArea
with some minor deviations from the original
specifically:
TextField
onlycom.codename1.ui.events.DataChangeListener
is only available in TextField
.
This is crucial for character by character input event trackingTextArea.setDoneListener(com.codename1.ui.events.ActionListener)
is only available in TextField
TextField
" vs. "TextArea
") The demo code below shows simple input using text fields:
The following code demonstrates a more advanced search widget where the data is narrowed as we type
directly into the title area search. Notice that the TextField
and its hint are styled to look like the title.
ANY, DECIMAL, EMAILADDR, INITIAL_CAPS_SENTENCE, INITIAL_CAPS_WORD, NON_PREDICTIVE, NUMERIC, PASSWORD, PHONENUMBER, SENSITIVE, UNEDITABLE, UPPERCASE, URL, USERNAME
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR
Constructor and Description |
---|
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
|
TextField(String text,
String hint)
Construct text field with a hint
|
TextField(String text,
String hint,
int columns,
int constraint)
Construct text field with a hint, columns and constraint values
|
Modifier and Type | Method and Description |
---|---|
static void |
addInputMode(String name,
Hashtable values,
boolean firstUpcase)
Deprecated.
this is a method for use only on old J2ME devices and is ignored everywhere else
|
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false.
|
protected Dimension |
calcPreferredSize()
Calculates the preferred size based on component content.
|
protected TextSelection.Spans |
calculateTextSelectionSpan(TextSelection sel)
Calculates the spans for the the given text selection.
|
void |
clear()
Clears the text from the TextField
|
protected void |
commitChange()
Commit the changes made to the text field as a complete edit operation.
|
static TextArea |
create()
Default factory method
|
static TextArea |
create(int columns)
Construct text field/area depending on whether native in place editing is supported
|
static TextArea |
create(String text)
Construct text field/area depending on whether native in place editing is supported
|
static TextArea |
create(String text,
int columns)
Construct text field/area depending on whether native in place editing is supported
|
protected Container |
createSymbolTable()
Creates a symbol table container used by the showSymbolDialog method.
|
protected void |
deinitialize()
Invoked to indicate that the component initialization is being reversed
since the component was detached from the container hierarchy.
|
void |
deleteChar()
Performs a backspace operation
|
protected void |
fireClicked()
When working in 3 softbutton mode "fire" key (center softbutton) is sent to this method
in order to allow 3 button devices to work properly.
|
protected char |
getCharPerKeyCode(int pressCount,
int keyCode,
boolean longClick)
Returns the character matching the given key code after the given amount
of user presses
|
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 char position
|
int |
getCursorX()
Returns the position of the cursor char position in the current line.
|
int |
getCursorY()
Returns the position of the cursor line position
|
static int |
getDefaultChangeInputModeKey()
Deprecated.
this is a method for use only on old J2ME devices and is ignored everywhere else
|
static String[] |
getDefaultInputModeOrder()
Deprecated.
this is a method for use only on old J2ME devices and is ignored everywhere else
|
static int |
getDefaultSymbolDialogKey()
The default key for poping open the symbol dialog
|
String |
getInputMode()
Deprecated.
this is a method for use only on old J2ME devices and is ignored everywhere else
|
String[] |
getInputModeOrder()
Returns the order in which input modes are toggled
|
protected int |
getLongClickDuration()
The amount of time considered as a "long click" causing the long click method
to be invoked.
|
protected String |
getLongClickInputMode()
Returns the input mode for the ong click mode
|
static char[] |
getSymbolTable()
Returns the symbol table for the device
|
void |
insertChars(String c)
Deprecated.
this is a method for use only on old J2ME devices and is ignored everywhere else
|
protected Command |
installCommands(Command clear,
Command t9)
Installs the clear and t9 commands onto the parent form, this method can
be overriden to provide device specific placement for these commands
|
protected boolean |
isChangeInputMode(int keyCode)
Deprecated.
this is a method for use only on old J2ME devices and is ignored everywhere else
|
protected boolean |
isClearKey(int keyCode)
Returns true if this is the clear key on the device, many devices don't contain
a clear key and even in those that contain it this might be an issue
|
protected boolean |
isCursorPositionCycle()
Returns true if the cursor should cycle to the beginning of the text when the
user navigates beyond the edge of the text and visa versa.
|
protected boolean |
isEditingEndTrigger(int keyCode)
Indicates whether the given key code should be ignored or should trigger
cause editing to end.
|
protected boolean |
isEditingTrigger(int keyCode)
Indicates whether the given key code should be ignored or should trigger
editing, by default fire or any numeric key should trigger editing implicitly.
|
boolean |
isEnableInputScroll()
Indicates whether text field input should scroll to the right side when no
more room for the input is present.
|
protected boolean |
isImmediateInputMode(String mode)
Deprecated.
this is a method for use only on old J2ME devices and is ignored everywhere else
|
boolean |
isLeftAndRightEditingTrigger()
Indicates whether the left/right keys will trigger editing, this is true by default.
|
boolean |
isOverwriteMode()
Indicates that this is the overwrite mode
|
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
|
protected boolean |
isSelectableInteraction()
This method allows a component to indicate that it is interested in an "implicit" select
command to appear in the "fire" button when 3 softbuttons are defined in a device.
|
protected boolean |
isSymbolDialogKey(int keyCode)
Returns true if this keycode is the one mapping to the symbol dialog popup
|
static boolean |
isUseNativeTextInput()
Deprecated.
this API is no longer useful and should be avoided
|
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 |
keyRepeated(int keyCode)
If this Component is focused, the key repeat event
will call this method.
|
protected void |
longKeyPress(int keyCode)
If this Component is focused this method is invoked when the user presses
and holds the key
|
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
|
protected void |
removeCommands(Command clear,
Command t9,
Command originalClear)
Removes the clear and t9 commands from the parent form, this method can
be overriden to provide device specific placement for these commands
|
void |
setAlignment(int align)
Sets the Alignment of the TextArea to one of: CENTER, LEFT, RIGHT
|
static void |
setClearText(String text)
Set the text that should appear on the clear softkey
|
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)
Sets the position of the cursor char position
|
static void |
setDefaultChangeInputModeKey(int k)
Deprecated.
this is a method for use only on old J2ME devices and is ignored everywhere else
|
static void |
setDefaultInputModeOrder(String[] order)
Deprecated.
this is a method for use only on old J2ME devices and is ignored everywhere else
|
static void |
setDefaultSymbolDialogKey(int d)
The default key for poping open the symbol dialog
|
void |
setEditable(boolean b)
Sets this text area to be editable or readonly
|
void |
setEnableInputScroll(boolean enableInputScroll)
Indicates whether text field input should scroll to the right side when no
more room for the input is present.
|
void |
setInputMode(String inputMode)
Deprecated.
this is a method for use only on old J2ME devices and is ignored everywhere else
|
void |
setInputModeOrder(String[] order)
Deprecated.
this is a method for use only on old J2ME devices and is ignored everywhere else
|
void |
setLeftAndRightEditingTrigger(boolean leftAndRightEditingTrigger)
Indicates whether the left/right keys will trigger editing, this is true by default.
|
void |
setOverwriteMode(boolean overwriteMode)
Indicates that this is the overwrite 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)
True is this is a qwerty device or a device that is currently 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 softkey
|
void |
setText(String text)
Sets the text within this text area
|
static void |
setUseNativeTextInput(boolean aUseNativeTextInput)
Deprecated.
this API is no longer useful and should be avoided
|
void |
setUseSoftkeys(boolean useSoftkeys)
When set to true softkeys are used to enable delete functionality
|
protected void |
showSymbolDialog()
Invoked to show the symbol dialog, this method can be overriden by subclasses to
manipulate the symbol table
|
boolean |
validChar(String c)
Checks if the candidate input is valid for this TextField
|
addActionListener, addCloseListener, addDataChangedListener, addDataChangeListener, autoDetectWidestChar, bindProperty, calcScrollSize, fireDataChanged, fireDoneEvent, getAbsoluteAlignment, getActualRows, getAlignment, getAsDouble, getAsInt, getAsLong, getBindablePropertyNames, getBindablePropertyTypes, getBoundPropertyValue, getColumns, getConstraint, getDefaultValign, getDoneListener, getGrowLimit, getHint, getHintIcon, getHintLabel, getLines, getLinesToScroll, getMaxSize, getPreferredTabIndex, getRows, getRowsGap, getStyle, getText, getTextAt, getTextSelectionSupport, getUnsupportedChars, getVerticalAlignment, getWidestChar, initComponent, initLaf, isActAsLabel, isAutoDegradeMaxSize, isEditable, isEditing, isEndsWith3Points, isEnterKey, isGrowByContent, isScrollableY, isSingleLineTextArea, isTextSelectionEnabled, isUseStringWidth, pointerHover, pointerHoverReleased, preprocess, registerAsInputDevice, removeActionListener, removeCloseListener, removeDataChangedListener, removeDataChangeListener, setActAsLabel, setAutoDegradeMaxSize, setBoundPropertyValue, setColumns, setConstraint, setDefaultMaxSize, setDefaultValign, setDoneListener, setEndsWith3Points, setGrowByContent, setGrowLimit, setHint, setHint, setHintIcon, setLinesToScroll, setMaxSize, setRows, setRowsGap, setSingleLineTextArea, setTextSelectionEnabled, setUnsupportedChars, setUseStringWidth, setVerticalAlignment, setWidestChar, setWidth, shouldRenderComponentSelection, startEditing, startEditingAsync, stopEditing, stopEditing, unbindProperty
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, blocksSideSwipe, cancelRepaints, clearClientProperties, contains, containsOrOwns, createStyleAnimation, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, dragInitiated, drawDraggedImage, drop, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBorder, getBottomGap, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getDragTransparency, getEditingDelegate, getGridPosX, getGridPosY, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredW, getPressedStyle, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getSideGap, getTabIndex, getTensileLength, getTooltip, getUIID, getUIManager, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initCustomStyle, initDisabledStyle, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEnabled, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollableX, isScrollVisible, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, laidOut, longPointerPress, onScrollX, onScrollY, paintBackground, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, paramString, parsePreferredSize, pinch, pinch, pinchReleased, pointerDragged, pointerDragged, pointerHoverPressed, pointerPressed, pointerPressed, pointerReleased, putClientProperty, refreshTheme, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setAlwaysTensile, setBlockLead, setCellRenderer, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setEnabled, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setPropertyValue, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUnselectedStyle, setVisible, setX, setY, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, showNativeOverlay, stripMarginAndPadding, styleChanged, toImage, toString, updateNativeOverlay, visibleBoundsContains
public TextField()
public TextField(int columns)
columns
- - the number of columnspublic TextField(String text)
text
- the text of the fieldpublic TextField(String text, String hint)
text
- the text of the fieldhint
- the hint stringpublic TextField(String text, String hint, int columns, int constraint)
text
- the text of the fieldhint
- the hint stringcolumns
- columns valueconstraint
- the constraint valuepublic TextField(String text, int columns)
text
- the text of the fieldcolumns
- - the number of columnspublic static boolean isUseNativeTextInput()
public static void setUseNativeTextInput(boolean aUseNativeTextInput)
aUseNativeTextInput
- the useNativeTextInput to setpublic static void setClearText(String text)
text
- localized text for the clear softbuttonpublic static void setT9Text(String text)
text
- text for the T9 softbuttonpublic boolean isEnableInputScroll()
isEnableInputScroll
in class TextArea
public void setEnableInputScroll(boolean enableInputScroll)
enableInputScroll
- true to enable scrolling to the sidepublic void deleteChar()
public static TextArea create(String text, int columns)
text
- the text of the fieldcolumns
- - the number of columnspublic static TextArea create()
public static TextArea create(int columns)
columns
- - the number of columnspublic static TextArea create(String text)
text
- the text of the fieldprotected void commitChange()
public boolean isPendingCommit()
isPendingCommit
in class TextArea
public void setCommitTimeout(int commitTimeout)
commitTimeout
- indicates the amount of time that should elapse for a commit
to automatically occurpublic int getCommitTimeout()
public void setInputMode(String inputMode)
inputMode
- the display name of the input mode by default the following modes
are supported: Abc, ABC, abc, 123public String getInputMode()
getInputMode
in class TextArea
protected boolean isChangeInputMode(int keyCode)
keyCode
- the codepublic 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()
getInputModeOrder
in class TextArea
public void setInputModeOrder(String[] order)
order
- the order for the input modes in this fieldpublic static String[] getDefaultInputModeOrder()
public static void setDefaultInputModeOrder(String[] order)
order
- the order for the input modes in all future created fieldsprotected String getLongClickInputMode()
protected char getCharPerKeyCode(int pressCount, int keyCode, boolean longClick)
pressCount
- number of times this keycode was pressedkeyCode
- the actual keycode input by the userlongClick
- does this click constitute a long clickpublic void setCursorPosition(int pos)
pos
- the cursor positionpublic int getCursorPosition()
getCursorPosition
in class TextArea
public int getCursorY()
getCursorY
in class TextArea
public int getCursorX()
getCursorX
in class TextArea
public void setText(String text)
setText
in interface TextHolder
setText
in class TextArea
text
- new value for the text areapublic void clear()
protected boolean isClearKey(int keyCode)
keyCode
- the key code that might be the clear keyprotected void longKeyPress(int keyCode)
longKeyPress
in class Component
keyCode
- the key code value to indicate a physical key.public boolean isQwertyInput()
isQwertyInput
in class TextArea
public void setQwertyInput(boolean qwerty)
qwerty
- the value of qwerty modeprotected boolean isImmediateInputMode(String mode)
mode
- the input modepublic void insertChars(String c)
This method accepts a string for the more elaborate cases such as multi-char input and paste.
c
- character for insertionpublic boolean validChar(String c)
c
- the String to insertprotected void showSymbolDialog()
protected Container createSymbolTable()
public void keyReleased(int keyCode)
keyReleased
in class TextArea
keyCode
- the key code value to indicate a physical key.protected int getLongClickDuration()
public static char[] getSymbolTable()
public static void setSymbolTable(char[] table)
table
- the symbol table of the device for the symbol table inputprotected boolean isCursorPositionCycle()
protected boolean isSymbolDialogKey(int keyCode)
keyCode
- the keycode to checkprotected void deinitialize()
deinitialize
in class TextArea
public void setEditable(boolean b)
setEditable
in class TextArea
b
- true is text are is editable; otherwise falsepublic void keyRepeated(int keyCode)
keyRepeated
in class Component
keyCode
- the key code value to indicate a physical key.public void keyPressed(int keyCode)
keyPressed
in class TextArea
keyCode
- the key code value to indicate a physical key.protected Command installCommands(Command clear, Command t9)
clear
- the clear commandt9
- the t9 commandprotected boolean isSelectableInteraction()
isSelectableInteraction
in class TextArea
protected void fireClicked()
fireClicked
in class TextArea
protected void removeCommands(Command clear, Command t9, Command originalClear)
clear
- the clear commandt9
- the t9 commandoriginalClear
- the command originally assigned as the clear command (or null if no command was assigned before)protected boolean isEditingTrigger(int keyCode)
keyCode
- the keycode passed to the keyPressed methodprotected boolean isEditingEndTrigger(int keyCode)
keyCode
- the keycode passed to the keyPressed methodpublic void paint(Graphics g)
protected Dimension calcPreferredSize()
calcPreferredSize
in class TextArea
public void setCursorBlinkTimeOn(int time)
time
- for the cursor to stay "on"public void setCursorBlinkTimeOff(int time)
time
- for the cursor to stay "off"public int getCursorBlinkTimeOn()
public int getCursorBlinkTimeOff()
public boolean animate()
Display
class.public void pointerReleased(int x, int y)
pointerReleased
in class TextArea
x
- the pointer x coordinatey
- the pointer y coordinatepublic boolean isUseSoftkeys()
public void setUseSoftkeys(boolean useSoftkeys)
useSoftkeys
- true if softkeys should be usedpublic boolean isReplaceMenu()
public void setReplaceMenu(boolean replaceMenu)
replaceMenu
- true if the menu should be replacedpublic static boolean isReplaceMenuDefault()
public static void setReplaceMenuDefault(boolean replaceMenu)
replaceMenu
- true if the menu should be replacedpublic static void setQwertyAutoDetect(boolean v)
v
- true for qwerty auto detectionpublic static void setQwertyDevice(boolean v)
v
- true for qwerty devicepublic static boolean isQwertyAutoDetect()
public static boolean isQwertyDevice()
public static void setDefaultChangeInputModeKey(int k)
k
- key to change the input modepublic static int getDefaultChangeInputModeKey()
public static void setDefaultSymbolDialogKey(int d)
d
- new key valuepublic static int getDefaultSymbolDialogKey()
public void setOverwriteMode(boolean overwriteMode)
overwriteMode
- set to true if input with overwrite characterspublic boolean isOverwriteMode()
public void setLeftAndRightEditingTrigger(boolean leftAndRightEditingTrigger)
leftAndRightEditingTrigger
- Indicates whether the left/right keys will trigger editingpublic boolean isLeftAndRightEditingTrigger()
public void setAlignment(int align)
setAlignment
in class TextArea
align
- alignment valueComponent.CENTER
,
Component.LEFT
,
Component.RIGHT
protected TextSelection.Spans calculateTextSelectionSpan(TextSelection sel)
calculateTextSelectionSpan
in class TextArea
sel
- The TextSelection