Provides a registry for menu items that you’d like to appear in the application menu.
An instance of this class is always available as the atom.menu
global.
Here is an example from the tree-view:
[
{
'label': 'View'
'submenu': [
{ 'label': 'Toggle Tree View', 'command': 'tree-view:toggle' }
]
}
{
'label': 'Packages'
'submenu': [
'label': 'Tree View'
'submenu': [
{ 'label': 'Focus', 'command': 'tree-view:toggle-focus' }
{ 'label': 'Toggle', 'command': 'tree-view:toggle' }
{ 'label': 'Reveal Active File', 'command': 'tree-view:reveal-active-file' }
{ 'label': 'Toggle Tree Side', 'command': 'tree-view:toggle-side' }
]
]
}
]
Use in your package’s menu .cson
file requires that you place your menu
structure under a menu
key.
'menu': [
{
'label': 'View'
'submenu': [
{ 'label': 'Toggle Tree View', 'command': 'tree-view:toggle' }
]
}
]
See ::add for more info about adding menu’s directly.
Adds the given items to the application menu.
Argument | Description |
---|---|
|
|
|
The String menu label. |
|
An optional Array of sub menu items. |
|
An optional String command to trigger when the item is clicked. |
|
(internal) A String containing the menu item’s id. Returns a Disposable on which |
Refreshes the currently visible menu.