Home

# Library goog.ui.editor.DefaultToolbar

Function Summary
| `addDefaultFontSizes(!goog.ui.Select button)` Initializes the given font size menu button by adding default font sizes to it.
| `addDefaultFonts(!goog.ui.Select button)` Initializes the given font menu button by adding default fonts to the menu. If goog.ui.editor.DefaultToolbar.setLocale was called to specify a locale for which locale-specific default fonts exist, those are added before common fonts.
| `addDefaultFormatOptions(!goog.ui.Select button)` Initializes the given "Format block" menu button by adding default format options to the menu.
| `backgroundColorFactory_(string id, string tooltip, ?goog.ui.ControlContent caption, string= opt_classNames, ?goog.ui.ColorMenuButtonRenderer= opt_renderer, ?goog.dom.DomHelper= opt_domHelper) ⇒ !goog.ui.Button` Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Use to create a font background color button.
| `colorUpdateFromValue_(?goog.ui.ToolbarColorMenuButton button, number color)` Function to update the state of a color menu button.
| `fontColorFactory_(string id, string tooltip, ?goog.ui.ControlContent caption, string= opt_classNames, ?goog.ui.ColorMenuButtonRenderer= opt_renderer, ?goog.dom.DomHelper= opt_domHelper) ⇒ !goog.ui.Button` Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Use to create a font color button.
| `fontFaceFactory_(string id, string tooltip, ?goog.ui.ControlContent caption, string= opt_classNames, ?goog.ui.MenuButtonRenderer= opt_renderer, ?goog.dom.DomHelper= opt_domHelper) ⇒ !goog.ui.Button` Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Used to create a font face button, filled with default fonts.

`fontSizeFactory_(string id, string tooltip, ?goog.ui.ControlContent caption, string= opt_classNames, ?goog.ui.MenuButtonRenderer= opt_renderer, ?goog.dom.DomHelper= opt_domHelper) ⇒ !goog.ui.Button`

Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Use to create a font size button, filled with default font sizes.

`formatBlockFactory_(string id, string tooltip, ?goog.ui.ControlContent caption, string= opt_classNames, ?goog.ui.MenuButtonRenderer= opt_renderer, ?goog.dom.DomHelper= opt_domHelper) ⇒ !goog.ui.Button`

Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Use to create the format menu, prefilled with default formats.

| `makeBuiltInToolbarButton(string command, ?goog.dom.DomHelper= opt_domHelper) ⇒ ?goog.ui.Button` Creates an instance of a subclass of {@link goog.ui.Button} for the given {@link goog.editor.Command}, or null if no built-in button exists for the command. Note that this function is only intended to create built-in buttons; please don't try to hack it!
| `makeDefaultToolbar(!Element elem, boolean= opt_isRightToLeft) ⇒ !goog.ui.Toolbar` Creates a {@link goog.ui.Toolbar} containing a default set of editor toolbar buttons, and renders it into the given parent element.

`makeToolbar(!Array items, !Element elem, boolean= opt_isRightToLeft) ⇒ !goog.ui.Toolbar`

Creates a {@link goog.ui.Toolbar} containing the specified set of toolbar buttons, and renders it into the given parent element. Each item in the {@code items} array must either be a {@link goog.editor.Command} (to create a built-in button) or a subclass of {@link goog.ui.Control} (to create a custom control).

| `rtlButtonFactory_(string id, string tooltip, ?goog.ui.ControlContent caption, string= opt_classNames, ?goog.ui.ButtonRenderer= opt_renderer, ?goog.dom.DomHelper= opt_domHelper) ⇒ !goog.ui.Button` Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. This button is designed to be used as the RTL button.
| `setLocale(string locale)` Sets the locale for the font names. If not set, defaults to 'en-us'. Used only for default creation of font names name. Must be set before font name menu is created.
| `undoRedoButtonFactory_(string id, string tooltip, ?goog.ui.ControlContent caption, string= opt_classNames, ?goog.ui.ButtonRenderer= opt_renderer, ?goog.dom.DomHelper= opt_domHelper) ⇒ !goog.ui.Button` Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Designed to be used to create undo and redo buttons.