src/macosx/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java
Print this page
@@ -39,10 +39,11 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicReferenceArray;
import java.util.spi.CalendarDataProvider;
+import java.util.spi.CalendarNameProvider;
import java.util.spi.CurrencyNameProvider;
import java.util.spi.LocaleNameProvider;
import java.util.spi.TimeZoneNameProvider;
/**
@@ -322,29 +323,43 @@
public boolean isSupportedLocale(Locale locale) {
return isSupportedCalendarLocale(locale);
}
@Override
- public String getDisplayName(String calType, int field, int value,
- int style, Locale locale) {
- return null;
+ public int getFirstDayOfWeek(Locale locale) {
+ return getCalendarInt(locale.toLanguageTag(), CD_FIRSTDAYOFWEEK);
}
@Override
- public Map<String, Integer> getDisplayNames(String calType,
- int field, int style, Locale locale) {
- return null;
+ public int getMinimalDaysInFirstWeek(Locale locale) {
+ return getCalendarInt(locale.toLanguageTag(), CD_MINIMALDAYSINFIRSTWEEK);
+ }
+ };
}
+ public static CalendarNameProvider getCalendarNameProvider() {
+ return new CalendarNameProvider() {
@Override
- public int getFirstDayOfWeek(Locale locale) {
- return getCalendarInt(locale.toLanguageTag(), CD_FIRSTDAYOFWEEK);
+ public Locale[] getAvailableLocales() {
+ return getSupportedCalendarLocales();
}
@Override
- public int getMinimalDaysInFirstWeek(Locale locale) {
- return getCalendarInt(locale.toLanguageTag(), CD_MINIMALDAYSINFIRSTWEEK);
+ public boolean isSupportedLocale(Locale locale) {
+ return isSupportedCalendarLocale(locale);
+ }
+
+ @Override
+ public String getDisplayName(String calType, int field, int value,
+ int style, Locale locale) {
+ return null;
+ }
+
+ @Override
+ public Map<String, Integer> getDisplayNames(String calType,
+ int field, int style, Locale locale) {
+ return null;
}
};
}
public static CurrencyNameProvider getCurrencyNameProvider() {