Class Overview
InputMethodManager
is an abstract class that manages the input
method environment of JVM. There is only one InputMethodManager
instance in JVM that is executed under a separate daemon thread.
InputMethodManager
performs the following:
-
Keeps track of the current input context.
-
Provides a user interface to switch input methods and notifies the current
input context about changes made from the user interface.
The mechanism for supporting input method switch is as follows. (Note that
this may change in future releases.)
-
One way is to use platform-dependent window manager's menu (known as the Window
menu in Motif and the System menu or Control menu in
Win32) on each window which is popped up by clicking the left top box of
a window (known as Window menu button in Motif and System menu
button in Win32). This happens to be common in both Motif and Win32.
-
When more than one input method descriptor can be found or the only input
method descriptor found supports multiple locales, a menu item
is added to the window (manager) menu. This item label is obtained invoking
getTriggerMenuString()
. If null is returned by this method, it
means that there is only input method or none in the environment. Frame and Dialog
invoke this method.
-
This menu item means a trigger switch to the user to pop up a selection
menu.
-
When the menu item of the window (manager) menu has been selected by the
user, Frame/Dialog invokes
notifyChangeRequest()
to notify
InputMethodManager
that the user wants to switch input methods.
-
InputMethodManager
displays a pop-up menu to choose an input method.
-
InputMethodManager
notifies the current InputContext
of
the selected InputMethod
.
-
The other way is to use user-defined hot key combination to show the pop-up menu to
choose an input method. This is useful for the platforms which do not provide a
way to add a menu item in the window (manager) menu.
-
When the hot key combination is typed by the user, the component which has the input
focus invokes
notifyChangeRequestByHotKey()
to notify
InputMethodManager
that the user wants to switch input methods.
-
This results in a popup menu and notification to the current input context,
as above.
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
Public Constructors
public
InputMethodManager
()
Public Methods
Returns the instance of InputMethodManager. This method creates
the instance that is unique in the Java VM if it has not been
created yet.
Returns
- the InputMethodManager instance
public
abstract
String
getTriggerMenuString
()
Gets a string for the trigger menu item that should be added to
the window manager menu. If no need to display the trigger menu
item, null is returned.
public
abstract
void
notifyChangeRequest
(Component comp)
Notifies InputMethodManager that input method change has been
requested by the user. This notification triggers a popup menu
for user selection.
Parameters
comp
| Component that has accepted the change
request. This component has to be a Frame or Dialog.
|
public
abstract
void
notifyChangeRequestByHotKey
(Component comp)
Notifies InputMethodManager that input method change has been
requested by the user using the hot key combination. This
notification triggers a popup menu for user selection.
Parameters
comp
| Component that has accepted the change
request. This component has the input focus.
|