public class LanguageManager extends java.lang.Object implements LanguageConstants
Be aware of the fact that all equal key-language pairs will be merged and collected into a global data map. The original list of dictionaries will be preserved and will not be modified, but all translation will be taken from global data map.
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
checkComponentsTextForTranslations
Whether or not components should check that text passed into their constructors is a translation key or not.
|
static java.lang.String |
COMPONENT_LANGUAGE_LISTENER_KEY |
static java.lang.String |
COMPONENT_UPDATER_KEY
Keys used to store custom data in JComponent.
|
protected static java.util.Map<java.awt.Component,java.lang.String> |
componentKeysCache
Calculated components cache map.
|
protected static java.util.Map<javax.swing.JComponent,java.lang.ref.WeakReference<LanguageListener>> |
componentLanguageListeners
Language changes listeners.
|
protected static java.util.Map<javax.swing.JComponent,java.lang.String> |
components
Components registered for auto-translation.
|
protected static java.util.Map<javax.swing.JComponent,java.lang.Object[]> |
componentsData
Object data provided with component language key.
|
protected static java.util.Map<java.awt.Component,javax.swing.event.AncestorListener> |
componentsListeners
Components ancestor listeners used to update component keys cache.
|
protected static java.lang.Object |
componentsLock
Component operations synchronization object.
|
protected static java.util.Map<javax.swing.JComponent,java.lang.ref.WeakReference<LanguageUpdater>> |
customUpdaters
Component-specific language updaters.
|
protected static java.lang.String |
DEFAULT
Default WebLaF language.
|
protected static TooltipType |
defaultTooltipType
Default tooltip type used to display tooltips provided inside language files.
|
protected static java.util.List<Dictionary> |
dictionaries
List of all added dictionaries.
|
protected static java.util.Map<java.lang.String,Dictionary> |
dictionariesCache
All dictionaries cached by their special source ID.
|
protected static java.util.Map<java.lang.String,Value> |
globalCache
Global values map that contains merged translations for currently selected language.
|
protected static Dictionary |
globalDictionary
Global dictionary merged from all added dictionaries.
|
protected static boolean |
initialized
Manager initialization mark.
|
protected static java.lang.String |
language
Currently used language.
|
protected static java.util.Map<java.awt.Container,java.lang.String> |
languageContainers
Registered language containers.
|
protected static java.lang.Object |
languageContainersLock
Language container operations synchronization object.
|
protected static java.util.Map<java.lang.String,javax.swing.ImageIcon> |
languageIcons
Language icons.
|
protected static java.util.Map<java.lang.String,java.util.List<LanguageKeyListener>> |
languageKeyListeners
Language key changes listeners.
|
protected static java.lang.Object |
languageKeyListenersLock
Language key listeners operations synchronization object.
|
protected static java.util.List<LanguageListener> |
languageListeners
Language changes listeners.
|
protected static java.lang.Object |
languageListenersLock
Language listeners operations synchronization object.
|
protected static LanguageUpdaterComparator |
languageUpdaterComparator
Special comparator for sorting LanguageUpdaters list.
|
static javax.swing.ImageIcon |
other
Unknown language icon.
|
protected static java.util.List<java.lang.String> |
supportedLanguages
Predefined list of languages supported by WebLaF.
|
protected static java.lang.Object |
supportedLanguagesLock
Supported languages operations synchronization object.
|
protected static TooltipLanguageSupport |
tooltipLanguageSupport
Current tooltip support.
|
protected static boolean |
updateLocale
Whether or not locale should be updated along with adjustment of the language.
|
protected static java.util.List<LanguageUpdater> |
updaters
Registered language updaters.
|
protected static java.util.Map<java.lang.Class,LanguageUpdater> |
updatersCache
Language updaters cache by specific class types.
|
protected static java.lang.Object |
updatersLock
LanguageUpdater operations synchronization object.
|
| Constructor and Description |
|---|
LanguageManager() |
| Modifier and Type | Method and Description |
|---|---|
static Dictionary |
addDictionary(java.lang.Class nearClass,
java.lang.String resource)
Adds new language dictionary into LanguageManager.
|
static Dictionary |
addDictionary(Dictionary dictionary)
Adds new language dictionary into LanguageManager.
|
static Dictionary |
addDictionary(java.io.File file)
Adds new language dictionary into LanguageManager.
|
static Dictionary |
addDictionary(java.lang.String path)
Adds new language dictionary into LanguageManager.
|
static Dictionary |
addDictionary(java.lang.String cacheKey,
Dictionary dictionary)
Adds new language dictionary into LanguageManager.
|
static Dictionary |
addDictionary(java.net.URL url)
Adds new language dictionary into LanguageManager.
|
static void |
addLanguageKeyListener(java.lang.String key,
LanguageKeyListener listener)
Adds language key listener.
|
static void |
addLanguageListener(javax.swing.JComponent component,
LanguageListener listener)
Adds language listener for the specified component.
|
static void |
addLanguageListener(LanguageListener listener)
Adds new language listener.
|
static void |
addSupportedLanguage(java.lang.String language)
Adds supported language.
|
static void |
addSupportedLanguage(java.lang.String language,
Dictionary dictionary)
Adds supported language and new dictionary.
|
protected static void |
clearCache()
Clears global dictionaries cache.
|
static void |
clearDictionaries()
Removes all added dictionaries including WebLaF ones.
|
static void |
clearSupportedLanguages()
Clears list of supported languages.
|
static java.lang.String |
combineWithContainerKeys(javax.swing.JComponent component,
java.lang.String key)
Returns component language key combined with its containers keys.
|
protected static java.lang.String |
combineWithContainerKeysImpl(javax.swing.JComponent component,
java.lang.String key)
Returns component language key combined with its containers keys.
|
static boolean |
contains(java.lang.String key)
Returns whether specified language key exists or not.
|
protected static void |
fireAllLanguageKeysUpdated()
Fires language key updated event for all language keys.
|
protected static void |
fireDictionariesCleared()
Fires dictionaries cleared event whenever all dictionaries are removed from LanguageManager.
|
protected static void |
fireDictionaryAdded(Dictionary dictionary)
Fires dictionary added event whenever new dictionary is added into LanguageManager.
|
protected static void |
fireDictionaryRemoved(Dictionary dictionary)
Fires dictionary removed event whenever dictionary is removed from LanguageManager.
|
protected static void |
fireLanguageChanged(java.lang.String oldLang,
java.lang.String newLang)
Fires language changed event whenever current language changes.
|
protected static void |
fireLanguageKeyUpdated(java.lang.String key)
Fires language key updated event whenever specified dictionary key is updated with new translation.
|
static java.lang.String |
get(javax.swing.JComponent component,
java.lang.String key)
Returns component translation.
|
static java.lang.String |
get(java.lang.String key)
Returns translation for the specified language key.
|
static java.lang.String |
get(java.lang.String key,
java.lang.Object... data)
Returns translation for the specified language key.
|
static java.lang.String |
getComponentKey(javax.swing.JComponent component)
Returns component language key.
|
static java.util.Map<java.awt.Component,LanguageListener> |
getComponentLanguageListeners()
Returns component language listeners.
|
static java.lang.String |
getDefaultLanguage()
Returns default language.
|
static java.lang.String |
getDefaultLanguageKey()
Returns default language key.
|
static TooltipType |
getDefaultTooltipType()
Returns default tooltip type.
|
static java.util.List<Dictionary> |
getDictionaries()
Returns all dictionaries added into LanguageManager.
|
static Dictionary |
getDictionary(java.lang.String id)
Returns dictionary for the specified ID or null if it was not found.
|
static java.lang.String |
getDictionaryCacheKey(java.lang.Class nearClass,
java.lang.String resource)
Returns dictionary cache key.
|
static java.lang.String |
getDictionaryCacheKey(java.io.File file)
Returns dictionary cache key.
|
static java.lang.String |
getDictionaryCacheKey(java.lang.String path)
Returns dictionary cache key.
|
static java.lang.String |
getDictionaryCacheKey(java.net.URL url)
Returns dictionary cache key.
|
static Dictionary |
getGlobalDictionary()
Returns global dictionary that aggregates all added dictionaries.
|
static java.lang.String |
getLanguage()
Returns currently used language.
|
static java.lang.String |
getLanguageContainerKey(java.awt.Container container)
Returns language container key for the specified container.
|
static javax.swing.ImageIcon |
getLanguageIcon(java.lang.String language)
Returns icon for the specified language.
|
static java.util.Map<java.lang.String,java.util.List<LanguageKeyListener>> |
getLanguageKeyListeners()
Returns language key listeners.
|
static java.util.List<LanguageListener> |
getLanguageListeners()
Returns language listeners.
|
static java.lang.String |
getLanguageTitle(java.lang.String language)
Returns language title in that language translation.
|
static LanguageUpdater |
getLanguageUpdater(javax.swing.JComponent component)
Returns LanguageUpdater currently used for the specified component.
|
static java.util.Locale |
getLocale(java.lang.String language)
Returns Locale for the specified language.
|
static java.lang.Character |
getMnemonic(javax.swing.JComponent component,
java.lang.String key)
Returns component mnemonic.
|
static java.lang.Character |
getMnemonic(java.lang.String key)
Returns mnemonic for the specified language key.
|
static Value |
getNotNullValue(javax.swing.JComponent component,
java.lang.String key)
Returns non-null component language value.
|
static Value |
getNotNullValue(javax.swing.JComponent component,
java.lang.String key,
java.lang.String additionalKey)
Returns non-null component language value.
|
static Value |
getNotNullValue(java.lang.String key)
Returns non-null value for the specified language key.
|
static java.util.List<java.lang.String> |
getSupportedLanguages()
Returns list of currently supported languages.
|
static java.util.List<java.lang.String> |
getSupportedLanguages(Dictionary dictionary)
Returns list of languages supported by the specified dictionary.
|
static java.util.List<java.lang.String> |
getSupportedLanguages(java.lang.String dictionaryId)
Returns list of languages supported by the dictionary with the specified ID.
|
static java.lang.String |
getSystemLanguageKey()
Returns system language key.
|
static TooltipLanguageSupport |
getTooltipLanguageSupport()
Returns current tooltip language support.
|
static Value |
getValue(javax.swing.JComponent component,
java.lang.String key)
Returns component language value.
|
static Value |
getValue(javax.swing.JComponent component,
java.lang.String key,
java.lang.String additionalKey)
Returns component language value.
|
static Value |
getValue(java.lang.String key)
Returns value for the specified language key.
|
static void |
initialize()
Initializes LanguageManager settings.
|
static boolean |
isCheckComponentsTextForTranslations()
Returns whether or not components should check that text passed into their constructors is a translation key or not.
|
static boolean |
isCurrentLanguage(java.lang.String language)
Returns whether the specified language is currently used or not.
|
static boolean |
isDictionaryAdded(Dictionary dictionary)
Returns whether specified dictionary is added or not.
|
static boolean |
isDictionaryAdded(java.lang.String id)
Returns whether dictionary with the specified ID is added or not.
|
static boolean |
isRegisteredComponent(javax.swing.JComponent component)
Returns whether component is registered for language updates or not.
|
static boolean |
isSupportedLanguage(java.lang.String language)
Returns whether or not specified language is currently supported.
|
static boolean |
isUpdateLocale()
Returns whether or not locale should be updated along with adjustment of the language.
|
static void |
loadDefaultDictionary()
Loads default WebLaF dictionary.
|
static Dictionary |
loadDictionary(java.lang.Class nearClass,
java.lang.String resource)
Returns dictionary loaded from the specified location near class.
|
static Dictionary |
loadDictionary(java.io.File file)
Returns dictionary loaded from the specified file.
|
static Dictionary |
loadDictionary(java.lang.String path)
Returns dictionary loaded from the specified file path.
|
static Dictionary |
loadDictionary(java.net.URL url)
Returns dictionary loaded from the specified URL.
|
static java.lang.Object[] |
parseData(java.lang.Object... data)
Returns language data transformed into its final form.
|
protected static void |
rebuildCache()
Rebuilds global dictionaries cache from a scratch.
|
static void |
registerComponent(javax.swing.JComponent component,
java.lang.String key,
java.lang.Object... data)
Registers component for language updates.
|
static void |
registerLanguageContainer(java.awt.Container container,
java.lang.String key)
Registers language container key.
|
static void |
registerLanguageUpdater(javax.swing.JComponent component,
LanguageUpdater updater)
Registers custom LanguageUpdater for specific component.
|
static void |
registerLanguageUpdater(LanguageUpdater updater)
Register custom LanguageUpdater.
|
static Dictionary |
removeDictionary(Dictionary dictionary)
Removes dictionary from LanguageManager.
|
static Dictionary |
removeDictionary(java.lang.String id)
Removes dictionary from LanguageManager.
|
static void |
removeLanguageKeyListener(LanguageKeyListener listener)
Removes language key listener
|
static void |
removeLanguageKeyListeners(java.lang.String key)
Removes language key listener.
|
static void |
removeLanguageListener(javax.swing.JComponent component)
Removes language listener from the specified component.
|
static void |
removeLanguageListener(LanguageListener listener)
Removes language listener.
|
static void |
removeSupportedLanguage(java.lang.String language)
Removes supported language.
|
static void |
setCheckComponentsTextForTranslations(boolean check)
Sets whether or not components should check that text passed into their constructors is a translation key or not.
|
static void |
setDefaultLanguage(java.lang.String lang)
Sets default language.
|
static void |
setDefaultTooltipType(TooltipType defaultTooltipType)
Sets default tooltip type.
|
static void |
setLanguage(java.lang.String language)
Sets currently used language.
|
static javax.swing.ImageIcon |
setLanguageIcon(java.lang.String language,
javax.swing.ImageIcon icon)
Sets icon for the specified language.
|
static void |
setLanguages(java.lang.String language,
java.lang.String... otherLanguages)
Sets currently used language.
|
static void |
setSupportedLanguages(java.util.Collection<java.lang.String> supportedLanguages)
Sets supported languages.
|
static void |
setSupportedLanguages(java.lang.String... supportedLanguages)
Sets supported languages.
|
static void |
setTooltipLanguageSupport(TooltipLanguageSupport support)
Sets tooltip language support.
|
static void |
setUpdateLocale(boolean update)
Sets whether or not locale should be updated along with adjustment of the language
|
static void |
switchLanguage()
Switches current language to next language in supported languages list.
|
static void |
unregisterComponent(javax.swing.JComponent component)
Unregisters component from language updates.
|
static void |
unregisterLanguageContainer(java.awt.Container container)
Unregisters language container key.
|
static void |
unregisterLanguageUpdater(javax.swing.JComponent component)
Unregisters component's custom LanguageUpdater.
|
static void |
unregisterLanguageUpdater(LanguageUpdater updater)
Unregister custom LanguageUpdater.
|
protected static void |
updateCache(Dictionary dictionary)
Updates global dictionaries cache with the specified dictionary.
|
protected static void |
updateCache(java.lang.String prefix,
Dictionary dictionary)
Updates global dictionaries cache with the specified dictionary.
|
static void |
updateComponent(javax.swing.JComponent component,
java.lang.Object... data)
Forces component language update.
|
static void |
updateComponent(javax.swing.JComponent component,
java.lang.String key,
java.lang.Object... data)
Forces component language update.
|
protected static void |
updateComponentKey(javax.swing.JComponent component)
Updates component language key according to its container keys.
|
static void |
updateComponents()
Forces full language update for all registered components.
|
static void |
updateComponents(java.util.List<java.lang.String> keys)
Forces language update for components with the specified keys.
|
static void |
updateComponentsTree(javax.swing.JComponent component)
Updates components tree language keys according to their container keys.
|
protected static void |
updateLocale()
Updates Locale according to currently used language.
|
public static final javax.swing.ImageIcon other
public static final java.lang.String COMPONENT_UPDATER_KEY
public static final java.lang.String COMPONENT_LANGUAGE_LISTENER_KEY
protected static final java.lang.Object supportedLanguagesLock
protected static final java.util.List<java.lang.String> supportedLanguages
protected static java.lang.String DEFAULT
setDefaultLanguage(String),
getDefaultLanguage()protected static java.lang.String language
getLanguage(),
setLanguage(String)protected static boolean updateLocale
updateLocale()protected static TooltipType defaultTooltipType
protected static final java.lang.Object languageListenersLock
protected static final java.util.List<LanguageListener> languageListeners
protected static final java.util.Map<javax.swing.JComponent,java.lang.ref.WeakReference<LanguageListener>> componentLanguageListeners
protected static final java.lang.Object languageKeyListenersLock
protected static final java.util.Map<java.lang.String,java.util.List<LanguageKeyListener>> languageKeyListeners
protected static Dictionary globalDictionary
protected static final java.util.Map<java.lang.String,Value> globalCache
protected static final java.util.List<Dictionary> dictionaries
protected static final java.util.Map<java.lang.String,Dictionary> dictionariesCache
protected static final java.lang.Object componentsLock
protected static final java.util.Map<javax.swing.JComponent,java.lang.String> components
protected static final java.util.Map<javax.swing.JComponent,java.lang.Object[]> componentsData
protected static final java.util.Map<java.awt.Component,java.lang.String> componentKeysCache
protected static final java.util.Map<java.awt.Component,javax.swing.event.AncestorListener> componentsListeners
protected static final java.lang.Object languageContainersLock
protected static final java.util.Map<java.awt.Container,java.lang.String> languageContainers
protected static final java.lang.Object updatersLock
protected static final LanguageUpdaterComparator languageUpdaterComparator
protected static final java.util.List<LanguageUpdater> updaters
protected static final java.util.Map<javax.swing.JComponent,java.lang.ref.WeakReference<LanguageUpdater>> customUpdaters
protected static final java.util.Map<java.lang.Class,LanguageUpdater> updatersCache
protected static final java.util.Map<java.lang.String,javax.swing.ImageIcon> languageIcons
protected static TooltipLanguageSupport tooltipLanguageSupport
protected static boolean checkComponentsTextForTranslations
protected static boolean initialized
public static void initialize()
public static void loadDefaultDictionary()
public static java.util.List<java.lang.String> getSupportedLanguages()
public static void setSupportedLanguages(java.util.Collection<java.lang.String> supportedLanguages)
supportedLanguages - collection of supported languagespublic static boolean isSupportedLanguage(java.lang.String language)
language - language to checkpublic static void setSupportedLanguages(java.lang.String... supportedLanguages)
supportedLanguages - supported languagespublic static void addSupportedLanguage(java.lang.String language)
language - new supported languagepublic static void addSupportedLanguage(java.lang.String language,
Dictionary dictionary)
language - new supported languagedictionary - new dictionarypublic static void removeSupportedLanguage(java.lang.String language)
language - supported language to removepublic static void clearSupportedLanguages()
public static void registerComponent(javax.swing.JComponent component,
java.lang.String key,
java.lang.Object... data)
component - component to registerkey - component language keydata - component language dataLanguageUpdaterpublic static void updateComponentsTree(javax.swing.JComponent component)
component - component to updateprotected static void updateComponentKey(javax.swing.JComponent component)
component - component to updatepublic static void unregisterComponent(javax.swing.JComponent component)
component - component to unregisterpublic static boolean isRegisteredComponent(javax.swing.JComponent component)
component - component to checkpublic static java.lang.String getComponentKey(javax.swing.JComponent component)
component - component to retrieve language key forpublic static void registerLanguageUpdater(LanguageUpdater updater)
updater - new LanguageUpdaterLanguageUpdaterpublic static void unregisterLanguageUpdater(LanguageUpdater updater)
updater - LanguageUpdater to unregisterpublic static void registerLanguageUpdater(javax.swing.JComponent component,
LanguageUpdater updater)
component - component to register LanguageUpdater forupdater - custom LanguageUpdaterpublic static void unregisterLanguageUpdater(javax.swing.JComponent component)
component - component to unregister custom LanguageUpdater frompublic static LanguageUpdater getLanguageUpdater(javax.swing.JComponent component)
component - component to retrieve LanguageUpdater forpublic static void updateComponents()
public static void updateComponents(java.util.List<java.lang.String> keys)
keys - language keys of the components to updatepublic static void updateComponent(javax.swing.JComponent component,
java.lang.Object... data)
component - component to updatedata - component language datapublic static void updateComponent(javax.swing.JComponent component,
java.lang.String key,
java.lang.Object... data)
component - component to updatekey - component language keydata - component language datapublic static java.lang.Object[] parseData(java.lang.Object... data)
data - language data to processpublic static javax.swing.ImageIcon getLanguageIcon(java.lang.String language)
language - language to retrieve icon forpublic static javax.swing.ImageIcon setLanguageIcon(java.lang.String language,
javax.swing.ImageIcon icon)
language - language to set icon foricon - language iconpublic static java.lang.String getLanguageTitle(java.lang.String language)
language - language to get title forpublic static TooltipLanguageSupport getTooltipLanguageSupport()
TooltipLanguageSupport,
SwingTooltipLanguageSupportpublic static void setTooltipLanguageSupport(TooltipLanguageSupport support)
support - new tooltip language supportTooltipLanguageSupport,
SwingTooltipLanguageSupportpublic static TooltipType getDefaultTooltipType()
TooltipTypepublic static void setDefaultTooltipType(TooltipType defaultTooltipType)
defaultTooltipType - new default tooltip typeTooltipTypepublic static java.lang.String getDefaultLanguage()
public static void setDefaultLanguage(java.lang.String lang)
lang - new default languagepublic static java.lang.String getLanguage()
public static boolean isCurrentLanguage(java.lang.String language)
language - language to checkpublic static void setLanguage(java.lang.String language)
language - new languagepublic static void setLanguages(java.lang.String language,
java.lang.String... otherLanguages)
language - used languageotherLanguages - other available languagespublic static void switchLanguage()
public static boolean isUpdateLocale()
public static void setUpdateLocale(boolean update)
update - whether or not locale should be updated along with adjustment of the languageprotected static void updateLocale()
public static java.util.Locale getLocale(java.lang.String language)
language - language to return Locale forpublic static Dictionary getGlobalDictionary()
public static java.util.List<Dictionary> getDictionaries()
public static Dictionary addDictionary(java.lang.Class nearClass, java.lang.String resource)
nearClass - class to look near for the dictionary fileresource - path to dictionary filepublic static java.lang.String getDictionaryCacheKey(java.lang.Class nearClass,
java.lang.String resource)
nearClass - class to look near for the dictionary fileresource - path to dictionary filepublic static Dictionary loadDictionary(java.lang.Class nearClass, java.lang.String resource)
nearClass - class near which dictionary XML is locatedresource - dictionary XML filepublic static Dictionary addDictionary(java.net.URL url)
url - dictionary file urlpublic static java.lang.String getDictionaryCacheKey(java.net.URL url)
url - dictionary file urlpublic static Dictionary loadDictionary(java.net.URL url)
url - URL to load dictionary frompublic static Dictionary addDictionary(java.lang.String path)
path - path to dictionary filepublic static java.lang.String getDictionaryCacheKey(java.lang.String path)
path - path to dictionary filepublic static Dictionary loadDictionary(java.lang.String path)
path - file path to load dictionary frompublic static Dictionary addDictionary(java.io.File file)
file - dictionary filepublic static java.lang.String getDictionaryCacheKey(java.io.File file)
file - dictionary filepublic static Dictionary loadDictionary(java.io.File file)
file - file to load dictionary frompublic static Dictionary addDictionary(Dictionary dictionary)
dictionary - dictionary to addpublic static Dictionary addDictionary(java.lang.String cacheKey, Dictionary dictionary)
cacheKey - dictionary cache keydictionary - dictionary to addpublic static Dictionary removeDictionary(java.lang.String id)
id - ID of the dictionary to removepublic static Dictionary removeDictionary(Dictionary dictionary)
dictionary - dictionary to removepublic static boolean isDictionaryAdded(Dictionary dictionary)
dictionary - dictionary to look forpublic static boolean isDictionaryAdded(java.lang.String id)
id - ID of the dictionary to look forpublic static Dictionary getDictionary(java.lang.String id)
id - ID of the dictionary to look forpublic static void clearDictionaries()
loadDefaultDictionary()public static java.util.List<java.lang.String> getSupportedLanguages(java.lang.String dictionaryId)
dictionaryId - dictionary IDpublic static java.util.List<java.lang.String> getSupportedLanguages(Dictionary dictionary)
dictionary - dictionarypublic static java.lang.String get(java.lang.String key)
key - language key to retrieve translation forpublic static java.lang.String get(java.lang.String key,
java.lang.Object... data)
key - language key to retrieve translation fordata - language datapublic static java.lang.Character getMnemonic(java.lang.String key)
key - language key to retrieve mnemonic forpublic static Value getValue(java.lang.String key)
key - language key to retrieve value forpublic static Value getNotNullValue(java.lang.String key)
key - language key to retrieve value forpublic static boolean contains(java.lang.String key)
key - language key to checkpublic static java.lang.String get(javax.swing.JComponent component,
java.lang.String key)
component - component to retrieve translation forkey - component language keypublic static java.lang.Character getMnemonic(javax.swing.JComponent component,
java.lang.String key)
component - component to retrieve mnemonic forkey - component language keypublic static Value getValue(javax.swing.JComponent component, java.lang.String key)
component - component to retrieve language value forkey - component language keypublic static Value getNotNullValue(javax.swing.JComponent component, java.lang.String key)
component - component to retrieve language value forkey - component language keypublic static Value getValue(javax.swing.JComponent component, java.lang.String key, java.lang.String additionalKey)
component - component to retrieve language value forkey - component language keyadditionalKey - additional language keypublic static Value getNotNullValue(javax.swing.JComponent component, java.lang.String key, java.lang.String additionalKey)
component - component to retrieve language value forkey - component language keyadditionalKey - additional language keypublic static java.lang.String combineWithContainerKeys(javax.swing.JComponent component,
java.lang.String key)
component - component to retrieve language key forkey - component language keyprotected static java.lang.String combineWithContainerKeysImpl(javax.swing.JComponent component,
java.lang.String key)
component - component to retrieve language key forkey - component language keypublic static void registerLanguageContainer(java.awt.Container container,
java.lang.String key)
container - container to registerkey - language container keypublic static void unregisterLanguageContainer(java.awt.Container container)
container - container to unregisterpublic static java.lang.String getLanguageContainerKey(java.awt.Container container)
container - container to retrieve language container key forprotected static void rebuildCache()
protected static void clearCache()
protected static void updateCache(Dictionary dictionary)
dictionary - dictionary to update cache withprotected static void updateCache(java.lang.String prefix,
Dictionary dictionary)
prefix - dictionary prefixdictionary - dictionary to update cache withpublic static boolean isCheckComponentsTextForTranslations()
public static void setCheckComponentsTextForTranslations(boolean check)
check - whether or not components should check that text passed into their constructors is a translation key or notpublic static java.lang.String getDefaultLanguageKey()
public static java.lang.String getSystemLanguageKey()
public static java.util.List<LanguageListener> getLanguageListeners()
public static void addLanguageListener(LanguageListener listener)
listener - new language listenerpublic static void removeLanguageListener(LanguageListener listener)
listener - language listener to removepublic static java.util.Map<java.awt.Component,LanguageListener> getComponentLanguageListeners()
public static void addLanguageListener(javax.swing.JComponent component,
LanguageListener listener)
component - component to add language listener forlistener - new language listenerpublic static void removeLanguageListener(javax.swing.JComponent component)
component - component to remove language listener fromprotected static void fireLanguageChanged(java.lang.String oldLang,
java.lang.String newLang)
oldLang - old languagenewLang - new languageprotected static void fireDictionaryAdded(Dictionary dictionary)
dictionary - new dictionaryprotected static void fireDictionaryRemoved(Dictionary dictionary)
dictionary - removed dictionaryprotected static void fireDictionariesCleared()
public static java.util.Map<java.lang.String,java.util.List<LanguageKeyListener>> getLanguageKeyListeners()
public static void addLanguageKeyListener(java.lang.String key,
LanguageKeyListener listener)
key - language key to register listener forlistener - new language key listenerpublic static void removeLanguageKeyListener(LanguageKeyListener listener)
listener - language key listener to removepublic static void removeLanguageKeyListeners(java.lang.String key)
key - language key to remove listeners forprotected static void fireLanguageKeyUpdated(java.lang.String key)
key - updated language keyprotected static void fireAllLanguageKeysUpdated()