use of com.github.bordertech.wcomponents.WEditableImage in project wcomponents by BorderTech.
the class WEditableImageRenderer method doRender.
/**
* Paints the given {@link WEditableImage}.
*
* @param component the WEditableImage to paint.
* @param renderContext the RenderContext to paint to.
*/
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WEditableImage editableImage = (WEditableImage) component;
XmlStringBuilder xml = renderContext.getWriter();
// No image set
if (editableImage.getImage() == null && editableImage.getImageUrl() == null) {
return;
}
WImageRenderer.renderTagOpen(editableImage, xml);
WComponent uploader = editableImage.getEditUploader();
if (uploader != null) {
xml.appendAttribute("data-wc-editor", uploader.getId());
}
xml.appendEnd();
}
Aggregations