Class 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
    • 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 a Message 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