Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MenuModelRegistry

The MenuModelRegistry allows to register and unregister menus, submenus and actions via strings and MenuActions without the need to access the underlying UI representation.

Hierarchy

Index

Constructors

Properties

commands: CommandRegistry
independentSubmenus: Map<string, MutableCompoundMenuNode> = ...
root: CompositeMenuNode = ...

Methods

  • onStart(): void
  • Register a new menu at the given path with the given label. (If the menu already exists without a label, iconClass or order this method can be used to set them.)

    Parameters

    • menuPath: MenuPath

      the path for which a new submenu shall be registered.

    • label: string

      the label to be used for the new submenu.

    • Optional options: SubMenuOptions

      optionally allows to set an icon class and specify the order of the new menu.

    Returns Disposable

    if the menu was successfully created a disposable will be returned which, when called, will remove the menu again. If the menu already existed a no-op disposable will be returned.

    Note that if the menu already existed and was registered with a different label an error will be thrown.

  • unregisterMenuNode(id: string): void