com.webobjects.eoapplication
Class EOResourceBundle
java.lang.Object
|
+--java.util.ResourceBundle
|
+--com.webobjects.eoapplication.EOResourceBundle
- public class EOResourceBundle
- extends ResourceBundle
EOResourceBundles are registered with EOUserInterfaceParameters to localize icons
and strings. EOResourceBundles search the application's bundles for all available
icons (gif, jpg, jpeg, png) and string tables (plist files in Unicode) and loads the
resources on demand. All string tables are merged together, so if you place multiple
string tables in your frameworks and applications, all strings from all string tables will be
available on the client.
User preferred language and platform information is used to find the appropriate resources/strings
for the client if multiple choices are available. You create platform and language variants of
resources in Project Builder (which basically means that you create copies of the resources in
.lproj directories with names that indicate the platform). For example you can have an
icon Apple.gif in multiple variants, English.lproj/Apple.gif, English.lproj/Apple-macos.gif,
German.lproj/Apple.gif, German.lproj/Apple-macos.gif and EODefaultResourceBundle will use the right
version for the client by checking the user preferred languages and the platform the client is
running on.
Also, if an icon is available with the same name in multiple bundles, the version in the
main bundle (the application bundle itself) is preferred over a version in the frameworks.
So by placing an icon "ActionIconInspect.gif" in your application, you can "override" the
default inspect icon provided by the WebObjects frameworks.
Method Summary |
Enumeration |
getKeys()
Returns an enumeration of all available keys registered in the resource bundle. |
protected Object |
handleGetObject(String key)
Returns the localized resource (a string or an icon) which is registered
with the key key in the resource bundle. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EOResourceBundle
public EOResourceBundle()
- Default constructor. Calls super's implementation.
getKeys
public Enumeration getKeys()
- Returns an enumeration of all available keys registered in the resource bundle.
- Overrides:
getKeys
in class ResourceBundle
- Returns:
- an enumeration of all available keys
handleGetObject
protected Object handleGetObject(String key)
throws MissingResourceException
- Returns the localized resource (a string or an icon) which is registered
with the key
key
in the resource bundle. Throws a
MissingResourceException if the resource is not found.
- Overrides:
handleGetObject
in class ResourceBundle
- Parameters:
key
- the key to look up- Returns:
- the localized resource
Copyright © 2003 Apple Computer, Inc.