mw.desktop.fileBrowsers.contextMenu Extension Point
You can add items to the Files panel context menu using the
mw.desktop.fileBrowsers.contextMenu
extension point.
To add items to the Files panel context menu:
Create a JSON-formatted file named
extensions.json
and place it in a folder namedresources
.Add a set of JSON declarations to
extensions.json
that defines one or more context menu items. Define custom sections in a"sections"
array within the extension point. Define custom menu items in an"items"
array within the"sections"
array.Add the folder containing the
resources
folder with theextensions.json
file to the MATLAB® path. To add the folder to the path, use theaddpath
function or right-click the folder in the Files panel and select Add to Path > Selected Folders and Subfolders.
This JSON code shows the basic structure of the
mw.desktop.fileBrowsers.contextMenu
extension point.
{ "mw.desktop.fileBrowsers.contextMenu": { "sections": [ { "name": "myToolbox.myCustomSection", "type": "SimpleMenuSection", "items": [ { "name": "myToolbox.myItem1", "type": "SimpleMenuItem", "when": "selection.isEmpty", "action": { "name": "myToolbox.myItem1Action", "type": "Action", "text": "Item 1", "icon": "icons/myMenuItemIcon.svg", "callback": "displayFileAttributes" } } ] } ] } }
For more information about using extension points, see Extend MATLAB Using Extension Points.
Properties
More About
Version History
Introduced in R2025a