if (element instanceof ImageProvider) {
ImageProvider ip = (ImageProvider) element;
return ip.getImage();
}
if (element instanceof HasOwner) {
HasOwner ho = (HasOwner) element;
Object bean = ho.getOwner();
if (bean instanceof ImageProvider) {
ImageProvider ip = (ImageProvider) bean;
return ip.getImage();
}
}