|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.as400.ui.framework.SystemResourceFinder
public class SystemResourceFinder extends Object
Manages the resources associated with graphical panels defined using the Panel Definition Markup Language (PDML). Resources associated with a PDML panel include the following:
SystemResourceFinder uses the same
class loader that loaded SystemResourceFinder.
However, it's possible to specify a user-defined class
loader, or you can simply define a separate class loader namespace
with its own classpath. See
createNamespace(java.lang.String).
createNamespace(java.lang.String)| Modifier and Type | Method and Description |
|---|---|
static void |
addPath(String id,
String path)
Appends a new file or directory name to the classpath for the specified namespace. |
static void |
createNamespace(String id)
Defines a new class loader-based Java namespace. |
static void |
createNamespace(String id,
ClassLoader loader)
Defines a new class loader-based Java namespace, using the specified class loader. |
static void |
flushImage(ImageIcon imgIcon)
Flushes an image resource from the cache of image resources. |
static void |
flushImages()
Flushes the cache of image resources. |
static String |
format(String key)
Formats a message defined by the PDML runtime. |
static String |
format(String key,
Object[] args)
Formats a message defined by the PDML runtime. |
static String |
getClasspath(String id)
Returns the current classpath for the specified namespace. |
static int |
getHeaderLineCount()
Returns the size of the XML header which is prepended to PDML files. |
static URL |
getHTMLDocument(String panelName)
Returns a URL for reading the contents
of an HTML document containing online help for a panel. |
static URL |
getHTMLDocument(String panelName,
Locale locale)
Returns a URL for reading the contents
of an HTML document containing online help for a panel. |
static URL |
getHTMLDocument(String id,
String panelName)
Returns a URL for reading the contents
of an HTML document containing online help for a panel. |
static URL |
getHTMLDocument(String id,
String panelName,
Locale locale)
Returns a URL for reading the contents
of an HTML document containing online help for a panel. |
static ImageIcon |
getImageResource(String fileName)
Returns an ImageIcon constructed using the
contents of the specified image file. |
static ImageIcon |
getImageResource(String id,
String fileName)
Returns an ImageIcon constructed using the
contents of the specified image file. |
static String |
getLastDocumentLocale()
Returns the locale last used to load a PDML resource in the form of a language/country string. |
static String |
getLastResourceLocale()
Returns the locale last used to load a resource bundle in the form of a language/country string. |
static InputStream |
getPDMLDocument(String baseName)
Returns an InputStream for reading the contents
of a PDML file. |
static InputStream |
getPDMLDocument(String baseName,
Locale locale)
Returns an InputStream for reading the contents
of a PDML file. |
static InputStream |
getPDMLDocument(String id,
String baseName)
Returns an InputStream for reading the contents
of a PDML file. |
static InputStream |
getPDMLDocument(String id,
String baseName,
Locale locale)
Returns an InputStream for reading the contents
of a PDML file. |
static InputStream |
getPDMLHeader()
Returns the XML header which is prepended to PDML files. |
static URL |
getResource(String id,
String name)
Finds the resource with the given name. |
static InputStream |
getResourceAsStream(String id,
String name)
Returns an input stream for reading the specified resource. |
static InputStream |
getSerializedPDMLDocument(String panelName)
Returns an InputStream for reading the contents
of a serialized panel definition file. |
static InputStream |
getSerializedPDMLDocument(String panelName,
Locale locale)
Returns an InputStream for reading the contents
of a serialized panel definition file. |
static InputStream |
getSerializedPDMLDocument(String id,
String panelName)
Returns an InputStream for reading the contents
of a serialized panel definition file. |
static InputStream |
getSerializedPDMLDocument(String id,
String panelName,
Locale locale)
Returns an InputStream for reading the contents
of a serialized panel definition file. |
static ResourceBundle |
getUncachedBundle(String baseName)
Returns a resource bundle loaded from disk, bypassing the in-memory cache so that changes to the disk-resident bundle can be used. |
static ResourceBundle |
getUncachedBundle(String baseName,
Locale locale)
Returns a resource bundle loaded from disk, bypassing the in-memory cache so that changes to the disk-resident bundle can be used. |
static Class |
loadClass(String id,
String name)
Loads the class with the specified name. |
static boolean |
removePath(String id,
String path)
Removes the specified file or directory name from the classpath for the specified namespace. |
static void |
setClasspath(String id,
String classpath)
Sets the classpath for the specified namespace. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final String format(String key)
key - The resource ID of the message to be formatted.
public static final String format(String key,
Object[] args)
key - The resource ID of the message to be formatted.args - The substitution values for the message.
public static final ResourceBundle getUncachedBundle(String baseName)
throws MissingResourceException
baseName - The package qualified name of the resource bundle.If - the specified resource bundle cannot be located.MissingResourceException
public static final ResourceBundle getUncachedBundle(String baseName,
Locale locale)
throws MissingResourceException
baseName - The package qualified name of the resource bundle.locale - The locale to use when searching for the resource bundle.If - the specified resource bundle cannot be located.MissingResourceExceptionpublic static final String getLastResourceLocale()
public static final InputStream getPDMLDocument(String baseName)
throws MissingResourceException
InputStream for reading the contents
of a PDML file.
baseName - The package qualified name of the PDML document.MissingResourceException - If the PDML document cannot be found.
public static final InputStream getPDMLDocument(String baseName,
Locale locale)
throws MissingResourceException
InputStream for reading the contents
of a PDML file.
baseName - The package qualified name of the PDML document.locale - The locale to use when searching for the PDML document.MissingResourceException - If the PDML document cannot be found.
public static final InputStream getSerializedPDMLDocument(String panelName)
throws MissingResourceException
InputStream for reading the contents
of a serialized panel definition file.
panelName - The name of the panel whose definition was serialized.MissingResourceException - If the serialized panel definition cannot be found.
public static final InputStream getSerializedPDMLDocument(String panelName,
Locale locale)
throws MissingResourceException
InputStream for reading the contents
of a serialized panel definition file.
panelName - The name of the panel whose definition was serialized.locale - The locale to use when searching for the serialized panel definition.MissingResourceException - If the serialized panel definition cannot be found.public static final String getLastDocumentLocale()
public static final URL getHTMLDocument(String panelName)
throws MissingResourceException
URL for reading the contents
of an HTML document containing online help for a panel.
panelName - The name of the panel whose online help is requested.MissingResourceException - If the HTML document cannot be found.
public static final URL getHTMLDocument(String panelName,
Locale locale)
throws MissingResourceException
URL for reading the contents
of an HTML document containing online help for a panel.
panelName - The name of the panel whose online help is requested.locale - The locale to use when searching for the HTML document.MissingResourceException - If the HTML document cannot be found.
public static final ImageIcon getImageResource(String fileName)
throws MissingResourceException
ImageIcon constructed using the
contents of the specified image file.
fileName - The qualified name of the desired image file.ImageIcon containing the image.MissingResourceException - If the image file cannot be found.
public static final InputStream getPDMLHeader()
throws MissingResourceException
InputStream over the XML header.MissingResourceExceptionpublic static final int getHeaderLineCount()
public static final void createNamespace(String id)
setClasspath,
addPath or removePath.
id - The string identifier which will be used to identify
this namespace on subsequent method calls.setClasspath(java.lang.String, java.lang.String),
addPath(java.lang.String, java.lang.String),
removePath(java.lang.String, java.lang.String)
public static final void createNamespace(String id,
ClassLoader loader)
id - The string identifier which will be used to identify
this namespace on subsequent method calls.loader - The class loader which will be used to load resources
for this namespace.
public static final void setClasspath(String id,
String classpath)
id - The string identifier of the namespace as specified on
a previous call to createNamespace.classpath - The classpath string to set. The new classpath
will completely replace any existing classpath for this namespace.IllegalArgumentException - If the specified namespace does
not support this operation.public static final String getClasspath(String id)
id - The string identifier of the namespace as specified on
a previous call to createNamespace.IllegalArgumentException - If the specified namespace does
not support this operation.
public static final void addPath(String id,
String path)
id - The string identifier of the namespace as specified on
a previous call to createNamespace.pathname - A valid name of a file system directory, ZIP file,
or JAR file. The name may either be an absolute pathname
or specified relative to the current directory.IllegalArgumentException - If the specified namespace does
not support this operation, or if the specified pathname
is not a valid file system directory, ZIP file name or JAR file name.
public static final boolean removePath(String id,
String path)
id - The string identifier of the namespace as specified on
a previous call to createNamespace.pathname - The name of a file system directory, ZIP file,
or JAR file.true if the path was successfully removed;
false if the classpath does not contain the path.IllegalArgumentException - If the specified namespace does
not support this operation, or if the specified pathname
is not a valid file system directory, ZIP file name or JAR file name.
public static final Class loadClass(String id,
String name)
throws ClassNotFoundException
id - The string identifier of the namespace as specified on
a previous call to createNamespace.name - the name of the classClass objectClassNotFoundException - if the class could not be found
public static final URL getResource(String id,
String name)
The name of a resource is a "/"-separated path name that identifies the resource.
id - The string identifier of the namespace as specified on
a previous call to createNamespace.name - resource namenull if
the resource could not be found or the caller doesn't have
adequate privileges to get the resource.
public static final InputStream getResourceAsStream(String id,
String name)
id - The string identifier of the namespace as specified on
a previous call to createNamespace.name - the resource namenull
if the resource could not be found
public static final InputStream getPDMLDocument(String id,
String baseName)
throws MissingResourceException
InputStream for reading the contents
of a PDML file. The file will be loaded using the class loader
associated with the specified namespace.
id - The string identifier of the namespace as specified on
a previous call to createNamespace.baseName - The package qualified name of the PDML document.MissingResourceException - If the PDML document cannot be found.
public static final InputStream getPDMLDocument(String id,
String baseName,
Locale locale)
throws MissingResourceException
InputStream for reading the contents
of a PDML file. The file will be loaded using the class loader
associated with the specified namespace.
id - The string identifier of the namespace as specified on
a previous call to createNamespace.baseName - The package qualified name of the PDML document.locale - The locale to use when searching for the PDML document.MissingResourceException - If the PDML document cannot be found.
public static final InputStream getSerializedPDMLDocument(String id,
String panelName)
throws MissingResourceException
InputStream for reading the contents
of a serialized panel definition file. The file will be loaded using the class loader
associated with the specified namespace.
id - The string identifier of the namespace as specified on
a previous call to createNamespace.panelName - The name of the panel whose definition was serialized.MissingResourceException - If the serialized panel definition cannot be found.
public static final InputStream getSerializedPDMLDocument(String id,
String panelName,
Locale locale)
throws MissingResourceException
InputStream for reading the contents
of a serialized panel definition file. The file will be loaded using the class loader
associated with the specified namespace.
id - The string identifier of the namespace as specified on
a previous call to createNamespace.panelName - The name of the panel whose definition was serialized.locale - The locale to use when searching for the serialized panel definition.MissingResourceException - If the serialized panel definition cannot be found.
public static final URL getHTMLDocument(String id,
String panelName)
throws MissingResourceException
URL for reading the contents
of an HTML document containing online help for a panel.
The file will be loaded using the class loader
associated with the specified namespace.
id - The string identifier of the namespace as specified on
a previous call to createNamespace.panelName - The name of the panel whose online help is requested.MissingResourceException - If the HTML document cannot be found.
public static final URL getHTMLDocument(String id,
String panelName,
Locale locale)
throws MissingResourceException
URL for reading the contents
of an HTML document containing online help for a panel.
The file will be loaded using the class loader
associated with the specified namespace.
id - The string identifier of the namespace as specified on
a previous call to createNamespace.panelName - The name of the panel whose online help is requested.locale - The locale to use when searching for the HTML document.MissingResourceException - If the HTML document cannot be found.
public static final ImageIcon getImageResource(String id,
String fileName)
throws MissingResourceException
ImageIcon constructed using the
contents of the specified image file.
The file will be loaded using the class loader
associated with the specified namespace.
id - The string identifier of the namespace as specified on
a previous call to createNamespace.fileName - The qualified name of the desired image file.ImageIcon containing the image.MissingResourceException - If the image file cannot be found.public static final void flushImages()
getImageResource will reload the
images from disk instead of obtaining them from the in-memory
cache.
public static final void flushImage(ImageIcon imgIcon)
getImageResource will reload the
image from disk instead of obtaining it from the in-memory
cache.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||