org.rapla.components.xmlbundle
Interface I18nBundle

All Known Implementing Classes:
CompoundI18n

public interface I18nBundle

The interface provides access to a resourcebundle that can be defined in XML or as an java-object. Example Usage:

   I18nBundle i18n = (I18nBundle)serviceManager.lookup(I18nBundle.ROLE);
   i18n.getString("yes"); // will get the translation for yes.


Field Summary
static String ROLE
           
 
Method Summary
 String format(String key, Object obj1)
          same as format(key,new Object[] {obj1});
 String format(String key, Object[] obj)
          same as (new MessageFormat(getString(key))).format(obj);
 String format(String key, Object obj1, Object obj2)
          same as format(key,new Object[] {obj1, obj2});
 ImageIcon getIcon(String key)
          returns the specified icon from the image-resource-file.
 String getLang()
           
 Locale getLocale()
           
 URL getResource(String key)
          returns the URL of a resource, with the specified key.
 String getString(String key)
          returns the specified string from the selected resource-file.
 

Field Detail

ROLE

static final String ROLE
Method Detail

format

String format(String key,
              Object obj1)
              throws MissingResourceException
same as format(key,new Object[] {obj1});

Throws:
MissingResourceException
See Also:
format(String,Object[])

format

String format(String key,
              Object obj1,
              Object obj2)
              throws MissingResourceException
same as format(key,new Object[] {obj1, obj2});

Throws:
MissingResourceException
See Also:
format(String,Object[])

format

String format(String key,
              Object[] obj)
              throws MissingResourceException
same as (new MessageFormat(getString(key))).format(obj);

Throws:
MissingResourceException
See Also:
MessageFormat

getIcon

ImageIcon getIcon(String key)
                  throws MissingResourceException
returns the specified icon from the image-resource-file.

Throws:
MissingResourceException - if not found or can't be loaded.

getString

String getString(String key)
                 throws MissingResourceException
returns the specified string from the selected resource-file.

Throws:
MissingResourceException - if not found or can't be loaded.

getResource

URL getResource(String key)
                throws MissingResourceException
returns the URL of a resource, with the specified key. Use this method to directly access the Image Resources instead of creating an Icon.

Throws:
MissingResourceException

getLang

String getLang()
Returns:
the selected language.

getLocale

Locale getLocale()
Returns:
the selected Locale.


Copyright © 2000-2006 Rapla Team. All Rights Reseserved.