Bug 79909 [JFace] Localized resource registries for JFace
Please provide improved JFace support for managing SWT resources, with the following properties: - A registry can allocate and deallocate SWT resources given a descriptor - Resources are reference-counted and shared, allowing different objects with equivalent descriptors to share resources. - Everything in the registry can be deallocated with one function call - The registry should support an open-ended set of resources (and should initially support, at minimum, Images, Fonts, Colors) - It should be possible to create a "local registry" that behaves like a regular registry but actually shares its resources with a global registry. For example, the workbench could offer a local registry as a service to views and editors. This would allow views and editors to safely allocate and deallocate SWT resources without any chance of leaking.
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/JFaceResources.java
import java.util.ResourceBundle;
import org.eclipse.jface.util.Assert;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
/**
 * Utility methods to access JFace-specific resources.
 * <p>
 * All methods declared on this class are static. This
 * class cannot be instantiated.
 * </p>
 * <p>
 * The following global state is also maintained by this class:
 * <ul>
 *   <li>a font registry</li>
 *	 <li>a color registry</li>
 *   <li>an image registry</li>
 *   <li>a resource bundle</li>
 * </ul>
 * </p>
 */
public class JFaceResources {
    /**
     * The symbolic font name for the banner font 
     * (value <code>"org.eclipse.jface.bannerfont"</code>).
     */
    public static final String BANNER_FONT = "org.eclipse.jface.bannerfont"; 
    /**
     * The JFace resource bundle; eagerly initialized.
     */
    private static final ResourceBundle bundle = ResourceBundle