ckeditor5-elements / ElementSchemaCommands
Class: ElementSchemaCommands
A command, a toolbar button and a keystroke for every element of the element schema, formatting included: the command of an element is the one of its kind (see ElementCommand), and works as the CKEditor feature of that kind.
| Element | Command | Works as CKEditor's |
|---|---|---|
inline block | ElementInlineCommand | bold: wraps text |
block | ElementBlockCommand | heading: renames blocks |
container | ElementContainerCommand | block quote: wraps blocks |
empty, inline container | ElementInsertCommand | horizontal line: inserts |
container with listItem | ElementListCommand | lists: wraps blocks in items |
elementSchema: schema,
elementSchemaCommands: {
bold: { title: 'Bold', icon: IconBold, keystroke: 'Ctrl+B' },
callout: { title: 'Callout', icon: IconQuote },
divider: { title: 'Divider', icon: IconHorizontalLine }
},
toolbar: ['bold', 'callout', 'divider']Each key is the name of the command and of its toolbar button. The commands have titles and icons, so they can be menu items too, e.g. of the context menu.
The commands are made when the elements are registered, after ElementSchema and the other plugins are initialized. The editor is not created when an element is unknown.
Extends
Constructors
Constructor
new ElementSchemaCommands(editor): ElementSchemaCommands;Parameters
| Parameter | Type |
|---|---|
editor | Editor |
Returns
ElementSchemaCommands
Inherit Doc
Inherited from
Plugin.constructor
Accessors
pluginName
Get Signature
get static pluginName(): "ElementSchemaCommands";Returns
"ElementSchemaCommands"
requires
Get Signature
get static requires(): readonly [typeof ElementSchema];Returns
readonly [typeof ElementSchema]
Methods
afterInit()
afterInit(): void;Makes the commands of the elements, which are registered then.
Returns
void
init()
init(): void;Returns
void