Menu to add the item to, e.g. "menutitle-file"
Label and optional shortcut text
Where to insert the item (default: 'end')
Add a new menu title to the menu bar. Items, validators, and actions can be registered using the same methods as for built-in menus.
Prevent a menu item from appearing when its menu is opened. Call showItem() to restore it.
e.g. "menutitle-file_Save_as_Template"
Remove a top-level menu title from the menu bar. The menu is not destroyed; call showMenu() to restore it.
e.g. "menutitle-help"
InternalRegister an action for a menu item.
Called when the user clicks the item.
Return true to suppress the editor's built-in action;
return false or nothing to also run the built-in action.
Replaces any previously registered action for this item.
Item ID, e.g. "menutitle-file_Save"
Action callback
Register a validator for a menu item.
Called each time the menu opens to determine enabled/disabled state.
Return true to enable, false to disable, null to defer to the
editor's built-in logic.
Replaces any previously registered validator for this item.
Item ID, e.g. "menutitle-file_Save"
Validator callback
InternalInternalRestore a previously hidden menu item.
e.g. "menutitle-file_Save_as_Template"
Restore a previously hidden menu title to the menu bar.
e.g. "menutitle-help"
Remove a previously registered action. The editor's built-in action resumes for this item.
Item ID
Remove a previously registered validator. The editor's built-in enabled/disabled logic resumes for this item.
Item ID
Add a custom item to an existing menu. The item is disabled until a validator is registered for its ID.