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
*  
     * <p>
     * Note that this sort of ImageDescriptor is slower and consumes more resources than
     * a regular image descriptor. It will also never generate results that look as nice as
     * a hand-drawn image. Clients are encouraged to supply their own disabled/grayed/etc. images
     * rather than using a default image and transforming it.
     * </p>
     * 
     * @param originalImage image to transform
     * @param swtFlags any flag that can be passed to the flags argument of Image#Image(Device, Image, int)
     * @return an ImageDescriptor that creates new images by transforming the given image descriptor
     * 
     * @see Image#Image(Device, Image, int) 
     * @since 3.1 
     *
     */
    public static ImageDescriptor createWithFlags(ImageDescriptor originalImage, int swtFlags) {
        return new DerivedImageDescriptor(originalImage, swtFlags);
    }
    /**
     * Creates and returns a new image descriptor for the given image. This
     * method takes the Device that created the Image as an argument, allowing
     * the original Image to be reused if the descriptor is asked for another
     * Image on the same device. Note that disposing the original Image will 
     * cause the descriptor to become invalid.
     * 
     * @since 3.1 
     *
     * @param img image to create
     * @param theDevice the device that was used to create the Image