|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.sfac.lang.LanguageSupport
public abstract class LanguageSupport
Multilingual support: Class for the class managing the application locale and bundles.
This class defines a singleton 'language service' allowing to get string values in the current locale and to register for
notification when locale changes. This 'language service' can find translations in a set of bundles.
| Constructor Summary | |
|---|---|
LanguageSupport()
|
|
| Method Summary | |
|---|---|
static void |
addLanguageListener(LanguageListener lis)
Add a listener to be notified for all locale changes. |
abstract void |
addLanguageListenerImpl(LanguageListener lis)
|
abstract LanguageSupport |
copyInstance()
|
static Locale |
getCurrentLocale()
Get the current Locale of the LanguageSupport. |
abstract Locale |
getCurrentLocaleImpl()
|
static LanguageSupport |
getInstance()
Get the unique LanguageSupport instance. |
static String |
getLocalizedString(String key)
Get the language-dependent string associated to the given key in the current locale. |
static String |
getLocalizedString(String key,
Object... params)
Get the language-dependent string associated to the given key in the current locale. |
abstract String |
getLocalizedStringImpl(String key)
|
abstract String |
getLocalizedStringImpl(String key,
Object... params)
|
static String |
getOptionalLocalizedString(String key,
String defaultValue)
Get an optional language-dependent string associated to the given key in the current locale. |
abstract String |
getOptionalLocalizedStringImpl(String key,
String defaultValue)
|
static void |
removeLanguageListener(LanguageListener lis)
Remove a previously added LanguageListener. |
abstract void |
removeLanguageListenerImpl(LanguageListener lis)
|
static void |
setInstance(LanguageSupport newInstance)
Set the unique LanguageSupport instance, any previous instance is discarded. |
static void |
updateLanguage(String newLocaleId)
Ask the language manager to change current locale to the given one. |
abstract void |
updateLanguageImpl(String newLocaleId)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LanguageSupport()
| Method Detail |
|---|
public static LanguageSupport getInstance()
public static void setInstance(LanguageSupport newInstance)
public static String getLocalizedString(String key)
key - Key of the string in the LanguageSupport.
public static String getLocalizedString(String key,
Object... params)
key - Key of the string in the LanguageSupport.params - Parameters to place in the string value (using a TextFormat).
public static String getOptionalLocalizedString(String key,
String defaultValue)
key - Key of the string in the LanguageSupport.defaultValue - Default value to be returned if the string is not found in the LanguageSupport.
public static void updateLanguage(String newLocaleId)
newLocaleId - ID of the new locale.public static Locale getCurrentLocale()
public static void addLanguageListener(LanguageListener lis)
lis - the new listener.public static void removeLanguageListener(LanguageListener lis)
lis - the listener to remove.public abstract LanguageSupport copyInstance()
public abstract String getLocalizedStringImpl(String key)
public abstract String getLocalizedStringImpl(String key,
Object... params)
public abstract String getOptionalLocalizedStringImpl(String key,
String defaultValue)
public abstract void updateLanguageImpl(String newLocaleId)
public abstract Locale getCurrentLocaleImpl()
public abstract void addLanguageListenerImpl(LanguageListener lis)
public abstract void removeLanguageListenerImpl(LanguageListener lis)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||