The TimeZoneLabelProvider
can return an SWT Image
. Although they can be loaded dynamically as in the previous chapter, JFace provides a number of resource registries that can be used to manage a set of resources for the application. Standard registries 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 when they are no longer needed.
JFace has a set of these global registries; but there are specific ones, for example, those used by the IDE to maintain folder and file type icons. These use resource descriptors as a lightweight handle 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 or use them.
Standard images can be acquired by injecting an ISharedImages
instance...