| java.lang.Object org.swixml.Localizer
Localizer | public class Localizer (Code) | | The Localizer class provides consumers with a simple localization tools: getString(key) .
Locale and ResourceBundle need to be set to use it.
Since some setters accept comma separated lists of Strings, e.g. a TabbedPane's setTitles methods, the Localizer will
try to split a given key by commas if the key doesn't resolve, i.e. a MissingResourceException is
thrown.
For example, if the resource bundle contains strings for the following single keys:
a = Alpha
b = Bravo
c = Charlie
then calling getString("a,b,c") will result in a String containing the comma sepearted values, like
"Alpha,Brave,Charlie"
Look at the provided testcase for more details.
author: Wolf Paulus version: $Revision: 1.2 $ See Also: XTabbedPane.setTitles(String) |
getClassLoader | public ClassLoader getClassLoader()(Code) | | ClassLoader returns the classloader attribute, which has probably been set by the SwingEngine |
getString | public String getString(String key)(Code) | | Returns the localized String baseed on the given key.
If the key cannot be found, the key is returned insstead.
Parameters: key - String String - localized String , or key , if no lacalization is found. |
isUsable | public boolean isUsable()(Code) | | Informs about the usablility of this Localizer.
boolean - true if Localizer is setup with Locale and ResourceBundle. |
setClassLoader | void setClassLoader(ClassLoader cl)(Code) | | Sets the ClassLoader attribute.
The Localizer does not use the provided classloader directly but return it when asked for.
Parameters: cl - ClassLoader - custom classloader |
setLocale | public void setLocale(Locale locale)(Code) | | Sets this Localizer's locale.
Parameters: locale - Locale |
setSeparator | public static void setSeparator(String regExp)(Code) | | Sets the regular expression used to split a key, that could not be found in the resource bundle.
Parameters: regExp - String See Also: String.split See Also: Localizer.getString |
|
|