org.bs.mdi
Class CompositeResources

java.lang.Object
  extended byorg.bs.mdi.Resources
      extended byorg.bs.mdi.CompositeResources

public class CompositeResources
extends Resources

Manages multiple Resources.


Field Summary
 
Fields inherited from class org.bs.mdi.Resources
BUTTON_ICON, CUSTOM_ICON, MENU_ICON, MESSAGEBOX_ICON, TOOLBAR_ICON
 
Constructor Summary
CompositeResources()
           
 
Method Summary
 void addResource(Resources res)
          Adds/Registers the specified resources.
 int countResources()
          Counts the registered resources.
 Icon getIcon(String key, int size)
          Returns an icon for the specified key and in the given size
 String getString(String key)
          Returns a localized string for the given key.
 void loadResources()
          Re-loads the resources from storage.
 void removeResource(Resources res)
          Removes the specified resources.
 void setLocale(Locale locale)
          Sets the locale used for getting translated/localized resources.
 
Methods inherited from class org.bs.mdi.Resources
getLocale, getMnemonic, i18n, stripMnemonic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeResources

public CompositeResources()
Method Detail

setLocale

public void setLocale(Locale locale)
Description copied from class: Resources
Sets the locale used for getting translated/localized resources.

Overrides:
setLocale in class Resources
Parameters:
locale - the locale to be used

addResource

public void addResource(Resources res)
Adds/Registers the specified resources.

Parameters:
res - the resources object to be added

removeResource

public void removeResource(Resources res)
Removes the specified resources.

Parameters:
res - the resources object to be removed

countResources

public int countResources()
Counts the registered resources.

Returns:
the number of registered resources.

loadResources

public void loadResources()
Description copied from class: Resources
Re-loads the resources from storage. This method should take the currently selected locale (see Resources.getLocale()) into account.

Specified by:
loadResources in class Resources

getString

public String getString(String key)
Description copied from class: Resources
Returns a localized string for the given key.

Specified by:
getString in class Resources
Parameters:
key - the key
Returns:
the localized string, or null in case of error

getIcon

public Icon getIcon(String key,
                    int size)
Description copied from class: Resources
Returns an icon for the specified key and in the given size

Specified by:
getIcon in class Resources
Parameters:
key - the key
size - the size of the icon: pre-defined values are: CUSTOM_ICON, MENU_ICON, BUTTON_ICON, TOOLBAR_ICON, MESSAGEBOX_ICON.
Returns:
the icon, or null in case of error