public class ImageDescriptors extends Object
ImageDescriptors correctly.| Constructor and Description |
|---|
ImageDescriptors() |
| Modifier and Type | Method and Description |
|---|---|
static Box.Nullable<ImageDescriptor> |
createSetter(Widget lifecycle,
Supplier<Image> imageGetter,
Consumer<Image> imageSetter)
ImageDescriptor allows an Image to be shared in a pool using reference counting. |
static void |
set(Button widget,
ImageDescriptor image)
Sets the given
Button to have the image described by the given descriptor, maintaining proper reference counting. |
static void |
set(Item widget,
ImageDescriptor image)
Sets the given
Item to have the image described by the given descriptor, maintaining proper reference counting. |
static void |
set(Label widget,
ImageDescriptor image)
Sets the given
Label to have the image described by the given descriptor, maintaining proper reference counting. |
public static Box.Nullable<ImageDescriptor> createSetter(Widget lifecycle, Supplier<Image> imageGetter, Consumer<Image> imageSetter)
ImageDescriptor allows an Image to be shared in a pool using reference counting. In order to not screw-up the reference
counting, you need to be pretty careful with how you use them.
This creates a Box.Nullable<ImageDescriptor> which sets and gets images in a way that will keep the reference counting happy.
NO ONE MUST SET THE IMAGE EXCEPT THIS SETTER.
lifecycle - Any outstanding images will be destroyed with the lifecycle of this Widget.imageGetter - Function which returns the image currently on the Widget (used to ensure that nobody messed with it).imageSetter - Function which sets the image on the Widget.Image using an ImageDescriptor.public static void set(Item widget, ImageDescriptor image)
Item to have the image described by the given descriptor, maintaining proper reference counting.public static void set(Button widget, ImageDescriptor image)
Button to have the image described by the given descriptor, maintaining proper reference counting.public static void set(Label widget, ImageDescriptor image)
Label to have the image described by the given descriptor, maintaining proper reference counting.