public abstract class IconDescription
extends java.lang.Object
Use the createPathInstance( ClassLoader, String ) or
createResourceInstance( ClassLoader, String, String) factory
methods to create an instance of this class. To retrieve the URL of the
icon, use getURL(). This URL is normally a resource (i.e. classpath)
URL, suitable for use when constructing an ImageIcon or other
toolkit specific image type.
| Modifier and Type | Method and Description |
|---|---|
static IconDescription |
createInstance(java.net.URL url)
Create an instance that wraps the specified icon URL.
|
static IconDescription |
createPathInstance(java.lang.ClassLoader loader,
java.lang.String path)
Create an instance of IconDescription based on a direct icon
path in the manifest file.
|
static IconDescription |
createResourceInstance(java.lang.ClassLoader loader,
java.lang.String bundleClass,
java.lang.String key)
Create an instance of IconDescription based on a resource key
lookup.
|
java.net.URL |
getURL()
Get the resolved URL of the icon.
|
protected abstract java.net.URL |
resolveURL()
Resolve the URL for this instance of IconDescription.
|
public static IconDescription createInstance(java.net.URL url)
url - the url of an icon.public static IconDescription createResourceInstance(java.lang.ClassLoader loader, java.lang.String bundleClass, java.lang.String key)
loader - the class loader to load the icon resources from.bundleClass - the class name of the resource bundle.key - the key of the image path.public static IconDescription createPathInstance(java.lang.ClassLoader loader, java.lang.String path)
loader - the class loader to load the icon resource from.path - the path of the icon.protected abstract java.net.URL resolveURL()
throws MissingIconException
MissingIconExceptionpublic java.net.URL getURL()
throws MissingIconException
MissingIconException - if the icon could not be loaded.