|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InputMethod
This interface supports complex text input, often for situations where the text is more complex than a keyboard will accomodate. For example, this can be used for Chinese, Japanese, and Korean, where multiple keystrokes are necessary to compose text. This could also support things like phonetic English, or reordering Thai.
These contexts can be loaded by the input method framework, using
InputContext.selectInputMethod(Locale)
.
Method Summary | |
---|---|
void |
activate()
Activate this input method for input processing. |
void |
deactivate(boolean isTemporary)
Deactivate this input method, either temporarily or permanently for the given client. |
void |
dispatchEvent(AWTEvent event)
Dispatch an event to the input method. |
void |
dispose()
Disposes the input method and release any resources it is using. |
void |
endComposition()
End any input composition currently taking place. |
Object |
getControlObject()
Returns a control object from this input method, or null. |
Locale |
getLocale()
Returns the current input locale, or null if none is defined. |
void |
hideWindows()
Close or hide all windows opened by this input method. |
boolean |
isCompositionEnabled()
Find out if this input method is enabled. |
void |
notifyClientWindowChange(Rectangle bounds)
Notify this input method of changes in the client window. |
void |
reconvert()
Starts a reconversion operation. |
void |
removeNotify()
Notify the input method that a client component has been removed from its hierarchy, or that input method support has been disabled. |
void |
setCharacterSubsets(Character.Subset[] subsets)
Sets the allowed Unicode subsets that this input method can use. |
void |
setCompositionEnabled(boolean enable)
Changes the enabled status of this input method. |
void |
setInputMethodContext(InputMethodContext context)
Set the input method context, which ties the input method to a client component. |
boolean |
setLocale(Locale locale)
Sets the input locale. |
Method Detail |
---|
void setInputMethodContext(InputMethodContext context)
context
- the context for this input method
NullPointerException
- if context is nullboolean setLocale(Locale locale)
InputContext.selectInputMethod(Locale)
when the user specifies
a locale, or when the previously selected input method had a locale.
locale
- the locale to use for input
NullPointerException
- if locale is nullLocale getLocale()
InputContext.getLocale()
, or before switching input
methods.
void setCharacterSubsets(Character.Subset[] subsets)
InputContext.setCharacterSubsets(Character.Subset[])
.
subsets
- the accepted subsets for this input method, or null for allvoid setCompositionEnabled(boolean enable)
InputContext.setCompositionEnabled(boolean)
or when
switching from an input method if the previous input method returned
without exception on isCompositionEnabled()
.
enable
- whether to enable this input method
UnsupportedOperationException
- if enabling/disabling is unsupportedisCompositionEnabled()
boolean isCompositionEnabled()
InputContext.isCompositionEnabled()
, or when switching input
methods via InputContext.selectInputMethod(Locale)
.
UnsupportedOperationException
- if enabling/disabling is unsupportedsetCompositionEnabled(boolean)
void reconvert()
InputMethodRequests#getSelectedText(Attribute[])
.
Then the composed and committed text produced by the operation is sent
back to the client using a sequence of InputMethodEvents. This is called
by InputContext.reconvert()
.
UnsupportedOperationException
- if reconversion is unsupportedvoid dispatchEvent(AWTEvent event)
InputContext.dispatchEvent(AWTEvent)
.
event
- the event to dispatch
NullPointerException
- if event is nullvoid notifyClientWindowChange(Rectangle bounds)
InputMethodContext.enableClientWindowNotification(InputMethod, boolean)
,
if InputContext.removeNotify(Component)
has not been called.
The following situations trigger a notification:removeNotify
was
called on a previous client.
bounds
- the client window's current bounds, or nullvoid activate()
void deactivate(boolean isTemporary)
hideWindows()
will be called on this instance.
This method is called when a client component receives a
FOCUS_LOST event, when switching to another input method, or before
removeNotify()
when the client is removed.
isTemporary
- true if the focus change is temporaryvoid hideWindows()
dispose()
on this instance. It is only called when the input
method is inactive.
void removeNotify()
InputContext.removeNotify(Component)
, and only when the input
method is inactive.
void endComposition()
InputContext.endComposition()
, when switching to a
new input method, or by InputContext.selectInputMethod(Locale)
.
void dispose()
InputContext.dispose()
, when the input method is
inactive; and nothing will be called on this instance afterwards.
Object getControlObject()
InputContext.getInputMethodControlObject()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |