|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.Component com.sun.lwuit.Container com.sun.lwuit.Form com.sun.lwuit.Dialog com.sun.lwuit.VirtualKeyboard
public class VirtualKeyboard
This class represent the LWUIT Light Weight Virtual Keyboard
Field Summary | |
---|---|
static int |
CHANGE_MODE
|
static java.lang.String[][] |
DEFAULT_NUMBERS
This keymap represents numbers keyboard |
static java.lang.String[][] |
DEFAULT_NUMBERS_SYMBOLS
This keymap represents numbers and symbols keyboard |
static java.lang.String[][] |
DEFAULT_QWERTY
This keymap represents qwerty keyboard |
static java.lang.String[][] |
DEFAULT_SYMBOLS
This keymap represents symbols keyboard |
static int |
DELETE_CHAR
|
static int |
INSERT_CHAR
|
static java.lang.String |
NAME
|
static java.lang.String |
NUMBERS_MODE
The String that represent the numbers mode. |
static java.lang.String |
NUMBERS_SYMBOLS_MODE
The String that represent the numbers sybols mode. |
static int |
OK
|
static java.lang.String |
QWERTY_MODE
The String that represent the qwerty mode. |
static int |
SHIFT
|
static int |
SPACE
|
static java.lang.String |
SYMBOLS_MODE
The String that represent the symbols mode. |
static int |
T9
|
Fields inherited from class com.sun.lwuit.Dialog |
---|
TYPE_ALARM, TYPE_CONFIRMATION, TYPE_ERROR, TYPE_INFO, TYPE_NONE, TYPE_WARNING |
Fields inherited from class com.sun.lwuit.Form |
---|
focusScrolling |
Fields inherited from class com.sun.lwuit.Component |
---|
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Constructor Summary | |
---|---|
VirtualKeyboard()
Creates a new instance of VirtualKeyboard |
Method Summary | |
---|---|
protected void |
actionCommand(Command cmd)
Invoked to allow subclasses of form to handle a command from one point rather than implementing many command instances |
static void |
addDefaultInputMode(java.lang.String mode,
java.lang.String[][] inputChars)
Add an input mode to the virtual keyboard |
void |
addInputMode(java.lang.String mode,
java.lang.String[][] inputChars)
Add an input mode to the virtual keyboard |
void |
addSpecialButton(java.lang.String key,
Command cmd)
This method adds a special button to the virtual keyboard |
void |
addSpecialButton(java.lang.String key,
Command cmd,
int space)
This method adds a special button to the virtual keyboard |
protected void |
autoAdjust(int w,
int h)
Auto adjust size of the dialog. |
static void |
bindVirtualKeyboard(TextArea t,
VirtualKeyboard vkb)
This method is used to bind a specific instance of a virtual keyboard to a specific TextField. |
void |
dispose()
Closes the current form and returns to the previous form, releasing the EDT in the process |
protected java.lang.String |
getCurrentMode()
Gets the current mode. |
static java.lang.String[] |
getDefaultInputModeOrder()
Returns the order in which input modes are toggled by default |
protected TextField |
getInputField()
This method returns the Virtual Keyboard TextField. |
java.lang.String[] |
getInputModeOrder()
Returns the order in which input modes are toggled |
static Transition |
getTransitionIn()
The transition in for the VKB |
static Transition |
getTransitionOut()
The transition out for the VKB |
static VirtualKeyboard |
getVirtualKeyboard(TextArea t)
This method returns the Textfield associated VirtualKeyboard, see bindVirtualKeyboard(TextField tf, VirtualKeyboard vkb) method. |
java.lang.String |
getVirtualKeyboardName()
Returns the Virtual Keyboard name. |
static int |
getVKBTint(TextArea tf)
The tint color for the virtual keyboard when shown on top of this text field see the form tint methods for more information |
protected void |
initModes()
init all virtual keyboard modes, such as QWERTY_MODE, NUMBERS_SYMBOLS_MODE... |
protected void |
initSpecialButtons()
This method initialize all the virtual keyboard special buttons. |
static boolean |
isCommitOnDispose(TextArea tf)
Indicates whether the given text field should commit on dispose |
static boolean |
isShowTooltips()
Indicates whether tooltips should be shown when the keys in the VKB are pressed |
boolean |
isVirtualKeyboardShowing()
Indicates if the Virtual Keyboard is currently showing. |
protected void |
onShow()
Allows subclasses to bind functionality that occurs when a specific form or dialog appears on the screen |
void |
pointerDragged(int x,
int y)
If this Component is focused, the pointer dragged event will call this method |
void |
pointerPressed(int x,
int y)
If this Component is focused, the pointer pressed event will call this method |
void |
pointerReleased(int x,
int y)
If this Component is focused, the pointer released event will call this method |
static void |
setCommitOnDispose(TextField tf,
boolean b)
Indicates whether the VKB should commit changes to the text field when the VKB is closed not via the OK button. |
protected void |
setCurrentMode(java.lang.String mode)
Sets the current virtual keyboard mode. |
static void |
setDefaultInputModeOrder(java.lang.String[] order)
Sets the order in which input modes are toggled by default and allows disabling/hiding an input mode |
static void |
setDefaultVirtualKeyboardClass(java.lang.Class vkbClazz)
Sets the default virtual keyboard class for the com.sun.lwuit.VirtualKeyboard type This class is used as the default virtual keyboard class if the current platform VirtualKeyboard is com.sun.lwuit.VirtualKeyboard. |
void |
setInputModeOrder(java.lang.String[] order)
Sets the order in which input modes are toggled and allows disabling/hiding an input mode |
void |
setInputType(int inputType)
This can be used to indicate to the VirtualKeyboard what type of input to display. |
static void |
setShowTooltips(boolean aShowTooltips)
Indicates whether tooltips should be shown when the keys in the VKB are pressed |
void |
setTextField(TextArea field)
Invoked internally by the implementation to indicate the text field that will be edited by the virtual keyboard |
static void |
setTransitionIn(Transition aTransitionIn)
The transition in for the VKB |
static void |
setTransitionOut(Transition aTransitionOut)
The transition out for the VKB |
static void |
setVKBTint(TextField tf,
int tint)
Sets the tint color for the virtual keyboard when shown on top of this text field see the form tint methods for more information |
void |
show()
The default version of show modal shows the dialog occupying the center portion of the screen. |
void |
showKeyboard(boolean show)
Shows the virtual keyboard that is assoiciated with the displayed TextField or displays the default virtual keyboard. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[][] DEFAULT_QWERTY
public static final java.lang.String[][] DEFAULT_NUMBERS
public static final java.lang.String[][] DEFAULT_NUMBERS_SYMBOLS
public static final java.lang.String[][] DEFAULT_SYMBOLS
public static final java.lang.String QWERTY_MODE
public static final java.lang.String NUMBERS_MODE
public static final java.lang.String NUMBERS_SYMBOLS_MODE
public static final java.lang.String SYMBOLS_MODE
public static final int INSERT_CHAR
public static final int DELETE_CHAR
public static final int CHANGE_MODE
public static final int SHIFT
public static final int OK
public static final int SPACE
public static final int T9
public static final java.lang.String NAME
Constructor Detail |
---|
public VirtualKeyboard()
Method Detail |
---|
public void setInputType(int inputType)
VirtualKeyboardInterface
setInputType
in interface VirtualKeyboardInterface
public void setTextField(TextArea field)
field
- the text field instancepublic void show()
Dialog
show
in class Dialog
protected void autoAdjust(int w, int h)
Dialog
autoAdjust
in class Dialog
w
- width of the screenh
- height of the screenprotected void initModes()
protected void setCurrentMode(java.lang.String mode)
mode
- the String that represents the mode(QWERTY_MODE,
SYMBOLS_MODE, ...)protected java.lang.String getCurrentMode()
public static void addDefaultInputMode(java.lang.String mode, java.lang.String[][] inputChars)
mode
- a string that represents the identifier of the modeinputChars
- 2 dimensional String array that contains buttons String
and special buttons (a special button is identified with $...$ marks
e.g: "$Space$")public void addInputMode(java.lang.String mode, java.lang.String[][] inputChars)
mode
- a string that represents the identifier of the modeinputChars
- 2 dimentional String array that contains buttons String
and special buttons (a special button is identified with $...$ marks
e.g: "$Space$")public void addSpecialButton(java.lang.String key, Command cmd)
key
- the string identifier from within the relevant input modecmd
- the Command to invoke when this button is invoked.public void addSpecialButton(java.lang.String key, Command cmd, int space)
key
- the string identifier from within the relevant input modecmd
- the Command to invoke when this button is invoked.space
- how much space in percentage from the overall row
the special button should occupypublic void pointerPressed(int x, int y)
Component
pointerPressed
in class Form
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerDragged(int x, int y)
Component
pointerDragged
in class Form
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerReleased(int x, int y)
Component
pointerReleased
in class Dialog
x
- the pointer x coordinatey
- the pointer y coordinateprotected void initSpecialButtons()
public java.lang.String[] getInputModeOrder()
public void setInputModeOrder(java.lang.String[] order)
order
- the order for the input modes in this fieldpublic static java.lang.String[] getDefaultInputModeOrder()
public static void setDefaultInputModeOrder(java.lang.String[] order)
order
- the order for the input modes in all future created fieldsprotected void actionCommand(Command cmd)
Dialog
actionCommand
in class Dialog
cmd
- the action commandpublic void dispose()
Dialog
dispose
in class Dialog
protected void onShow()
Form
onShow
in class Dialog
protected TextField getInputField()
public static void setCommitOnDispose(TextField tf, boolean b)
tf
- the text field to mark as commit on disposeb
- the value of commit on dispose, true to always commit changespublic static void bindVirtualKeyboard(TextArea t, VirtualKeyboard vkb)
t
- the TextField to bind a VirualKeyboard to.vkb
- the binded VirualKeyboard.public static VirtualKeyboard getVirtualKeyboard(TextArea t)
t
- a TextField.that might have an associated VirtualKeyboard instance
public static boolean isCommitOnDispose(TextArea tf)
tf
- the text field
public static void setVKBTint(TextField tf, int tint)
tf
- the relevant text fieldtint
- the tint color with an alpha channelpublic static int getVKBTint(TextArea tf)
tf
- the relevant text field
public static boolean isShowTooltips()
public static void setShowTooltips(boolean aShowTooltips)
aShowTooltips
- true to show tooltipspublic static Transition getTransitionIn()
public static void setTransitionIn(Transition aTransitionIn)
aTransitionIn
- the transitionIn to setpublic static Transition getTransitionOut()
public static void setTransitionOut(Transition aTransitionOut)
aTransitionOut
- the transitionOut to setpublic void showKeyboard(boolean show)
showKeyboard
in interface VirtualKeyboardInterface
show
- it show is true open the relevant keyboard, if close dispose
the displayed keyboardpublic static void setDefaultVirtualKeyboardClass(java.lang.Class vkbClazz)
vkbClazz
- this class must extend VirtualKeyboard.public java.lang.String getVirtualKeyboardName()
VirtualKeyboardInterface
getVirtualKeyboardName
in interface VirtualKeyboardInterface
VirtualKeyboardInterface
public boolean isVirtualKeyboardShowing()
VirtualKeyboardInterface
isVirtualKeyboardShowing
in interface VirtualKeyboardInterface
VirtualKeyboardInterface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |