Stay organized with collections Save and categorize content based on your preferences.

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(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.
getItem(id)
register(item) Registers a RegistryItem.
reset() Clear and recreate the registry.
unregister(id) Unregisters a RegistryItem with the given ID.