< prev index next >
src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 55,73 ****
System.arraycopy(locales, 0, tmp, 0, locales.length);
return tmp;
}
static Object[] getAvailableLocalesInternal() {
! List<?> workList = nativeGetAvailableLocales();
!
! if (workList != null) {
! return workList.toArray();
! }
return new Object[] {
! Locale.getDefault()
};
}
/**
* @see java.awt.im.spi.InputMethodDescriptor#hasDynamicLocaleList
*/
--- 55,77 ----
System.arraycopy(locales, 0, tmp, 0, locales.length);
return tmp;
}
static Object[] getAvailableLocalesInternal() {
! List<Object> workList = nativeGetAvailableLocales();
! Locale currentLocale = CInputMethod.getNativeLocale();
+ if (workList == null || (workList != null && workList.isEmpty())) {
return new Object[] {
! currentLocale != null ? currentLocale : Locale.getDefault()
};
+ } else {
+ if (currentLocale != null && !workList.contains(currentLocale)) {
+ workList.add(currentLocale);
+ }
+ return workList.toArray();
+ }
}
/**
* @see java.awt.im.spi.InputMethodDescriptor#hasDynamicLocaleList
*/
*** 117,123 ****
",localelist=" + (hasDynamicLocaleList() ? "dynamic" : "static") +
"]";
}
private static native void nativeInit();
! private static native List<?> nativeGetAvailableLocales();
}
--- 121,127 ----
",localelist=" + (hasDynamicLocaleList() ? "dynamic" : "static") +
"]";
}
private static native void nativeInit();
! private static native List<Object> nativeGetAvailableLocales();
}
< prev index next >