public interface HKeyboardInputPreferred
HKeyboardInputPreferred
indicates that this component expects to receive both HKeyEvent and HTextEvent input events.
All interoperable implementations of the HKeyboardInputPreferred
interface must extend HComponent.
The set of characters which the component expects to receive via
HKeyEvent events is defined by
the return code from the getType() method.
When this component has focus, platforms without a physical means
of generating key events with the desired range of characters will
provide another means for keyboard entry e.g. by offering an
on-screen "virtual" keyboard. Applications can query the system about
the support of specific keyCodes through the HKeyCapabilities.isSupported(int) method.
Note that the java.awt.Component method isFocusTraversable should
always return true for a java.awt.Component
implementing this interface.
| Modifier and Type | Field and Description |
|---|---|
static int |
INPUT_ALPHA
This constant indicates that the component requires
alphabetic input, as determined by the
java.lang.Character isLetter method. |
static int |
INPUT_ANY
Indicates that the component requires any possible character as
input, as determined by the
java.lang.Character
isDefined method. |
static int |
INPUT_CUSTOMIZED
Indicates that the component requires as input the characters
present in the array returned from the
getValidInput() method. |
static int |
INPUT_NUMERIC
This constant indicates that the component requires
numeric input, as determined by the
java.lang.Character isDigit method. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getEditMode()
Get the editing mode for this
HKeyboardInputPreferred. |
int |
getType()
Retrieve the desired input type for this component.
|
char[] |
getValidInput()
Retrieve the customized input character range.
|
void |
processHKeyEvent(HKeyEvent evt)
Process an
HKeyEvent
sent to this HKeyboardInputPreferred. |
void |
processHTextEvent(HTextEvent evt)
Process an
HTextEvent sent to this HKeyboardInputPreferred. |
void |
setEditMode(boolean edit)
Set the editing mode for this
HKeyboardInputPreferred. |
static final int INPUT_NUMERIC
java.lang.Character isDigit method.static final int INPUT_ALPHA
java.lang.Character isLetter method.static final int INPUT_ANY
java.lang.Character
isDefined method.static final int INPUT_CUSTOMIZED
getValidInput() method.boolean getEditMode()
HKeyboardInputPreferred.
If the returned value is true the
component is in edit mode, and its textual content may be
changed through user interaction such as keyboard events.
The component is switched into and out of edit mode on
receiving HTextEvent.TEXT_START_CHANGE
and HTextEvent.TEXT_END_CHANGE
events.
true if this component is in edit mode,
false otherwise.void setEditMode(boolean edit)
HKeyboardInputPreferred.
This method is provided for the convenience of component implementors. Interoperable applications shall not call this method. It cannot be made protected because interfaces cannot have protected methods.
edit - true to switch this component into edit mode, false
otherwise.getEditMode()int getType()
INPUT_ANY,
INPUT_NUMERIC,
INPUT_ALPHA,
or INPUT_CUSTOMIZED.char[] getValidInput()
getType() returns a value with the INPUT_CUSTOMIZED
bit set then this method shall return an array containing the
range of customized input keys. If the range of customized input
keys has not been set then this method shall return a zero length
char array. This method shall return null if
getType() returns a value without the
INPUT_CUSTOMIZED bit set.null.void processHTextEvent(HTextEvent evt)
HTextEvent sent to this HKeyboardInputPreferred.evt - the HTextEvent
to process.void processHKeyEvent(HKeyEvent evt)
HKeyEvent
sent to this HKeyboardInputPreferred.evt - the HKeyEvent
to process.Copyright © 2012 code4tv.com. All Rights Reserved.