|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.ResourceBundle oracle.ide.util.ArrayResourceBundle
ArrayResourceBundle
is an abstract subclass of
ResourceBundle
that manages locale-dependent resources
in an array. By using numeric references rather than string
references, it requires less overhead and provides better performance than
ListResourceBundle
and PropertyResourceBundle
.
See ResourceBundle
for more information about resource
bundles in general.
Subclasses must override getContents
and provide an array,
where each item in the array is the resource value. The key for each
resource value is its numeric offset in the array. For example, the first
element in the array has the key 0. It may be retrieved by
using either getObject(0) or getObject("0");
Unlike ListResourceBundle and PropertyResourceBundle, where each locale-specific variation of a bundle can override only selected resources, with ArrayResourceBundle, each variation must provide the complete set of Resources. For example,if MyResources has three resources, then MyResources_ja and MyResources_fr must also have three resources.
The following example shows the structure of a ResourceBundle based on ArrayResourceBundle.
class MyResources extends ArrayResourceBundle { private static final Object[] contents = { // LOCALIZE THIS "Yes", // Label for the YES button "No", // Label for the NO button "Cancel" // Label for the CANCEL button // END OF MATERIAL TO LOCALIZE }; protected Object[] getContents() { return contents; } }
ResourceBundle
Field Summary |
Fields inherited from class java.util.ResourceBundle |
parent |
Constructor Summary | |
ArrayResourceBundle()
|
Method Summary | |
java.lang.String |
formatImpl(int key,
java.lang.Object param1)
Fetch a formatted String resource from the ArrayResourceBundle. |
java.lang.String |
formatImpl(int key,
java.lang.Object[] params)
Fetch a formatted String resource from the ArrayResourceBundle. |
java.lang.String |
formatImpl(int key,
java.lang.Object param1,
java.lang.Object param2)
Fetch a formatted String resource from the ArrayResourceBundle. |
java.lang.String |
formatImpl(int key,
java.lang.Object param1,
java.lang.Object param2,
java.lang.Object param3)
Fetch a formatted String resource from the ArrayResourceBundle. |
javax.swing.KeyStroke |
getAcceleratorImpl(int key)
Fetch a keystroke from the ArrayResourceBundle. |
char |
getCharImpl(int key)
Fetch a char from the ArrayResourceBundle. |
protected abstract java.lang.Object[] |
getContents()
Fetch the contents of this resource bundle. |
java.awt.Font |
getFontImpl(int key)
Fetch a font from the ArrayResourceBundle. |
javax.swing.Icon |
getIconImpl(int key)
Fetch an icon from the ArrayResourceBundle. |
protected javax.swing.ImageIcon |
getImageIconImpl(int key,
boolean shouldCacheIcon)
Fetch an ImageIcon based on a file name from the ArrayResourceBundle. |
java.awt.Image |
getImageImpl(int key)
Fetch an image from the ArrayResourceBundle. |
java.lang.Integer |
getIntegerImpl(int key)
Fetch an integer from the ArrayResourceBundle. |
java.util.Enumeration |
getKeys()
Returns an enumeration of the keys. |
char |
getMnemonicImpl(int key)
Fetch a mnemonic from the ArrayResourceBundle. |
java.lang.Object |
getObject(int key)
Deprecated. |
java.lang.Object |
getObjectImpl(int key)
Get an object from an ArrayResourceBundle. |
java.lang.String[] |
getStringArray(int key)
Deprecated. |
java.lang.String |
getStringImpl(int key)
Fetch a String from the ArrayResourceBundle. |
javax.swing.Icon |
getUncachedIconImpl(int key)
Fetch an icon from the ArrayResourceBundle that will not be cached. |
java.awt.Image |
getUncachedImageImpl(int key)
Fetch an image from the ArrayResourceBundle that will not be cached. |
protected java.lang.Object |
handleGetObject(java.lang.String key)
Gets an object for the given key from this resource bundle. |
Methods inherited from class java.util.ResourceBundle |
getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, setParent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArrayResourceBundle()
Method Detail |
public final java.lang.String[] getStringArray(int key)
key
- see class description.public final java.lang.Object getObject(int key)
key
- see class description.public final java.lang.String getStringImpl(int key)
key
- index into the resource array
public final char getCharImpl(int key)
key
- index into the resource array
public final java.awt.Font getFontImpl(int key)
key
- index into the resource array
public final javax.swing.KeyStroke getAcceleratorImpl(int key)
key
- index into the resource array
public final java.lang.Integer getIntegerImpl(int key)
key
- index into the resource array
public final char getMnemonicImpl(int key)
key
- index into the resource array
public final javax.swing.Icon getIconImpl(int key)
key
- index into the resource array
public final javax.swing.Icon getUncachedIconImpl(int key)
key
- index into the resource array
public final java.awt.Image getImageImpl(int key)
key
- index into the resource array
public final java.awt.Image getUncachedImageImpl(int key)
key
- index into the resource array
public final java.lang.Object getObjectImpl(int key)
key
- index into the resource array
public final java.lang.String formatImpl(int key, java.lang.Object[] params)
key
- index into the resource arrayparams
- the array of parameters.
public final java.lang.String formatImpl(int key, java.lang.Object param1)
key
- index into the resource arrayparam1
- the subsitution value for {0}
public final java.lang.String formatImpl(int key, java.lang.Object param1, java.lang.Object param2)
key
- index into the resource arrayparam1
- the subsitution value for {0}param2
- the subsitution value for {1}
public final java.lang.String formatImpl(int key, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
key
- index into the resource arrayparam1
- the subsitution value for {0}param2
- the subsitution value for {1}param3
- the subsitution value for {2}
protected final javax.swing.ImageIcon getImageIconImpl(int key, boolean shouldCacheIcon)
key
- index into the resource arrayshouldCacheIcon
- true to cache the icon once it has been loaded
protected abstract java.lang.Object[] getContents()
public final java.util.Enumeration getKeys()
protected final java.lang.Object handleGetObject(java.lang.String key)
key
- the key for the desired object
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.