Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.1.0)

E17486-02

oracle.adf.share.services
Class ResourceIcon

java.lang.Object
  extended by oracle.adf.share.services.ResourceIcon
All Implemented Interfaces:
javax.swing.Icon

public class ResourceIcon
extends java.lang.Object
implements javax.swing.Icon

ResourceIcon is an Icon that can be used both in the DT and DT@RT environments. In addition to the methods defined by the Icon interface, this class also provides a "runtime URI" that can be used to load the icon using org.apache.myfaces.trinidad.webapp.ResourceServlet. ResourceServlet looks for icons relative to the META-INF directory of a JAR file. Consequently it is recommended that you put your images under the META-INF directory If you want to store your images in a different location in your JAR files, you can do so, but you must also provide a suitable resource servlet that can load them.


Constructor Summary
ResourceIcon(java.lang.String source)
          Constructor The source URI for a ResourceIcon is the absolute path from the root of the JAR file to the image.
ResourceIcon(java.lang.String source, java.lang.String description)
          Constructor The source URI for a ResourceIcon is the absolute path from the root of the JAR file to the image.
 
Method Summary
 java.lang.String getDescription()
          Returns the description of this icon.
 int getIconHeight()
           
 int getIconWidth()
           
 java.lang.String getRuntimeUri()
          Returns the runtime URI for the icon.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceIcon

public ResourceIcon(java.lang.String source)
Constructor The source URI for a ResourceIcon is the absolute path from the root of the JAR file to the image.

Parameters:
source - the absolute path from the root of your jar file to the image.

ResourceIcon

public ResourceIcon(java.lang.String source,
                    java.lang.String description)
Constructor The source URI for a ResourceIcon is the absolute path from the root of the JAR file to the image.

Parameters:
source - the absolute path from the root of your jar file to the image.
description - description of the icon
Method Detail

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon

getRuntimeUri

public java.lang.String getRuntimeUri()
Returns the runtime URI for the icon. The runtime URI is a URI that can be passed directly to a JSF page and used to load the icon at runtime.

Returns:
the runtime URI for the icon

getDescription

public java.lang.String getDescription()
Returns the description of this icon.

Returns:
a String describing the icon.

Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.1.0)

E17486-02

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