goog.ui.editor.ToolbarFactory
Functions
addFont( button, caption, value ) → void
void
Adds a menu item to the given font menu button. The first font listed in
the value
argument is considered the font ID, so adding two items
whose CSS style starts with the same font may lead to unpredictable results.
Parameters |
|
---|
addFontSize( button, caption, value ) → void
void
Adds a menu item to the given font size menu button. The value
argument must be a legacy HTML font size in the 0-7 range.
Parameters |
|
---|
addFontSizes( button, sizes ) → void
void
Bulk-adds font sizes to the given font size menu button. The argument must be an array of font size descriptor objects, each of which must have the following attributes:
- `caption` - Caption to show in the font size menu (e.g. 'Huge')
- `value` - Value for the corresponding HTML font size (e.g. 6)
Parameters |
|
---|
addFonts( button, fonts ) → void
void
Bulk-adds fonts to the given font menu button. The argument must be an array of font descriptor objects, each of which must have the following attributes:
- `caption` - Caption to show in the font menu (e.g. 'Tahoma')
- `value` - Value for the corresponding 'font-family' CSS style (e.g. 'Tahoma, Arial, sans-serif')
Parameters |
|
---|
addFormatOption( button, caption, tag ) → void
void
Adds a menu item to the given "Format block" menu button.
Parameters |
|
---|
addFormatOptions( button, formats ) → void
void
Bulk-adds format options to the given "Format block" menu button. The argument must be an array of format option descriptor objects, each of which must have the following attributes:
- `caption` - Caption to show in the menu (e.g. 'Minor heading')
- `command` - Corresponding
goog.dom.TagName
(e.g. 'H4')
Parameters |
|
---|
getLegacySizeFromPx( px ) → number
number
Converts a pixel font size specification into an equivalent legacy size.
For example, font-size: 32px;
is <font size="6">
, etc.
If the given pixel size doesn't exactly match one of the legacy sizes, -1 is
returned.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getPrimaryFont( fontSpec ) → string
string
getPxFromLegacySize( fontSize ) → number
number
makeButton( id, tooltip, caption, opt_classNames, opt_renderer, opt_domHelper ) → goog.ui.Button
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.
Parameters |
| ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeColorMenuButton( id, tooltip, caption, opt_classNames, opt_renderer, opt_domHelper ) → goog.ui.ColorMenuButton
goog.ui.ColorMenuButton
Creates a color menu button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. The button is created with a default color menu containing standard color palettes.
Parameters |
| ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeMenuButton( id, tooltip, caption, opt_classNames, opt_renderer, opt_domHelper ) → goog.ui.MenuButton
goog.ui.MenuButton
Creates a menu button with the given ID, tooltip, and caption. Applies
any custom CSS class names to the button's caption element. The button
returned doesn't have an actual menu attached; use goog.ui.MenuButton#setMenu
to attach a goog.ui.Menu
to the
button.
Parameters |
| ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeSelectButton( id, tooltip, caption, opt_classNames, opt_renderer, opt_domHelper ) → goog.ui.Select
goog.ui.Select
Creates a select button with the given ID, tooltip, and caption. Applies
any custom CSS class names to the button's root element. The button
returned doesn't have an actual menu attached; use goog.ui.Select#setMenu
to attach a goog.ui.Menu
containing
goog.ui.Option
s to the select button.
Parameters |
| ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeToggleButton( id, tooltip, caption, opt_classNames, opt_renderer, opt_domHelper ) → goog.ui.Button
goog.ui.Button
Creates a toggle button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. The button returned has checkbox-like toggle semantics.
Parameters |
| ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
makeToolbar( items, elem, opt_isRightToLeft ) → goog.ui.Toolbar
goog.ui.Toolbar
Creates a goog.ui.Toolbar
containing the specified set of
toolbar buttons, and renders it into the given parent element. Each
item in the items
array must a goog.ui.Control
.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|