inputMethodCreationFailed = true;
return null;
}
Locale locale = locator.getLocale();
InputMethod inputMethodInstance = null;
// see whether we have a previously used input method
if (usedInputMethods != null) {
inputMethodInstance = (InputMethod) usedInputMethods.remove(locator.deriveLocator(null));
if (inputMethodInstance != null) {
if (locale != null) {
inputMethodInstance.setLocale(locale);
}
inputMethodInstance.setCharacterSubsets(characterSubsets);
Boolean state = (Boolean) perInputMethodState.remove(inputMethodInstance);
if (state != null) {
enableClientWindowNotification(inputMethodInstance, state.booleanValue());
}
((InputMethodContext) this).setInputMethodSupportsBelowTheSpot(
(!(inputMethodInstance instanceof InputMethodAdapter)) ||
((InputMethodAdapter) inputMethodInstance).supportsBelowTheSpot());
return inputMethodInstance;
}
}
// need to create new instance
try {
inputMethodInstance = locator.getDescriptor().createInputMethod();
if (locale != null) {
inputMethodInstance.setLocale(locale);
}
inputMethodInstance.setInputMethodContext((InputMethodContext) this);
inputMethodInstance.setCharacterSubsets(characterSubsets);
} catch (Exception e) {
logCreationFailed(e);
// there are a number of bad things that can happen while creating