Class Messages
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.Messages
-
public class Messages extends Object
Class that is used to get the NatTable internal localized messages.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
changeLocale(Locale locale)
Updates the internal usedResourceBundle
for the givenLocale
.static String
getLocalizedMessage(String message)
Checks whether the given message starts with a % sign.static String
getString(String key)
Returns the translation for the given key according to the current setLocale
.static String
getString(String key, Object... args)
Returns the translation for the given key according to the current setLocale
.
-
-
-
Method Detail
-
getString
public static String getString(String key)
Returns the translation for the given key according to the current setLocale
.- Parameters:
key
- The NatTable internal translation key.- Returns:
- The localized String for the given key and the current set
Locale
.
-
getString
public static String getString(String key, Object... args)
Returns the translation for the given key according to the current setLocale
. It usesMessageFormat
to replace placeholders with the given parameter values.- Parameters:
key
- The NatTable internal translation key.args
- The parameters that should be used to replace placeholders.- Returns:
- The localized String for the given key and the current set
Locale
with replaced placeholders.
-
getLocalizedMessage
public static String getLocalizedMessage(String message)
Checks whether the given message starts with a % sign. If it starts with a percentage sign, the message is treated as properties key and it is tried to retrieve the localization. Otherwise the given message is returned.This method returns
null
in case the given message parameter isnull
.- Parameters:
message
- The message for which the localized version is requested- Returns:
- The localized message if the given value starts with % or the given value itself
- Since:
- 1.4
-
changeLocale
public static void changeLocale(Locale locale)
Updates the internal usedResourceBundle
for the givenLocale
.- Parameters:
locale
- TheLocale
that should be used by NatTable internally.- Since:
- 1.4
-
-