|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.resource.ImageRegistry
An image registry maintains a mapping between symbolic image names and SWT image objects or special image descriptor objects which defer the creation of SWT image objects until they are needed.
An image registry owns all of the image objects registered with it, and automatically disposes of them when the SWT Display that creates the fonts is disposed. Because of this, clients do not need to (indeed, must not attempt to) dispose of these images themselves.
Clients may instantiate this class (it was not designed to be subclassed).
Unlike the FontRegistry, it is an error to replace images. As a result there are no events that fire when values are changed in the registry
Constructor Summary | |
ImageRegistry()
Creates an empty image registry. |
|
ImageRegistry(Display display)
Creates an empty image registry. |
Method Summary | |
Image |
get(String key)
Returns the image associated with the given key in this registry, or null if none. |
void |
put(String key,
Image image)
Adds an image to this registry. |
void |
put(String key,
ImageDescriptor descriptor)
Adds (or replaces) an image descriptor to this registry. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ImageRegistry()
There must be an SWT Display created in the current thread before calling this method.
public ImageRegistry(Display display)
Method Detail |
public Image get(String key)
null
if none.
key
- the key
null
if nonepublic void put(String key, ImageDescriptor descriptor)
key
- the keydescriptor
- the ImageDescriptor
IllegalArgumentException
- if the key already existspublic void put(String key, Image image)
Note that an image registry owns all of the image objects registered with it, and automatically disposes of them the SWT Display is disposed. Because of this, clients must not register an image object that is managed by another object.
key
- the keyimage
- the image
IllegalArgumentException
- if the key already exists
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |