EGF Engine
Release 0.1.0

org.eclipse.egf.common.ui.resource
Class BasicImageRegistry

java.lang.Object
  extended by org.eclipse.egf.common.ui.resource.BasicImageRegistry

public class BasicImageRegistry
extends Object

This class is a registry of (ImageDescriptor, Image).
Using this registry avoid to allocate multiple images for the same image descriptor.


Constructor Summary
BasicImageRegistry(Display display_p)
          Constructor.
 
Method Summary
 Image getImage(ImageDescriptor imageDescriptor_p)
          Get an image for its given descriptor.
static BasicImageRegistry getInstance()
          Get the singleton instance of this registry.
protected  void handleDisplayDisposedEvent()
          Handle display disposed event to dispose all images contained in the registry.
protected  void hookDisplayDispose(Display display)
          Hook the display disposed event to be called back when this event is raised.
 Image remove(ImageDescriptor imageDescriptor_p)
          Remove given image descriptor from the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicImageRegistry

public BasicImageRegistry(Display display_p)
Constructor.
If using this constructor DO NOT use the getInstance() that returns a different instance (singleton).

Parameters:
display_p -
Method Detail

getInstance

public static BasicImageRegistry getInstance()
Get the singleton instance of this registry.
This instance is based on Platform display.

Returns:
a not null instance.

getImage

public Image getImage(ImageDescriptor imageDescriptor_p)
Get an image for its given descriptor.

Parameters:
imageDescriptor_p -
Returns:

remove

public Image remove(ImageDescriptor imageDescriptor_p)
Remove given image descriptor from the registry.

Parameters:
imageDescriptor_p -
Returns:
previous value associated with specified image descriptor, or null if there was no mapping for specified image descriptor. A null return can also indicate that the registry previously associated null with the specified image descriptor.

hookDisplayDispose

protected void hookDisplayDispose(Display display)
Hook the display disposed event to be called back when this event is raised.
The goal is to dispose all images contained in the registry.

Parameters:
display -

handleDisplayDisposedEvent

protected void handleDisplayDisposedEvent()
Handle display disposed event to dispose all images contained in the registry.


EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.