public final class ResourceBundleAccessor extends java.lang.Object implements StringAndIconResourceAccessor
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.
| Modifier and Type | Field and Description |
|---|---|
private java.util.ResourceBundle |
bundle |
| Constructor and Description |
|---|
ResourceBundleAccessor(java.util.ResourceBundle bundle) |
| Modifier and Type | Method and Description |
|---|---|
javax.swing.Icon |
getIcon(java.lang.String key)
Returns the Icon resource associated with the given key.
|
java.lang.String |
getString(java.lang.String key,
java.lang.Object... args)
Looks up and returns a String associated with the given resource key.
|
public ResourceBundleAccessor(java.util.ResourceBundle bundle)
public javax.swing.Icon getIcon(java.lang.String key)
IconResourceAccessorgetIcon in interface IconResourceAccessorkey - the key used to look up the Iconpublic java.lang.String getString(java.lang.String key,
java.lang.Object... args)
String.format
with the given arguments.In case the resource key is missing in the bundle, this implementation returns the key itself.
getString in interface StringResourceAccessorkey - the key in the resource bundleargs - optional format arguments forwarded to String#formatString.format(String, Object...)