Package net.sf.jguiraffe.gui.app
Class ApplicationResources
- java.lang.Object
-
- net.sf.jguiraffe.gui.app.ApplicationResources
-
public final class ApplicationResources extends Object
A class defining constants for default resources provided by the application framework.
Some components of the JGUIraffe library can produce messages visible to the end user. The messages are defined as resource IDs, so they can be translated into different languages. This class defines constants for these messages. They correspond to resource keys used by the default application resource bundle shipped with the library.
Typically a concrete application can use this default messages. It is also possible to override them with custom resource IDs. The message producing components typically allow specifying custom resource IDs.
- Version:
- $Id: ApplicationResources.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ApplicationResources.Keys
An enumeration class defining the keys of all resources contained within the application default resource bundle.
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_RESOURCE_GROUP
Constant for the name of the resource group used for the application-related resources.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Message
message(ApplicationResources.Keys key)
Returns aMessage
object for the specified enumeration literal.static Object
resourceID(ApplicationResources.Keys key)
A convenience method for generating the resource ID for the specified enumeration literal.
-
-
-
Field Detail
-
APPLICATION_RESOURCE_GROUP
public static final String APPLICATION_RESOURCE_GROUP
Constant for the name of the resource group used for the application-related resources.- See Also:
- Constant Field Values
-
-
Method Detail
-
resourceID
public static Object resourceID(ApplicationResources.Keys key)
A convenience method for generating the resource ID for the specified enumeration literal. The literals cannot be passed directly to a resource manager. Rather, their name has to be extracted. This is done by this method.- Parameters:
key
- the key (must not be null)- Returns:
- the corresponding resource ID
- Throws:
IllegalArgumentException
- if the key is null
-
message
public static Message message(ApplicationResources.Keys key)
Returns aMessage
object for the specified enumeration literal. This object is initialized with the default application resource group and the resource ID extracted from the literal.- Parameters:
key
- the key (must not be null)- Returns:
- a
Message
object for this key - Throws:
IllegalArgumentException
- if the key is null
-
-