|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.util.Resources
public class Resources
Loads resources from the binary resource file generated during the build process or via the LWUIT Designer. A resource is loaded entirely into memory since random file access is not supported in Java ME, any other approach would be inefficient. This means that memory must be made available to accommodate the resource file.
Method Summary | |
---|---|
StaticAnimation |
getAnimation(java.lang.String id)
Deprecated. use getImage(String) instead |
java.io.InputStream |
getData(java.lang.String id)
Returns the data resource from the file |
java.lang.String[] |
getDataResourceNames()
Returns the names of the data resources within this bundle |
Font |
getFont(java.lang.String id)
Returns the font resource from the file |
java.lang.String[] |
getFontResourceNames()
Returns the names of the fonts within this bundle |
Image |
getImage(java.lang.String id)
Returns the image resource from the file |
java.lang.String[] |
getImageResourceNames()
Returns the names of the images within this bundle |
java.util.Hashtable |
getL10N(java.lang.String id,
java.lang.String locale)
Returns a hashmap containing localized String key/value pairs for the given locale name |
java.lang.String[] |
getL10NResourceNames()
Returns the names of the localization bundles within this bundle |
int |
getMajorVersion()
Returns the version number for this resource file. |
java.lang.String[] |
getMetaData()
Returns optional meta-data associated with the resource file |
int |
getMinorVersion()
Returns the minor version number for this resource file This value relates to the value from the header defined by the resource file specification. |
java.lang.String[] |
getResourceNames()
Returns the names of the resources within this bundle |
java.util.Hashtable |
getTheme(java.lang.String id)
Returns the theme resource from the file |
java.lang.String[] |
getThemeResourceNames()
Returns the names of the images within this bundle |
java.lang.String[] |
getUIResourceNames()
Returns the names of the ui resources within this bundle |
boolean |
isAnimation(java.lang.String name)
Deprecated. animations are no longer distinguished from images in the resource file, use Image.isAnimation instead |
boolean |
isData(java.lang.String name)
Returns true if this is a data resource |
boolean |
isFont(java.lang.String name)
Returns true if this is a font resource |
boolean |
isImage(java.lang.String name)
Returns true if this is an image resource |
boolean |
isL10N(java.lang.String name)
Returns true if this is a generic data resource |
boolean |
isTheme(java.lang.String name)
Returns true if this is a theme resource |
boolean |
isUI(java.lang.String name)
Returns true if this is a UI resource |
java.util.Enumeration |
listL10NLocales(java.lang.String id)
Returns an enumration of the locales supported by this resource id |
static Resources |
open(java.io.InputStream resource)
Creates a resource object from the given input stream |
static Resources |
open(java.lang.String resource)
Creates a resource object from the local JAR resource identifier |
static void |
setPassword(java.lang.String password)
Sets the password to use for password protected resource files |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setPassword(java.lang.String password)
password
- the password or null to clear the passwordpublic int getMajorVersion()
public int getMinorVersion()
public java.lang.String[] getMetaData()
public java.lang.String[] getResourceNames()
public java.lang.String[] getDataResourceNames()
public java.lang.String[] getUIResourceNames()
public java.lang.String[] getL10NResourceNames()
public java.lang.String[] getFontResourceNames()
public java.lang.String[] getThemeResourceNames()
public java.lang.String[] getImageResourceNames()
public boolean isL10N(java.lang.String name)
name
- the name of the resource
java.lang.NullPointerException
- if the resource doesn't existpublic boolean isTheme(java.lang.String name)
name
- the name of the resource
java.lang.NullPointerException
- if the resource doesn't existpublic boolean isFont(java.lang.String name)
name
- the name of the resource
java.lang.NullPointerException
- if the resource doesn't existpublic boolean isAnimation(java.lang.String name)
name
- the name of the resource
java.lang.NullPointerException
- if the resource doesn't existpublic boolean isData(java.lang.String name)
name
- the name of the resource
java.lang.NullPointerException
- if the resource doesn't existpublic boolean isUI(java.lang.String name)
name
- the name of the resource
java.lang.NullPointerException
- if the resource doesn't existpublic boolean isImage(java.lang.String name)
name
- the name of the resource
java.lang.NullPointerException
- if the resource doesn't existpublic static Resources open(java.lang.String resource) throws java.io.IOException
resource
- a local reference to a resource using the syntax of Class.getResourceAsStream(String)
java.io.IOException
- if opening/reading the resource failspublic static Resources open(java.io.InputStream resource) throws java.io.IOException
resource
- stream from which to read the resource
java.io.IOException
- if opening/reading the resource failspublic Image getImage(java.lang.String id)
id
- name of the image resource
public StaticAnimation getAnimation(java.lang.String id)
id
- name of the animation resource
public java.io.InputStream getData(java.lang.String id)
id
- name of the data resource
public java.util.Hashtable getL10N(java.lang.String id, java.lang.String locale)
id
- the name of the locale resourcelocale
- name of the locale resource
public java.util.Enumeration listL10NLocales(java.lang.String id)
id
- the name of the locale resource
public Font getFont(java.lang.String id)
id
- name of the font resource
public java.util.Hashtable getTheme(java.lang.String id)
id
- name of the theme resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |