The TimeZoneLabelProvider
can return an Image
, which is a standard SWT widget. Although the Image
can be loaded (as in the previous chapter), in JFace there are resource registries, which can be used to manage a set of resources for the application. These include the
ImageRegistry
,
FontRegistry
, and ColorRegistry
classes. The purpose of a resource registry is to maintain a list of Resource
instances and ensure that they are correctly disposed, but only when they are no longer needed.
JFace has a set of these global registries; but there are specific ones, such as the ones used by the IDE to maintain a folder and file type icons, for example. These use descriptors to hold a meaning for the resource, and a means to acquire an instance of the resource based on that descriptor. The returned resource is owned by the registry, and as such, should not be disposed by clients that acquire them.