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
* Returns a list of string values corresponding to the
     * given list of keys. The lookup is done with <code>getString</code>.
     * The values are in the same order as the keys.
     *
     * @param keys a list of keys
     * @return a list of corresponding string values
     */
    public static String[] getStrings(String[] keys) {
        Assert.isNotNull(keys);
        int length = keys.length;
        String[] result = new String[length];
        for (int i = 0; i < length; i++)
            result[i] = getString(keys[i]);
        return result;
    }
    /**
     * Returns the JFace's text font.
     * Convenience method equivalent to
     * <pre>
     * JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT)
     * </pre>
     *
     * @return the font
     */
    public static Font getTextFont() {
        return getFontRegistry().get(TEXT_FONT);
    }
    /**
     * Returns the JFace's viewer font.
     * Convenience method equivalent to