blockly > ContextMenuRegistry
Signature:
export declare namespace ContextMenuRegistry
Enumerations
Enumeration |
Description |
ScopeType |
Where this menu item should be rendered. If the menu item should be rendered in multiple scopes, e.g. on both a block and a workspace, it should be registered for each scope. |
Interfaces
Interface |
Description |
ContextMenuOption |
A menu item as presented to contextmenu.js. |
LegacyContextMenuOption |
A subset of ContextMenuOption corresponding to what was publicly documented. ContextMenuOption should be preferred for new code. |
RegistryItem |
A menu item as entered in the registry. |
Scope |
The actual workspace/block where the menu is being rendered. This is passed to callback and displayText functions that depend on this information. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `ContextMenuRegistry` namespace manages the registration and display of context menu items within Blockly workspaces."],["It defines enumerations like `ScopeType` to determine where menu items should appear (e.g., block, workspace)."],["Interfaces like `ContextMenuOption` and `RegistryItem` standardize the structure of menu items for both internal use and external registration."],["`LegacyContextMenuOption` provides compatibility with older code but using `ContextMenuOption` is recommended for new implementations."],["The `Scope` interface provides context-specific information about the workspace or block where the menu is displayed."]]],["The `ContextMenuRegistry` namespace manages context menu items in Blockly. It defines an enumeration `ScopeType` to specify where a menu item should appear. Four interfaces are provided: `ContextMenuOption` and `LegacyContextMenuOption` represent menu items for display. `RegistryItem` represents menu items within the registry, and `Scope` represents the rendering context, such as a workspace or block, providing context-dependent data. Developers should use `ContextMenuOption` when building new code.\n"]]