Bug 156747 Adopt Resource.getDevice() in the JFace resource managers
SWT has recently added a Resource.getDevice() method. This allows several improvements to be made to the JFace resource managers: 1. The (inefficient and complex) heuristics that detect a device by creating temporary resources can be removed. 2. The one-argument descriptor factories that don't take a Device can be made just as efficient as the two-argument versions. 3. The descriptor factory methods that take a Device can be deprecated, since the second argument is no longer required and the one-argument version is just as efficient.
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/ImageDescriptor.java
* @return a newly created image descriptor
     */
    public static ImageDescriptor createFromImage(Image img, Device theDevice) {
        return new ImageDataImageDescriptor(img, theDevice);
    }
    
    /**
     * Creates and returns a new image descriptor from a URL.
     *
     * @param url The URL of the image file.
     * @return a new image descriptor
     */
    public static ImageDescriptor createFromURL(URL url) {
        if (url == null) {
            return getMissingImageDescriptor();
        }
        return new URLImageDescriptor(url);
    }
    /* (non-Javadoc)
     * @see org.eclipse.jface.resource.DeviceResourceDescriptor#createResource(org.eclipse.swt.graphics.Device)
     */
    public Object createResource(Device device) throws DeviceResourceException {
        Image result = createImage(false, device);
        if (result == null) {
            throw new DeviceResourceException(this);
        }
        return result;
    }
    
    /* (non-Javadoc)