de.michab.util
Class Localiser

java.lang.Object
  extended byde.michab.util.Localiser

public class Localiser
extends java.lang.Object

A support class for localisation purposes.

Version:
$Revision: 1.3 $

Method Summary
static java.lang.String localise(java.util.ResourceBundle b, java.lang.String key)
          Read the value for the passed key from the resource bundle.
static java.lang.String localise(java.util.ResourceBundle b, java.lang.String key, java.lang.String deflt)
          Read the value for the passed key from the resource bundle.
static javax.swing.ImageIcon localiseIcon(java.util.ResourceBundle b, java.lang.String key)
          Return an icon for the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

localiseIcon

public static javax.swing.ImageIcon localiseIcon(java.util.ResourceBundle b,
                                                 java.lang.String key)
Return an icon for the given key.

Parameters:
b - The resource bundle to use for resource lookup.
key - The resource name to lookup.
Returns:
A reference to the icon or null if the icon was not found.

localise

public static java.lang.String localise(java.util.ResourceBundle b,
                                        java.lang.String key)
Read the value for the passed key from the resource bundle. If the key is not found, null is returned. Note that the passed key will be extended with the action's key before it is tried to resolve. E.g. if the actions key is A_KEY and the parameter 'key''s value is 'name' then it is tried to resolve 'A_KEY.name' in the resource bundle.

Parameters:
b - The resource bundle used to resolve the key.
key - The key used for resource resolution.
Returns:
The resolved resource value or null if the key could not be found.
See Also:
localise( ResourceBundle, String, String )

localise

public static java.lang.String localise(java.util.ResourceBundle b,
                                        java.lang.String key,
                                        java.lang.String deflt)
Read the value for the passed key from the resource bundle. If the key is not found, the passed default value is returned.

Parameters:
b - The resource bundle used to resolve the key.
key - The key used for resource resolution.
deflt - The value to return in case the key could not be resolved.
Returns:
The resolved resource value or the value of the deflt argument if the key could not be found.