sears.tools
Class SearsResourceBundle

java.lang.Object
  extended by sears.tools.SearsResourceBundle

public class SearsResourceBundle
extends java.lang.Object

Class SearsResourceBundle.
Summary:
This class permits to access to the string resources in the choosen locale.


Field Summary
static java.lang.String[][] LOCALES
          Languages supported by Sears, array used by the options dialog
 
Constructor Summary
SearsResourceBundle()
          Constructor SearsResourceBundle.
SearsResourceBundle(java.util.Locale locale)
          Constructor SearsResourceBundle.
 
Method Summary
static java.lang.String[] getAllAvailableLanguage()
          Returns an array of string which contains all the language names available on Sears.
static javax.swing.Icon getIconForLocaleString(java.lang.String locale)
          Gets the icon which correspond to the locale string
static java.util.Locale getLocale()
          Method getLocale.
static java.lang.String getResource(java.lang.String key)
          Method getResource.
static java.lang.String getResource(java.lang.String key, java.lang.String defaultValue)
          Method getResource.
static java.lang.String getStringForLocaleString(java.lang.String locale)
          Converts a 'locale' string ("en_US") to a proper string to display ("English") using LOCALES class constant
static void setLocale(java.util.Locale locale)
          Method setLocale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALES

public static final java.lang.String[][] LOCALES
Languages supported by Sears, array used by the options dialog

Constructor Detail

SearsResourceBundle

public SearsResourceBundle()
Constructor SearsResourceBundle.
Summary:
Constructor of the class.


SearsResourceBundle

public SearsResourceBundle(java.util.Locale locale)
Constructor SearsResourceBundle.
Summary:
Constructor of the class.

Method Detail

setLocale

public static void setLocale(java.util.Locale locale)
Method setLocale.
Summary:
Change the locale to the specified one.

Parameters:
locale - The new locale to set.

getResource

public static java.lang.String getResource(java.lang.String key)
Method getResource.
Summary:
This method permits to return a resources associated to the given key in the resource bundle. It returns "", if key is not found in resource bundle.

Parameters:
key - The key of the value to found.
Returns:
String The resources associated to the given key in the resource bundle.

getResource

public static java.lang.String getResource(java.lang.String key,
                                           java.lang.String defaultValue)
Method getResource.
Summary:
This method permits to return a resources associated to the given key in the resource bundle. It returns the default value, if key is not found in resource bundle.

Parameters:
key - The key of the value to found.
defaultValue - The default value to return, if key is not found.
Returns:
String The resources associated to the given key in the resource bundle.

getLocale

public static java.util.Locale getLocale()
Method getLocale.
Summary:
Return the Locale.

Returns:
Locale The Locale.

getStringForLocaleString

public static java.lang.String getStringForLocaleString(java.lang.String locale)
Converts a 'locale' string ("en_US") to a proper string to display ("English") using LOCALES class constant

Parameters:
locale - the string to convert
Returns:
the converted string or null if there's no entries in LOCALES class constant

getIconForLocaleString

public static javax.swing.Icon getIconForLocaleString(java.lang.String locale)
Gets the icon which correspond to the locale string

Parameters:
locale - the locale string ("en_US)
Returns:
the corresponding icon or a blank icon if there's no resources for this locale

getAllAvailableLanguage

public static java.lang.String[] getAllAvailableLanguage()
Returns an array of string which contains all the language names available on Sears.
This method use the LOCALES constant to do that

Returns:
an array of language names