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.ui.ide/src/org/eclipse/ui/views/bookmarkexplorer/BookmarkLabelProvider.java
}
    public Image getColumnImage(Object element, int index) {
        if (index == COLUMN_ICON)
            return image;
        return null;
    }
    /**
     * Returns the container name if it is defined, or empty string if not.
     */
    public static String getContainerName(IMarker marker) {
        IPath path = marker.getResource().getFullPath();
        int n = path.segmentCount() - 1;
        
        if (n <= 0)
            return ""; 
        int len = 0;
        for (int i = 0; i < n; ++i)
            len += path.segment(i).length();
        
        if (n > 1)
            len += n - 1;
        StringBuffer sb = new StringBuffer(len);
        for (int i = 0; i < n; ++i) {
            if (i != 0)
                sb.append('/');
            sb.append(path.segment(i));
        }
        return sb.toString();
    }
}