Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

javax.ide.util
Class IconDescription

java.lang.Object
  extended by javax.ide.util.IconDescription

public abstract class IconDescription
extends java.lang.Object

The description of an icon. An icon is specified either as a key lookup in a resource file which resolves to a resource path relative to the resource file, or an absolute resource path.

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.


Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInstance

public static IconDescription createInstance(java.net.URL url)
Create an instance that wraps the specified icon URL.

Parameters:
url - the url of an icon.
Returns:
an IconDescription instance.

createResourceInstance

public 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.

Parameters:
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.
Returns:
a new IconDescription instance.

createPathInstance

public 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.

Parameters:
loader - the class loader to load the icon resource from.
path - the path of the icon.
Returns:
a new IconDescription instance.

resolveURL

protected abstract java.net.URL resolveURL()
                                    throws MissingIconException
Resolve the URL for this instance of IconDescription.

Returns:
the resolved URL.
Throws:
MissingIconException

getURL

public java.net.URL getURL()
                    throws MissingIconException
Get the resolved URL of the icon.

Returns:
the URL of the icon.
Throws:
MissingIconException - if the icon could not be loaded.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

Copyright © 1997, 2011, Oracle. All rights reserved.