|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fdda.utils.Localization
Provides some helping methods pertaining to the output of localized Strings, either in the dialog or for messages. The locale can be specified if the default locale shall not be used.
Method Summary | |
static String |
formatMessage(String message,
Object o1)
Formats a message using MessageFormat.format, version with 1 parameter. |
static String |
formatMessage(String message,
Object[] params)
Formats a message using MessageFormat.format. |
static String |
formatMessage(String message,
Object o1,
Object o2)
Formats a message using MessageFormat.format, version with 2 parameters. |
static String |
formatMessage(String message,
Object o1,
Object o2,
Object o3)
Formats a message using MessageFormat.format, version with 3 parameter. |
static Locale |
getLocale()
Returns the used locale. |
static String |
getLocalizedString(Class aClass,
String key,
String aDefault)
Loads a localized version of a String out of a resource bundle. |
static String |
getLocalizedString(ResourceBundle bundle,
String key,
String aDefault)
Loads a localized version of a String out of a resource bundle. |
static ResourceBundle |
getResourceBundleForPackage(Class aClass)
Loads a resource bundle for a certain package. |
static void |
setLocale(Locale aLocale)
Sets the locale that is used. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void setLocale(Locale aLocale)
aLocale
- the new localepublic static Locale getLocale()
public static String formatMessage(String message, Object[] params)
message
- the messageparams
- the parameters
MessageFormat
public static String formatMessage(String message, Object o1)
message
- the messageo1
- the first parameter
MessageFormat
public static String formatMessage(String message, Object o1, Object o2)
message
- the messageo1
- the first parametero2
- the second parameter
MessageFormat
public static String formatMessage(String message, Object o1, Object o2, Object o3)
message
- the messageo1
- the first parametero2
- the second parametero3
- the third parameter
MessageFormat
public static ResourceBundle getResourceBundleForPackage(Class aClass)
aClass
- a class in the package, must not be null
MissingResourceException
- if the resource bundle isn't foundResourceBundle
public static String getLocalizedString(ResourceBundle bundle, String key, String aDefault)
bundle
- the resource bundle, must not be nullkey
- the key for the StringaDefault
- the default String
public static String getLocalizedString(Class aClass, String key, String aDefault)
aClass
- a classkey
- the key for the StringaDefault
- the default String
getResourceBundleForPackage(Class)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |