// Otherwise, we only pass on input and focus events, because
// a) input methods shouldn't know about semantic or component-level events
// b) passing on the events takes time
// c) isConsumed() is always true for semantic events.
(e instanceof InputEvent) || (e instanceof FocusEvent)) {
InputContext inputContext = getInputContext();
if (inputContext != null) {
inputContext.dispatchEvent(e);
if (e.isConsumed()) {
if ((e instanceof FocusEvent) && focusLog.isLoggable(PlatformLogger.FINEST)) {
focusLog.finest("3579: Skipping " + e);
}
return;
}
}
}
} else {
// When non-clients get focus, we need to explicitly disable the native
// input method. The native input method is actually not disabled when
// the active/passive/peered clients loose focus.
if (id == FocusEvent.FOCUS_GAINED) {
InputContext inputContext = getInputContext();
if (inputContext != null && inputContext instanceof sun.awt.im.InputContext) {
((sun.awt.im.InputContext)inputContext).disableNativeIM();
}
}
}