Skip to content

Refactor MenuNode to get rid of MenuExecutor, MenuCommandAdapterRegistry and MenuCommandExecutor #14217

@tsmaeder

Description

@tsmaeder

Feature Description:

Currently menu nodes (whether they be sub-menus, groups, separators or actions) are pure data. users of the MenuNode interfaces must implement all concerns like whether a menu item is visible in a context or how to adapt menu command parameters (for example, converting Widget instances to a view id to send to a plugin) themselves. In order to prevent breaking layers, we have introduced a registry infrastructure (MenuCommandAdapterRegistry ) that allows in particular the VS Code contribution handlers to influence the execution and visibility of items in toolbars and menus.
By making menu nodes active and polymorphous (for example, replacing the command field with a run method), we could simplify the menu item handling and move the complexity to where it is needed and hide it from the rest of the system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions