}
writer.endElement(HtmlConstants.DIV);
}
private UIComponent createToolbar(FacesContext facesContext, UIInput component) {
UIPanel toolbar = (UIPanel) ComponentUtil.createComponent(
facesContext, UIPanel.COMPONENT_TYPE, RENDERER_TYPE_TOOL_BAR);
String clientId = component.getClientId(facesContext);
component.getFacets().put(FACET_TOOL_BAR, toolbar);
toolbar.getAttributes().put(ATTR_ICON_SIZE, ToolBarTag.ICON_SMALL);
toolbar.getAttributes().put(ATTR_LABEL_POSITION, ToolBarTag.LABEL_OFF);
UICommand //command = (UICommand) ComponentUtil.createComponent(
// facesContext, UICommand.COMPONENT_TYPE, RENDERER_TYPE_MENUCOMMAND);
// toolbar.getChildren().add(command);
command = (UICommand) ComponentUtil.createComponent(
facesContext, UISelectBooleanCommand.COMPONENT_TYPE, RENDERER_TYPE_MENUCOMMAND);
toolbar.getChildren().add(command);
command.getAttributes().put(ATTR_IMAGE, "image/tobago-richtext-edit.gif");
command.setValueBinding(ATTR_DISABLED, ComponentUtil.createValueBinding("#{! tobagoRichtextPreviewState}"));
command.setValueBinding(ATTR_VALUE, ComponentUtil.createValueBinding("#{!tobagoRichtextPreviewState}"));
String title = ResourceManagerUtil.getPropertyNotNull(
facesContext, "tobago", "tobago.richtexteditor.edit.title");
command.getAttributes().put(ATTR_TIP, title);
String onClick = "Tobago.submitAction2(this, '"
+ clientId + RichTextEditorRenderer.CHANGE_BUTTON + "', null, null)";
command.getAttributes().put(ATTR_ACTION_ONCLICK, onClick);
command = (UICommand) ComponentUtil.createComponent(
facesContext, UISelectBooleanCommand.COMPONENT_TYPE, RENDERER_TYPE_MENUCOMMAND);
toolbar.getChildren().add(command);
//command.getAttributes().put(ATTR_COMMAND_TYPE, ToolBarSelectBooleanTag.COMMAND_TYPE);
command.getAttributes().put(ATTR_IMAGE, "image/tobago-richtext-preview.gif");
command.setValueBinding(ATTR_DISABLED, ComponentUtil.createValueBinding("#{tobagoRichtextPreviewState}"));
command.setValueBinding(ATTR_VALUE, ComponentUtil.createValueBinding("#{tobagoRichtextPreviewState}"));
title = ResourceManagerUtil.getPropertyNotNull(
facesContext, "tobago", "tobago.richtexteditor.preview.title");
command.getAttributes().put(ATTR_TIP, title);
command.getAttributes().put(ATTR_ACTION_ONCLICK, onClick);
command = (UICommand) ComponentUtil.createComponent(
facesContext, UICommand.COMPONENT_TYPE, RENDERER_TYPE_MENUCOMMAND);
toolbar.getChildren().add(command);
command.getAttributes().put(ATTR_IMAGE, "image/config.gif");
command.getAttributes().put(ATTR_ACTION_ONCLICK, "Tobago.doEditorCommand(this);");
return toolbar;
}