blockly > ContextMenuRegistry

ContextMenuRegistry 類別

內容選單項目的登錄檔類別。選擇單例模式。您不應建立新的執行個體,並且只能透過 ContextMenuRegistry.registry 存取這個類別。

Signature:

export declare class ContextMenuRegistry 

建構函式

建構函式 修飾符 說明
(建構函式)() 重設 ContextMenuRegistry 的現有單例模式執行個體。

屬性

屬性 修飾符 類型 說明
registry static ContextMenuRegistry

方法

方法 修飾符 說明
getContextMenuOptions(scopeType, scope) 取得指定範圍類型 (例如區塊或工作區) 和範圍的有效內容選單選項。只有在 PreconditionFn 顯示不應隱藏的封鎖項目。
getItem(id)
register(item) 註冊 RegistryItem。
reset() 清除登錄檔,然後重新建立。
unregister(id) 取消註冊具有指定 ID 的 RegistryItem。