Class ResourceBundleUtil


  • public class ResourceBundleUtil
    extends Object
    This is a convenience wrapper for accessing resources stored in a ResourceBundle.
    • Constructor Detail

      • ResourceBundleUtil

        public ResourceBundleUtil​(ResourceBundle r)
        Creates a new ResouceBundleUtil which wraps the provided resource bundle.
    • Method Detail

      • getString

        public String getString​(String key)
        Get a String from the ResourceBundle.
        Convenience method to save casting.
        Parameters:
        key - The key of the property.
        Returns:
        The value of the property. Returns the key if the property is missing.
      • getImageIcon

        public ImageIcon getImageIcon​(String key,
                                      Class baseClass)
        Get an image icon from the ResourceBundle.
        Convenience method .
        Parameters:
        key - The key of the property.
        Returns:
        The value of the property. Returns null if the property is missing.
      • getMnemonic

        public char getMnemonic​(String key)
        Get a Mnemonic from the ResourceBundle.
        Convenience method.
        Parameters:
        key - The key of the property.
        Returns:
        The first char of the value of the property. Returns '\0' if the property is missing.
      • getMnem

        public char getMnem​(String key)
        Get a Mnemonic from the ResourceBundle.
        Convenience method.
        Parameters:
        key - The key of the property. This method appends "Mnem" to the key.
        Returns:
        The first char of the value of the property. Returns '\0' if the property is missing.
      • getKeyStroke

        public KeyStroke getKeyStroke​(String key)
        Get a KeyStroke from the ResourceBundle.
        Convenience method.
        Parameters:
        key - The key of the property.
        Returns:
        javax.swing.KeyStroke.getKeyStroke(value). Returns null if the property is missing.
      • getAcc

        public KeyStroke getAcc​(String key)
        Get a KeyStroke from the ResourceBundle.
        Convenience method.
        Parameters:
        key - The key of the property. This method adds "Acc" to the key.
        Returns:
        javax.swing.KeyStroke.getKeyStroke(value). Returns null if the property is missing.
      • getLocale

        public Locale getLocale()