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.


export declare class ContextMenuRegistry 


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


Property Modifiers Type Description
registry static ContextMenuRegistry


Method Modifiers Description
getContextMenuOptions(scopeType, scope) Gets the valid context menu options for the given scope type (e.g. block or workspace) and scope. Blocks are only shown if the preconditionFn shows they should not be hidden.
register(item) Registers a RegistryItem.
reset() Clear and recreate the registry.
unregister(id) Unregisters a RegistryItem with the given ID.