Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot
Class PivotResourceManager

java.lang.Object
  extended by com.citra.pivot.PivotResourceManager

public class PivotResourceManager
extends Object

PivotResourceManager is used to add internationalization support. A ResourceBundle instance is used which contains the String key/value pairs. By default, a resource bundle is created with the default locale, which looks for a file with the name CitraPivotBundle.properties. By modifying the contents of this file, or by creating a new one in the format CitraPivotBundle_[locale].properties, you can customize the look of the gui components of Citra Pivot.


Field Summary
static String RESOURCE_NAME
          The default resource name for the Pivot Library
 
Method Summary
static ResourceBundle getResourceBundle()
          Retrieves the assigned resource bundle.
static String getString(String resourceKey)
          Retrieves the assigned string for the given key.
static boolean getUpdateComponents()
          Determines whether the components that make use of the Citra Pivot resource bundle will re-initialize themselves with the new property values, when their UI is updated.
static void setResourceBundle(ResourceBundle resource)
          Assigns a new resource bundle.
static void setResourceBundle(String resource)
          Assigns the resource bundle given by resource with the default locale.
static void setResourceBundle(String resource, Locale locale)
          Assigns the resource bundle given by resource with the specified locale.
static void setUpdateComponents(boolean update)
          Determines whether the components that make use of the Citra Pivot resource bundle will re-initialize themselves with the new property values, when their UI is updated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_NAME

public static final String RESOURCE_NAME
The default resource name for the Pivot Library

See Also:
Constant Field Values
Method Detail

getResourceBundle

public static ResourceBundle getResourceBundle()
Retrieves the assigned resource bundle.

Returns:
the assigned resource bundle

getString

public static final String getString(String resourceKey)
Retrieves the assigned string for the given key.

Parameters:
resourceKey - the key to which a value from the resource bundle corresponds
Returns:
the assigned value

getUpdateComponents

public static boolean getUpdateComponents()
Determines whether the components that make use of the Citra Pivot resource bundle will re-initialize themselves with the new property values, when their UI is updated. This is extremely usefull for dynamically changing languages.

To update the UI of an entire component or even frame, you can use the Swing utility method SwingUtilities.updateComponentTreeUI(Component c).

Returns:
true, if the components will be reinitialized once their UI is updated, false otherwise

setResourceBundle

public static void setResourceBundle(String resource)
Assigns the resource bundle given by resource with the default locale.

Parameters:
resource - the resource's name

setResourceBundle

public static void setResourceBundle(String resource,
                                     Locale locale)
Assigns the resource bundle given by resource with the specified locale.

Parameters:
resource - the resource's name
locale - the locale to use

setResourceBundle

public static void setResourceBundle(ResourceBundle resource)
Assigns a new resource bundle.

Parameters:
resource - the resource bundle to assign

setUpdateComponents

public static void setUpdateComponents(boolean update)
Determines whether the components that make use of the Citra Pivot resource bundle will re-initialize themselves with the new property values, when their UI is updated. This is extremely useful for dynamically changing languages.

To update the UI of an entire component or even frame, you can use the Swing utility method SwingUtilities.updateComponentTreeUI(Component c).

Parameters:
update - true, if the components will be reinitialized once their UI is updated, false otherwise

Copyright © 2011 Citra Technologies. All Rights Reserved.