java.awt.im.InputContext
Modifier and Type | Field and Description |
---|---|
private Component | |
private Character. | |
private Window | |
private Rectangle | |
private boolean | |
private boolean | |
private Component | |
private InputMethod | |
private boolean | |
private InputMethodLocator | |
private static AWTKeyStroke | |
private static final String | |
private static boolean | |
private static final String | |
private static final String | |
private static InputContext | |
private boolean | |
private static final PlatformLogger | |
private HashMap | |
private static InputMethod | |
private HashMap |
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
private void | activateInputMethod(boolean updateCompositionArea)
Activates the current input method of this input context, and grabs the composition area for use by this input context. |
private synchronized void | |
private boolean | addedClientWindowListeners()
Returns true if listeners have been set up for client window change notification. |
pack-priv synchronized void | changeInputMethod(InputMethodLocator newLocator)
Switches from the current input method to the one described by newLocator. |
private boolean | checkInputMethodSelectionKey(KeyEvent event)
Checks the key event is the input method selection key or not. |
public void | componentHidden(ComponentEvent
the event to be processed e)Implements java. Invoked when the component has been made invisible. |
public void | componentMoved(ComponentEvent
the event to be processed e)Implements java. Invoked when the component's position changes. |
public void | componentResized(ComponentEvent
the event to be processed e)Implements java. Invoked when the component's size changes. |
public void | componentShown(ComponentEvent
the event to be processed e)Implements java. Invoked when the component has been made visible. |
private void | |
public void | |
public void | dispatchEvent(AWTEvent
The event event)Overrides java. Dispatches an event to the active input method. |
public synchronized void | dispose()
Overrides java. Releases the resources used by this input context. |
pack-priv synchronized void | |
public synchronized void | endComposition()
Overrides java. Ends any input composition that may currently be going on in this context. |
private void | focusGained(Component
the component gaining the focus source)Handles focus gained events for any component that's using this input context. |
private void | |
pack-priv Component | |
pack-priv static Window | |
private synchronized InputMethod | |
public synchronized Object | getInputMethodControlObject()
Overrides java. Returns a control object from the current input method, or null. |
public String | |
private InputMethod | Returns: an InputMethod instanceReturns an instance of the input method described by the current input method locator. |
pack-priv InputMethodLocator | |
private AWTKeyStroke | |
public Locale | getLocale()
Overrides java. Returns the current locale of the current input method or keyboard layout. |
private void | initializeInputMethodSelectionKey()
Initializes the input method selection key definition in preference trees |
public boolean | isCompositionEnabled()
Overrides java. Determines whether the current input method is enabled for composition. |
private void | |
private synchronized void | |
public synchronized void | reconvert()
Overrides java. Asks the current input method to reconvert text from the current client component. |
private synchronized void | |
public synchronized void | removeNotify(Component
Client component component)Overrides java. 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. |
public synchronized boolean | selectInputMethod(Locale
The desired new locale. locale)Overrides java. 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. |
public void | setCharacterSubsets(Character.
The subsets of the Unicode character set from which characters may be input subsetsOverrides java. Sets the subsets of the Unicode character set that input methods of this input context should be allowed to input. |
public void | setCompositionEnabled(boolean
whether to enable the current input method for composition enable)Overrides java. Enables or disables the current input method for composition,
depending on the value of the parameter |
public void | windowActivated(WindowEvent
the event to be processed e)Implements java. Invoked when the Window is set to be the active Window. |
public void | windowClosed(WindowEvent
the event to be processed e)Implements java. Invoked when a window has been closed as the result of calling dispose on the window. |
public void | windowClosing(WindowEvent
the event to be processed e)Implements java. Invoked when the user attempts to close the window from the window's system menu. |
public void | windowDeactivated(WindowEvent
the event to be processed e)Implements java. Invoked when a Window is no longer the active Window. |
public void | windowDeiconified(WindowEvent
the event to be processed e)Implements java. Invoked when a window is changed from a minimized to a normal state. |
public void | windowIconified(WindowEvent
the event to be processed e)Implements java. Invoked when a window is changed from a normal to a minimized state. |
public void | windowOpened(WindowEvent
the event to be processed e)Implements java. Invoked the first time a window is made visible. |
awtFocussedComponent | back to summary |
---|---|
private Component awtFocussedComponent |
characterSubsets | back to summary |
---|---|
private Character. |
clientWindowListened | back to summary |
---|---|
private Window clientWindowListened |
clientWindowLocation | back to summary |
---|---|
private Rectangle clientWindowLocation |
clientWindowNotificationEnabled | back to summary |
---|---|
private boolean clientWindowNotificationEnabled |
compositionAreaHidden | back to summary |
---|---|
private boolean compositionAreaHidden |
currentClientComponent | back to summary |
---|---|
private Component currentClientComponent |
inputMethod | back to summary |
---|---|
private InputMethod inputMethod |
inputMethodCreationFailed | back to summary |
---|---|
private boolean inputMethodCreationFailed |
inputMethodLocator | back to summary |
---|---|
private InputMethodLocator inputMethodLocator |
inputMethodSelectionKey | back to summary |
---|---|
private static AWTKeyStroke inputMethodSelectionKey |
inputMethodSelectionKeyCodeName | back to summary |
---|---|
private static final String inputMethodSelectionKeyCodeName |
inputMethodSelectionKeyInitialized | back to summary |
---|---|
private static boolean inputMethodSelectionKeyInitialized |
inputMethodSelectionKeyModifiersName | back to summary |
---|---|
private static final String inputMethodSelectionKeyModifiersName |
inputMethodSelectionKeyPath | back to summary |
---|---|
private static final String inputMethodSelectionKeyPath |
inputMethodWindowContext | back to summary |
---|---|
private static InputContext inputMethodWindowContext |
isInputMethodActive | back to summary |
---|---|
private boolean isInputMethodActive |
log | back to summary |
---|---|
private static final PlatformLogger log |
perInputMethodState | back to summary |
---|---|
private HashMap<InputMethod, Boolean> perInputMethodState |
previousInputMethod | back to summary |
---|---|
private static InputMethod previousInputMethod |
usedInputMethods | back to summary |
---|---|
private HashMap<InputMethodLocator, InputMethod> usedInputMethods |
InputContext | back to summary |
---|---|
protected InputContext() Constructs an InputContext. |
activateInputMethod | back to summary |
---|---|
private void activateInputMethod(boolean updateCompositionArea) Activates the current input method of this input context, and grabs the composition area for use by this input context. If updateCompositionArea is true, the text in the composition area is updated (set to false if the text is going to change immediately to avoid screen flicker). |
addClientWindowListeners | back to summary |
---|---|
private synchronized void addClientWindowListeners() |
addedClientWindowListeners | back to summary |
---|---|
private boolean addedClientWindowListeners() Returns true if listeners have been set up for client window change notification. |
changeInputMethod | back to summary |
---|---|
pack-priv synchronized void changeInputMethod(InputMethodLocator newLocator) Switches from the current input method to the one described by newLocator. The current input method, if any, is asked to end composition, deactivated, and saved for future use. The newLocator is made the current locator. If the input context is active, an input method instance for the new locator is obtained; otherwise this is deferred until required. |
checkInputMethodSelectionKey | back to summary |
---|---|
private boolean checkInputMethodSelectionKey(KeyEvent event) Checks the key event is the input method selection key or not. |
componentHidden | back to summary |
---|---|
public void componentHidden(ComponentEvent e) Implements java. Doc from java. Invoked when the component has been made invisible.
|
componentMoved | back to summary |
---|---|
public void componentMoved(ComponentEvent e) Implements java. Doc from java. Invoked when the component's position changes.
|
componentResized | back to summary |
---|---|
public void componentResized(ComponentEvent e) Implements java. Doc from java. Invoked when the component's size changes.
|
componentShown | back to summary |
---|---|
public void componentShown(ComponentEvent e) Implements java. Doc from java. Invoked when the component has been made visible.
|
deactivateInputMethod | back to summary |
---|---|
private void deactivateInputMethod(boolean isTemporary) |
disableNativeIM | back to summary |
---|---|
public void disableNativeIM() Turns off the native IM. The native IM is disabled when the deactivate 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. |
dispatchEvent | back to summary |
---|---|
public void dispatchEvent(AWTEvent event) Overrides java. Doc from java. Dispatches an event to the active input method. Called by AWT. If no input method is available, then the event will never be consumed.
|
dispose | back to summary |
---|---|
public synchronized void dispose() Overrides java. Doc from java. 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.
|
enableClientWindowNotification | back to summary |
---|---|
pack-priv synchronized void enableClientWindowNotification(InputMethod requester, boolean enable) |
endComposition | back to summary |
---|---|
public synchronized void endComposition() Overrides java. Doc from java. 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. |
focusGained | back to summary |
---|---|
private void focusGained(Component source) Handles focus gained events for any component that's using this input context. These events are generated by AWT when the keyboard focus moves to a component. Besides actual client components, the source components may also be the composition area or any component in an input method window. When handling the focus event for a client component, this method checks whether the input context was previously active for a different client component, and if so, calls endComposition for the previous client component.
|
focusLost | back to summary |
---|---|
private void focusLost(Component source, boolean isTemporary) Handles focus lost events for any component that's using this input context. These events are generated by AWT when the keyboard focus moves away from a component. Besides actual client components, the source components may also be the composition area or any component in an input method window.
|
getClientComponent | back to summary |
---|---|
pack-priv Component getClientComponent() Returns the client component. |
getComponentWindow | back to summary |
---|---|
pack-priv static Window getComponentWindow(Component component) |
getInputMethod | back to summary |
---|---|
private synchronized InputMethod getInputMethod() |
getInputMethodControlObject | back to summary |
---|---|
public synchronized Object getInputMethodControlObject() Overrides java. Doc from java. 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.
|
getInputMethodInfo | back to summary |
---|---|
public String getInputMethodInfo()
|
getInputMethodInstance | back to summary |
---|---|
private InputMethod getInputMethodInstance() Returns an instance of the input method described by the current input method locator. This may be an input method that was previously used and switched out of, or a new instance. The locale, character subsets, and input method context of the input method are set. The inputMethodCreationFailed field is set to true if the instantiation failed.
|
getInputMethodLocator | back to summary |
---|---|
pack-priv InputMethodLocator getInputMethodLocator() |
getInputMethodSelectionKeyStroke | back to summary |
---|---|
private AWTKeyStroke getInputMethodSelectionKeyStroke(Preferences root) |
getLocale | back to summary |
---|---|
public Locale getLocale() Overrides java. Doc from java. 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
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,
|
initializeInputMethodSelectionKey | back to summary |
---|---|
private void initializeInputMethodSelectionKey() Initializes the input method selection key definition in preference trees
|
isCompositionEnabled | back to summary |
---|---|
public boolean isCompositionEnabled() Overrides java. Doc from java. 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.
|
logCreationFailed | back to summary |
---|---|
private void logCreationFailed(Throwable throwable) |
notifyClientWindowChange | back to summary |
---|---|
private synchronized void notifyClientWindowChange(Window window) |
reconvert | back to summary |
---|---|
public synchronized void reconvert() Overrides java. Doc from java. 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
|
removeClientWindowListeners | back to summary |
---|---|
private synchronized void removeClientWindowListeners() |
removeNotify | back to summary |
---|---|
public synchronized void removeNotify(Component component) Overrides java. Doc from java. 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
|
selectInputMethod | back to summary |
---|---|
public synchronized boolean selectInputMethod(Locale locale) Overrides java. Doc from java. 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,
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.
|
setCharacterSubsets | back to summary |
---|---|
public void setCharacterSubsets(Character. Overrides java. Doc from java. 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.
|
setCompositionEnabled | back to summary |
---|---|
public void setCompositionEnabled(boolean enable) Overrides java. Doc from java. Enables or disables the current input method for composition,
depending on the value of the parameter 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
|
windowActivated | back to summary |
---|---|
public void windowActivated(WindowEvent e) Implements java. Doc from java. 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.
|
windowClosed | back to summary |
---|---|
public void windowClosed(WindowEvent e) Implements java. Doc from java. Invoked when a window has been closed as the result of calling dispose on the window.
|
windowClosing | back to summary |
---|---|
public void windowClosing(WindowEvent e) Implements java. Doc from java. Invoked when the user attempts to close the window from the window's system menu.
|
windowDeactivated | back to summary |
---|---|
public void windowDeactivated(WindowEvent e) Implements java. Doc from java. 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.
|
windowDeiconified | back to summary |
---|---|
public void windowDeiconified(WindowEvent e) Implements java. Doc from java. Invoked when a window is changed from a minimized to a normal state.
|
windowIconified | back to summary |
---|---|
public void windowIconified(WindowEvent e) Implements java. Doc from java. 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.
|
windowOpened | back to summary |
---|---|
public void windowOpened(WindowEvent e) Implements java. Doc from java. Invoked the first time a window is made visible.
|