protected Widget createPreviewImage(AssetContentItem contentItem) {
if (hasContent()) {
// TODO: Change the DecoratedBoundedImagePanel class to allow decoration
// of an existing bounded image, rather than extending AbsolutePanel and doing it separately.
// Should result in cleaner and nicer code.
return new DecoratedBoundedImagePanel(
contentItem.getPreviewUrl(), Constants.MAX_IMAGE_PREVIEW_WIDTH, Integer.MAX_VALUE,
Constants.ZOOM_ICON, Constants.ZOOM_WIDTH, Constants.ZOOM_HEIGHT,
IconPlacement.LOWER_RIGHT);
} else {
return new BoundedImage(contentItem.getPreviewUrl(), Constants.MAX_IMAGE_PREVIEW_WIDTH);