org.swixml

Class Localizer


public class Localizer
extends java.lang.Object

The Localizer class provides consumers with a simple localization tools: getString(key). Locale and ResourceBundle need to be set to use it.
Version:
$Revision: 1.2 $
Author:
Wolf Paulus

Method Summary

ClassLoader
getClassLoader()
String
getString(String key)
Returns the localized String baseed on the given key.
boolean
isUsable()
Informs about the usablility of this Localizer.
void
setLocale(Locale locale)
Sets this Localizer's locale.
void
setResourceBundle(String bundleName)
Sets this Localizer's ResourceBundle

Method Details

getClassLoader

public ClassLoader getClassLoader()
Returns:
ClassLoader returns the classloader attribute, which has probably been set by the SwingEngine

getString

public String getString(String key)
Returns the localized String baseed on the given key. If the key cannot be found, the key is returned insstead.
Parameters:
key - String
Returns:
String - localized String , or key , if no lacalization is found.

isUsable

public boolean isUsable()
Informs about the usablility of this Localizer.
Returns:
boolean - true if Localizer is setup with Locale and ResourceBundle.

setLocale

public void setLocale(Locale locale)
Sets this Localizer's locale.
Parameters:
locale - Locale

setResourceBundle

public void setResourceBundle(String bundleName)
            throws MissingResourceException
Sets this Localizer's ResourceBundle
Parameters:
bundleName - StringResourceBundle file / class name

Copyright B) 2002 - 2005 - Wolf Paulus - CarlsbadCubes.com . All rights reserved.