blockly > ContextMenuRegistry

ContextMenuRegistry class

Class for the registry of context menu items. This is intended to be a singleton. You should not create a new instance, and only access this class from ContextMenuRegistry.registry.

Signature:

export declare class ContextMenuRegistry 

Constructors

Constructor Modifiers Description
(constructor)() Resets the existing singleton instance of ContextMenuRegistry.

Properties

Property Modifiers Type Description
registry static ContextMenuRegistry

Methods

Method Modifiers Description
getContextMenuOptions(scope, menuOpenEvent) Gets the valid context menu options for the given scope. Options are only included if the preconditionFn shows they should not be hidden.
getItem(id)
register(item) Registers a RegistryItem.
reset() Clear and recreate the registry.
unregister(id) Unregisters a RegistryItem with the given ID.