java.lang.Object | ||
↳ | java.awt.im.InputContext | |
↳ | sun.awt.im.InputContext |
![]() |
This InputContext class contains parts of the implementation of java.text.im.InputContext. These parts have been moved here to avoid exposing protected members that are needed by the subclass InputMethodContext.
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an InputContext.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invoked when the component has been made invisible.
| |||||||||||
Invoked when the component's position changes.
| |||||||||||
Invoked when the component's size changes.
| |||||||||||
Invoked when the component has been made visible.
| |||||||||||
Turns off the native IM.
| |||||||||||
Dispatches an event to the active input method.
| |||||||||||
Releases the resources used by this input context.
| |||||||||||
Ends any input composition that may currently be going on in this
context.
| |||||||||||
Returns a control object from the current input method, or null.
| |||||||||||
Returns the current locale of the current input method or keyboard
layout.
| |||||||||||
Determines whether the current input method is enabled for composition.
| |||||||||||
Asks the current input method to reconvert text from the
current client component.
| |||||||||||
Notifies the input context that a client component has been
removed from its containment hierarchy, or that input method
support has been disabled for the component.
| |||||||||||
Attempts to select an input method or keyboard layout that
supports the given locale, and returns a value indicating whether such
an input method or keyboard layout has been successfully selected.
| |||||||||||
Sets the subsets of the Unicode character set that input methods of this input
context should be allowed to input.
| |||||||||||
Enables or disables the current input method for composition,
depending on the value of the parameter
enable . | |||||||||||
Invoked when the Window is set to be the active Window.
| |||||||||||
Invoked when a window has been closed as the result
of calling dispose on the window.
| |||||||||||
Invoked when the user attempts to close the window
from the window's system menu.
| |||||||||||
Invoked when a Window is no longer the active Window.
| |||||||||||
Invoked when a window is changed from a minimized
to a normal state.
| |||||||||||
Invoked when a window is changed from a normal to a
minimized state.
| |||||||||||
Invoked the first time a window is made visible.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructs an InputContext.
Turns off the native IM. The native IM is diabled when the deactive method of InputMethod is called. It is delayed until the active method is called on a different peer component. This method is provided to explicitly disable the native IM.
Dispatches an event to the active input method. Called by AWT. If no input method is available, then the event will never be consumed.
event | The event |
---|
Releases the resources used by this input context. Called by AWT for the default input context of each Window. If no input methods are available, then this method has no effect.
IllegalStateException | when the currentClientComponent is not null |
---|
Ends any input composition that may currently be going on in this context. Depending on the platform and possibly user preferences, this may commit or delete uncommitted text. Any changes to the text are communicated to the active component using an input method event. If no input methods are available, then this method has no effect.
A text editing component may call this in a variety of situations, for example, when the user moves the insertion point within the text (but outside the composed text), or when the component's text is saved to a file or copied to the clipboard.
Returns a control object from the current input method, or null. A control object provides methods that control the behavior of the input method or obtain information from the input method. The type of the object is an input method specific class. Clients have to compare the result against known input method control object classes and cast to the appropriate class to invoke the methods provided.
If no input methods are available or the current input method does not provide an input method control object, then null is returned.
UnsupportedOperationException | when input method is null |
---|
Returns the current locale of the current input method or keyboard
layout.
Returns null if the input context does not have a current input method
or keyboard layout or if the current input method's
getLocale()
method returns null.
Not all host operating systems provide API to determine the locale of
the currently selected native input method or keyboard layout.
For host operating systems that don't provide such API,
getLocale
assumes that the current locale of all native
input methods or keyboard layouts provided by the host operating system
is the system's default locale.
Determines whether the current input method is enabled for composition. An input method that is enabled for composition interprets incoming events for both composition and control purposes, while a disabled input method does not interpret events for composition.
true
if the current input method is enabled for
composition; false
otherwiseUnsupportedOperationException | when input method is null |
---|
Asks the current input method to reconvert text from the
current client component. The input method obtains the text to
be reconverted from the client component using the
InputMethodRequests.getSelectedText
method. The other InputMethodRequests
methods
must be prepared to deal with further information requests by
the input method. The composed and/or committed text will be
sent to the client component as a sequence of
InputMethodEvent
s. If the input method cannot
reconvert the given text, the text is returned as committed
text in an InputMethodEvent
.
UnsupportedOperationException | when input method is null |
---|
Notifies the input context that a client component has been
removed from its containment hierarchy, or that input method
support has been disabled for the component. This method is
usually called from the client component's
Component.removeNotify
method. Potentially pending input from input methods
for this component is discarded.
If no input methods are available, then this method has no effect.
component | Client component |
---|
NullPointerException | when the component is null. |
---|
Attempts to select an input method or keyboard layout that supports the given locale, and returns a value indicating whether such an input method or keyboard layout has been successfully selected. The following steps are taken until an input method has been selected:
Not all host operating systems provide API to determine the locale of
the currently selected native input method or keyboard layout, and to
select a native input method or keyboard layout by locale.
For host operating systems that don't provide such API,
selectInputMethod
assumes that native input methods or
keyboard layouts provided by the host operating system support only the
system's default locale.
A text editing component may call this method, for example, when the user changes the insertion point, so that the user can immediately continue typing in the language of the surrounding text.
locale | The desired new locale. |
---|
NullPointerException | when the locale is null. |
---|
Sets the subsets of the Unicode character set that input methods of this input context should be allowed to input. Null may be passed in to indicate that all characters are allowed. The initial value is null. The setting applies to the current input method as well as input methods selected after this call is made. However, applications cannot rely on this call having the desired effect, since this setting cannot be passed on to all host input methods - applications still need to apply their own character validation. If no input methods are available, then this method has no effect.
subsets | The subsets of the Unicode character set from which characters may be input |
---|
Enables or disables the current input method for composition,
depending on the value of the parameter enable
.
An input method that is enabled for composition interprets incoming events for both composition and control purposes, while a disabled input method does not interpret events for composition. Note however that events are passed on to the input method regardless whether it is enabled or not, and that an input method that is disabled for composition may still interpret events for control purposes, including to enable or disable itself for composition.
For input methods provided by host operating systems, it is not always possible to
determine whether this operation is supported. For example, an input method may enable
composition only for some locales, and do nothing for other locales. For such input
methods, it is possible that this method does not throw
UnsupportedOperationException
,
but also does not affect whether composition is enabled.
enable | whether to enable the current input method for composition |
---|
UnsupportedOperationException | when input method is null |
---|
Invoked when the Window is set to be the active Window. Only a Frame or a Dialog can be the active Window. The native windowing system may denote the active Window or its children with special decorations, such as a highlighted title bar. The active Window is always either the focused Window, or the first Frame or Dialog that is an owner of the focused Window.
Invoked when a window has been closed as the result of calling dispose on the window.
Invoked when the user attempts to close the window from the window's system menu.
Invoked when a Window is no longer the active Window. Only a Frame or a Dialog can be the active Window. The native windowing system may denote the active Window or its children with special decorations, such as a highlighted title bar. The active Window is always either the focused Window, or the first Frame or Dialog that is an owner of the focused Window.
Invoked when a window is changed from a minimized to a normal state.
Invoked when a window is changed from a normal to a minimized state. For many platforms, a minimized window is displayed as the icon specified in the window's iconImage property.