com.sptci.echo2
Class Dimensions

java.lang.Object
  extended by com.sptci.echo2.Dimensions

public class Dimensions
extends Object

A utility class that is used to load and retrieve the localised configurable dimensions for UI components. This class needs an active ApplicationInstance to be properly initialised.

Copyright 2006 Sans Pareil Technologies, Inc.

Version:
$Id: Dimensions.java 3026 2007-03-02 14:02:28Z rakesh $
Author:
Rakesh Vidyadharan 2006-11-23

Field Summary
private static String BUNDLE_NAME
          The name of the resource bundle to load.
private static Logger logger
          The logger used to log errors.
private static HashMap<Locale,ResourceBundle> resource
          A container for storing the resource bundles that represent the appropriate properties.
 
Constructor Summary
private Dimensions()
          Cannot be instantiated.
 
Method Summary
private static ResourceBundle fetchResourceBundle()
          Fetch the appropriate ResourceBundle based upon the Locale from resource.
static int getInt(Object source, String key)
          Returns configured integer value for the key for the specified source object.
static int getInt(String key)
          Returns configured integer value for the key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUNDLE_NAME

private static final String BUNDLE_NAME
The name of the resource bundle to load. "META-INF.resource.localisation.Dimensions"

See Also:
Constant Field Values

logger

private static final Logger logger
The logger used to log errors.


resource

private static final HashMap<Locale,ResourceBundle> resource
A container for storing the resource bundles that represent the appropriate properties.

Constructor Detail

Dimensions

private Dimensions()
Cannot be instantiated.

Method Detail

getInt

public static final int getInt(Object source,
                               String key)
Returns configured integer value for the key for the specified source object. Look for a key that is named after the fully qualified class name of the source object.

Parameters:
source - The object whose configured localised value is to be retrieved.
key - The key of the integer value to be returned
Returns:
The appropriate value (if the key is not defined, the value 0 is returned)
See Also:
getInt( String )

getInt

public static final int getInt(String key)
Returns configured integer value for the key.

Parameters:
key - The key of the integer value to be returned
Returns:
The appropriate value (if the key is not defined, the value 0 is returned)

fetchResourceBundle

private static ResourceBundle fetchResourceBundle()
Fetch the appropriate ResourceBundle based upon the Locale from resource.

Returns:
ResourceBundle The appropriate resource bundle for the locale.