org.rapla.components.xmlbundle
Class CompoundI18n

java.lang.Object
  extended by org.rapla.components.xmlbundle.CompoundI18n
All Implemented Interfaces:
I18nBundle

public class CompoundI18n
extends Object
implements I18nBundle

Allows the combination of two resource-bundles. First the inner bundle will be searched. If the requested resource was not found the outer bundle will be searched.


Field Summary
 
Fields inherited from interface org.rapla.components.xmlbundle.I18nBundle
ROLE
 
Constructor Summary
CompoundI18n(I18nBundle inner, I18nBundle outer)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundI18n

public CompoundI18n(I18nBundle inner,
                    I18nBundle outer)
Method Detail

format

public String format(String key,
                     Object obj1)
Description copied from interface: I18nBundle
same as format(key,new Object[] {obj1});

Specified by:
format in interface I18nBundle
See Also:
I18nBundle.format(String,Object[])

format

public String format(String key,
                     Object obj1,
                     Object obj2)
Description copied from interface: I18nBundle
same as format(key,new Object[] {obj1, obj2});

Specified by:
format in interface I18nBundle
See Also:
I18nBundle.format(String,Object[])

format

public String format(String key,
                     Object[] obj)
Description copied from interface: I18nBundle
same as (new MessageFormat(getString(key))).format(obj);

Specified by:
format in interface I18nBundle
See Also:
MessageFormat

getIcon

public ImageIcon getIcon(String key)
Description copied from interface: I18nBundle
returns the specified icon from the image-resource-file.

Specified by:
getIcon in interface I18nBundle

getString

public String getString(String key)
Description copied from interface: I18nBundle
returns the specified string from the selected resource-file.

Specified by:
getString in interface I18nBundle

getResource

public URL getResource(String key)
Description copied from interface: I18nBundle
returns the URL of a resource, with the specified key. Use this method to directly access the Image Resources instead of creating an Icon.

Specified by:
getResource in interface I18nBundle

getLang

public String getLang()
Specified by:
getLang in interface I18nBundle
Returns:
the selected language.

getLocale

public Locale getLocale()
Specified by:
getLocale in interface I18nBundle
Returns:
the selected Locale.


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