}
writer.endElement(HtmlElements.DIV);
}
private UIComponent createToolbar(FacesContext facesContext, UIIn component) {
UIPanel toolbar = (UIPanel) CreateComponentUtils.createComponent(
facesContext, UIPanel.COMPONENT_TYPE, RendererTypes.TOOL_BAR);
String clientId = component.getClientId(facesContext);
component.getFacets().put(Facets.TOOL_BAR, toolbar);
toolbar.getAttributes().put(Attributes.ICON_SIZE, UIToolBar.ICON_SMALL);
toolbar.getAttributes().put(Attributes.LABEL_POSITION, UIToolBar.LABEL_OFF);
UICommand //command = (AbstractUICommandBase) ComponentUtils.createComponent(
// facesContext, AbstractUICommandBase.COMPONENT_TYPE, MENU_COMMAND);
// toolbar.getChildren().add(command);
command = (UICommand) CreateComponentUtils.createComponent(
facesContext, UISelectBooleanCommand.COMPONENT_TYPE, RendererTypes.MENU_COMMAND);
toolbar.getChildren().add(command);
command.getAttributes().put(Attributes.IMAGE, "image/tobago-richtext-edit.gif");
command.setValueBinding(Attributes.DISABLED, ComponentUtils.createValueBinding("#{! tobagoRichtextPreviewState}"));
command.setValueBinding(Attributes.VALUE, ComponentUtils.createValueBinding("#{!tobagoRichtextPreviewState}"));
String title = ResourceManagerUtils.getPropertyNotNull(
facesContext, "tobago", "tobago.richtexteditor.edit.title");
command.getAttributes().put(Attributes.TIP, title);
String onClick
= HtmlRendererUtils.createSubmitAction(clientId + RichTextEditorRenderer.CHANGE_BUTTON, true, null, null);
command.getAttributes().put(Attributes.ONCLICK, onClick);
command = (UICommand) CreateComponentUtils.createComponent(
facesContext, UISelectBooleanCommand.COMPONENT_TYPE, RendererTypes.MENU_COMMAND);
toolbar.getChildren().add(command);
//command.getAttributes().put(ATTR_COMMAND_TYPE, ToolBarSelectBooleanTag.COMMAND_TYPE);
command.getAttributes().put(Attributes.IMAGE, "image/tobago-richtext-preview.gif");
command.setValueBinding(Attributes.DISABLED, ComponentUtils.createValueBinding("#{tobagoRichtextPreviewState}"));
command.setValueBinding(Attributes.VALUE, ComponentUtils.createValueBinding("#{tobagoRichtextPreviewState}"));
title = ResourceManagerUtils.getPropertyNotNull(
facesContext, "tobago", "tobago.richtexteditor.preview.title");
command.getAttributes().put(Attributes.TIP, title);
command.getAttributes().put(Attributes.ONCLICK, onClick);
command = (UICommand) CreateComponentUtils.createComponent(
facesContext, UICommand.COMPONENT_TYPE, RendererTypes.MENU_COMMAND);
toolbar.getChildren().add(command);
command.getAttributes().put(Attributes.IMAGE, "image/config.gif");
command.getAttributes().put(Attributes.ONCLICK, "Tobago.doEditorCommand(this);");
return toolbar;
}