370 private void activateInputMethod(boolean updateCompositionArea) {
371 // call hideWindows() if this input context uses a different
372 // input method than the previously activated one
373 if (inputMethodWindowContext != null && inputMethodWindowContext != this &&
374 inputMethodWindowContext.inputMethodLocator != null &&
375 !inputMethodWindowContext.inputMethodLocator.sameInputMethod(inputMethodLocator) &&
376 inputMethodWindowContext.inputMethod != null) {
377 inputMethodWindowContext.inputMethod.hideWindows();
378 }
379 inputMethodWindowContext = this;
380
381 if (inputMethod != null) {
382 if (previousInputMethod != inputMethod &&
383 previousInputMethod instanceof InputMethodAdapter) {
384 // let the host adapter pass through the input events for the
385 // new input method
386 ((InputMethodAdapter) previousInputMethod).stopListening();
387 }
388 previousInputMethod = null;
389
390 if (log.isLoggable(PlatformLogger.FINE)) log.fine("Current client component " + currentClientComponent);
391 if (inputMethod instanceof InputMethodAdapter) {
392 ((InputMethodAdapter) inputMethod).setClientComponent(currentClientComponent);
393 }
394 inputMethod.activate();
395 isInputMethodActive = true;
396
397 if (perInputMethodState != null) {
398 Boolean state = perInputMethodState.remove(inputMethod);
399 if (state != null) {
400 clientWindowNotificationEnabled = state.booleanValue();
401 }
402 }
403 if (clientWindowNotificationEnabled) {
404 if (!addedClientWindowListeners()) {
405 addClientWindowListeners();
406 }
407 synchronized(this) {
408 if (clientWindowListened != null) {
409 notifyClientWindowChange(clientWindowListened);
410 }
|
370 private void activateInputMethod(boolean updateCompositionArea) {
371 // call hideWindows() if this input context uses a different
372 // input method than the previously activated one
373 if (inputMethodWindowContext != null && inputMethodWindowContext != this &&
374 inputMethodWindowContext.inputMethodLocator != null &&
375 !inputMethodWindowContext.inputMethodLocator.sameInputMethod(inputMethodLocator) &&
376 inputMethodWindowContext.inputMethod != null) {
377 inputMethodWindowContext.inputMethod.hideWindows();
378 }
379 inputMethodWindowContext = this;
380
381 if (inputMethod != null) {
382 if (previousInputMethod != inputMethod &&
383 previousInputMethod instanceof InputMethodAdapter) {
384 // let the host adapter pass through the input events for the
385 // new input method
386 ((InputMethodAdapter) previousInputMethod).stopListening();
387 }
388 previousInputMethod = null;
389
390 if (log.isLoggable(PlatformLogger.FINE)) {
391 log.fine("Current client component " + currentClientComponent);
392 }
393 if (inputMethod instanceof InputMethodAdapter) {
394 ((InputMethodAdapter) inputMethod).setClientComponent(currentClientComponent);
395 }
396 inputMethod.activate();
397 isInputMethodActive = true;
398
399 if (perInputMethodState != null) {
400 Boolean state = perInputMethodState.remove(inputMethod);
401 if (state != null) {
402 clientWindowNotificationEnabled = state.booleanValue();
403 }
404 }
405 if (clientWindowNotificationEnabled) {
406 if (!addedClientWindowListeners()) {
407 addClientWindowListeners();
408 }
409 synchronized(this) {
410 if (clientWindowListened != null) {
411 notifyClientWindowChange(clientWindowListened);
412 }
|