String clientId = component.getClientId(facesContext);
TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
StyleClasses containerClasses = StyleClasses.ensureStyleClassesCopy(component);
containerClasses.addClass("richTextEditor", "container");
writer.startElement(HtmlConstants.DIV, component);
writer.writeClassAttribute(containerClasses);
writer.writeStyleAttribute();
// class, stly.width, style.height
UIComponent toolbar = component.getFacet(FACET_TOOL_BAR);
if (toolbar == null) {
toolbar = createToolbar(facesContext, component);
}
facesContext.getExternalContext().getRequestMap().put(
"tobagoRichtextPreviewState", previewState ? Boolean.TRUE : Boolean.FALSE);
RenderUtil.encode(facesContext, toolbar);
// renderToolBar(facesContext, writer, component);
String content = getCurrentValue(facesContext, component);
StyleClasses bodyClasses = StyleClasses.ensureStyleClassesCopy(component);
bodyClasses.addClass("richTextEditor", "body");
if (previewState) {
writer.startElement(HtmlConstants.INPUT, component);
writer.writeAttribute(HtmlAttributes.TYPE, "hidden", false);
writer.writeNameAttribute(clientId);