public class IlvResourceBundleManager extends ResourceBundle
ResourceBundle.Control
Modifier and Type | Field and Description |
---|---|
protected Locale |
locale
Stores the locale this manager provides resources for.
|
parent
Constructor and Description |
---|
IlvResourceBundleManager()
Constructs a new
IlvResourceBundleManager . |
Modifier and Type | Method and Description |
---|---|
void |
addResourceBundle(ResourceBundle bundle)
Adds the specified resource bundle to the list of resource bundles
managed by this object.
|
ResourceBundle |
addResourcePropertyFile(String propertyFile)
Adds the specified resource bundle to the list of resource bundles
managed by this object.
|
protected ClassLoader |
getClassLoader()
Returns the class loader used by the resource manager for locating
resource bundles.
|
String |
getFormattedString(String format,
Object[] params)
Returns the string resulting from the formatting of the specified
format with the parameters contained in the
params array of objects. |
ImageIcon |
getImageIcon(String filename)
Returns the image icon with the specified filename.
|
Enumeration<String> |
getKeys()
Returns an enumeration of the resource keys handled by this resource manager.
|
Locale |
getLocale()
Returns the locale that this resource bundle manager provides resources for.
|
protected Object |
handleGetObject(String key)
Returns the resource object for the specified key.
|
ResourceBundle |
removeResourceBundle(ResourceBundle bundle)
Removes the specified resource bundle from the list of resource bundles
managed by this resource bundle manager.
|
ResourceBundle |
removeResourcePropertyFile(String propertyFile)
Removes the specified property file from the list of property files
managed by this object.
|
void |
setLocale(Locale locale)
Sets the locale that the resource bundle manager will provide resources for.
|
void |
setURLResolver(IlvURLResolverManager urlResolver)
Specifies the URL resolver manager used for finding resource property files.
|
clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getObject, getString, getStringArray, handleKeySet, keySet, setParent
protected Locale locale
getLocale()
,
setLocale(java.util.Locale)
public IlvResourceBundleManager()
IlvResourceBundleManager
. The newly created
resource bundle does not contain any resource bundles by default.public Enumeration<String> getKeys()
getKeys
in class ResourceBundle
protected Object handleGetObject(String key)
handleGetObject
in class ResourceBundle
key
- The key of the resource to return the value from.null
if no resource is specified with this key.public Locale getLocale()
getLocale
in class ResourceBundle
setLocale(java.util.Locale)
public void setLocale(Locale locale)
locale
- The new locale of the resource bundle manager.getLocale()
public void addResourceBundle(ResourceBundle bundle)
bundle
- The resource bundle to add.public ResourceBundle addResourcePropertyFile(String propertyFile)
propertyFile
- The property file to create a resource bundle from.null
if no resource bundle could be created.removeResourcePropertyFile(java.lang.String)
,
removeResourceBundle(java.util.ResourceBundle)
public ResourceBundle removeResourcePropertyFile(String propertyFile)
propertyFile
- The property file to remove.propertyFile
and the current locale or null
if the property file was not added to the manager.addResourcePropertyFile(java.lang.String)
,
removeResourceBundle(java.util.ResourceBundle)
public ResourceBundle removeResourceBundle(ResourceBundle bundle)
null
if the specified resource bundle has not
previously been added to this manager.addResourceBundle(java.util.ResourceBundle)
public String getFormattedString(String format, Object[] params)
format
with the parameters contained in the
params
array of objects.
See the documentation of the java.text.MessageFormat
class
for the details of the format protocol.
format
- The key of the string resource containing the format of the
string to return.params
- The array of parameters used for the formatting.public void setURLResolver(IlvURLResolverManager urlResolver)
urlResolver
- The URL resolver.getImageIcon(java.lang.String)
public ImageIcon getImageIcon(String filename)
Then, a URL is created from this file name using the URL resolver
associated with this resource bundle manager. If no URL can be resolved
from the file name, null
will be returned. Otherwise, an icon
is created from this URL and returned.
If an image icon with the same file name has already been requested from this resource bundle manager, the same image icon is returned.
filename
- The file name or resource key of the image icon to return.null
otherwise.setURLResolver(ilog.views.appframe.util.IlvURLResolverManager)
protected ClassLoader getClassLoader()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.