Package com.jgoodies.common.internal
Class ResourceBundleAccessor
java.lang.Object
com.jgoodies.common.internal.ResourceBundleAccessor
- All Implemented Interfaces:
IconResourceAccessor
,StringAndIconResourceAccessor
,StringResourceAccessor
Turns a ResourceBundle into a
StringAndIconResourceAccessor
.Note: This class is not part of the public JGoodies Common API. It's intended for implementation purposes only. The class's API may change at any time.
- Since:
- 1.8
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
bundle
-
-
Constructor Details
-
ResourceBundleAccessor
-
-
Method Details
-
getIcon
Description copied from interface:IconResourceAccessor
Returns the Icon resource associated with the given key.- Specified by:
getIcon
in interfaceIconResourceAccessor
- Parameters:
key
- the key used to look up the Icon- Returns:
- the Icon
-
getString
Looks up and returns a String associated with the given resource key. If no arguments are provided, the plain String is returned. Otherwise the string will be formatted usingString.format
with the given arguments.In case the resource key is missing in the bundle, this implementation returns the key itself.
- Specified by:
getString
in interfaceStringResourceAccessor
- Parameters:
key
- the key in the resource bundleargs
- optional format arguments forwarded toString#format
- Returns:
- the String value found for the given resource key, formatted with the optional arguments - if any, or - if the key is missing in the bundle - the resource key itself
- See Also:
-