Skip to end of metadata
Go to start of metadata

For certain platform ther are restriction on the number of image object hold by SWT.  JFace provides the concept of image registry to encourage the reuse of image object so the total number of image object can be reduced.  This facility is accessible in Eclipse RCP via each AbstractUIPlugin instance.  To use this, simply override the method initializeImageRegistry(ImageRegistry).

The following code shows how this can be done, with proper disposal management:

It is convenience to keep image key as static field in an "Internal" class.  This restrict the use of image within the plug-in level.

  • No labels