| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.lang.String> |
appResourceBases
The resource bases.
|
protected java.util.Locale |
defaultLocale
The default locale.
|
protected java.util.List<java.lang.ref.WeakReference<Localizable>> |
localizables
Collection of known localizables, which have to be informed
of localization changes.
|
protected java.util.Map<java.util.Locale,ResourceBundleCollection> |
resourceBundles
The resource bundles.
|
ACTION_SUFFIX, DEBUG, SUFFIX_ACCELERATOR, SUFFIX_DESCRIPTION, SUFFIX_DISABLED_ICON, SUFFIX_ICON, SUFFIX_INACTIVE_ICON, SUFFIX_MNEMONIC, SUFFIX_TEXT, SUFFIX_TOOLTIP| Constructor and Description |
|---|
DefaultI18n() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_addAppResourceBase(java.lang.String base,
boolean prepend)
Add an application specific resource class base name.
|
protected void |
_addLocalizationChangeListener(Localizable localizable)
Add a listener for localization changes.
|
protected void |
_dumpResources(java.io.PrintStream out,
java.util.Locale locale)
Dump the complete currently known i18n resources for a given locale.
|
protected void |
_fireLocaleChanged(java.util.Locale locale)
Tell all registered localizables of localization changes.
|
protected java.util.ResourceBundle |
_getBundle(java.util.Locale l)
Get a ResourceBundle for a locale.
|
protected java.util.Locale |
_getDefaultLocale()
Get the locale to be used as a default for the application.
|
protected java.util.ResourceBundle |
_getFallbackBundle()
Get the fallback resource bundle.
|
protected void |
_removeLocalizationChangeListener(Localizable localizable)
Remove a listener for localization changes.
|
protected void |
_setDefaultLocale(java.util.Locale l)
Set the locale to be used as a default for the application.
|
addAppResourceBase, addAppResourceBase, addLocalizationChangeListener, dump, format, format, getDefaultLocale, getFormattedString, getFormattedString, getIcon, getIcon, getString, getString, removeLocalizationChangeListener, setDefaultLocaleprotected final java.util.Map<java.util.Locale,ResourceBundleCollection> resourceBundles
protected final java.util.List<java.lang.String> appResourceBases
protected java.util.Locale defaultLocale
protected final java.util.List<java.lang.ref.WeakReference<Localizable>> localizables
The localizables are only weakly referenced here.
protected void _addAppResourceBase(@NotNull java.lang.String base, boolean prepend)
_addAppResourceBase in class I18nbase - base class name for resourcesprepend - prepend this resource base?ResourceBundleprotected void _setDefaultLocale(java.util.Locale l)
_setDefaultLocale in class I18nl - locale to be used as default@NotNull protected java.util.Locale _getDefaultLocale()
_getDefaultLocale in class I18n@NotNull protected java.util.ResourceBundle _getBundle(@Nullable java.util.Locale l)
_getBundle in class I18nl - localejava.util.MissingResourceException - when no appResourceBase is setprotected java.util.ResourceBundle _getFallbackBundle()
_getFallbackBundle in class I18nprotected void _addLocalizationChangeListener(@NotNull Localizable localizable)
_addLocalizationChangeListener in class I18nlocalizable - listener for changesprotected void _removeLocalizationChangeListener(@NotNull Localizable localizable)
_removeLocalizationChangeListener in class I18nlocalizable - listener to be removedprotected void _fireLocaleChanged(java.util.Locale locale)
_fireLocaleChanged in class I18nlocale - new localeprotected void _dumpResources(@NotNull java.io.PrintStream out, @Nullable java.util.Locale locale)
_dumpResources in class I18nout - print stream where to dump tolocale - locale for which to dump the resources