Class ResourceBundleUtil
java.lang.Object
org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.util.ResourceBundleUtil
This is a convenience wrapper for accessing resources stored in a ResourceBundle.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ResouceBundleUtil which wraps the provided resource bundle. -
Method Summary
Modifier and TypeMethodDescriptionGet a KeyStroke from the ResourceBundle.static ResourceBundleUtil
Get the appropriate ResourceBundle subclass.getFormatted
(String key, Object argument) getFormatted
(String key, Object[] arguments) getImageIcon
(String key, Class baseClass) Get an image icon from the ResourceBundle.getKeyStroke
(String key) Get a KeyStroke from the ResourceBundle.static ResourceBundleUtil
getLAFBundle
(String baseName) Get the appropriate ResourceBundle subclass.static ResourceBundleUtil
getLAFBundle
(String baseName, Locale locale) Get the appropriate ResourceBundle subclass.char
Get a Mnemonic from the ResourceBundle.char
getMnemonic
(String key) Get a Mnemonic from the ResourceBundle.Get a String from the ResourceBundle.
-
Constructor Details
-
ResourceBundleUtil
Creates a new ResouceBundleUtil which wraps the provided resource bundle.
-
-
Method Details
-
getString
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
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
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
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
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
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.
-
getFormatted
-
getFormatted
-
getLocale
-
getBundle
Get the appropriate ResourceBundle subclass.- Throws:
MissingResourceException
- See Also:
-
getLAFBundle
Get the appropriate ResourceBundle subclass. The baseName is extended by the Swing Look and Feel ID and by the Locale code returned by Locale.getDefault(). The default Look and Feel ID is Metal.- Throws:
MissingResourceException
- See Also:
-
getLAFBundle
public static ResourceBundleUtil getLAFBundle(String baseName, Locale locale) throws MissingResourceException Get the appropriate ResourceBundle subclass. The baseName is extended by the Swing Look and Feel ID and by the Locale code. The default Look and Feel ID is Metal.- Throws:
MissingResourceException
- See Also:
-