src/command/Menus.js
function registerContextMenu(id) {
        if (!id) {
            console.error("call to registerContextMenu() is missing required parameters");
            return null;
        }

        // Guard against duplicate menu ids
        if (contextMenuMap[id]) {
            console.log("Context Menu added with same name and id of existing Context Menu: " + id);
            return null;
        }

        var cmenu = new ContextMenu(id);
        contextMenuMap[id] = cmenu;
        return cmenu;
    }
function registerContextMenu(id) {
        if (!id) {
            console.error("call to registerContextMenu() is missing required parameters");
            return null;
        }

        // Guard against duplicate menu ids
        if (contextMenuMap[id]) {
            console.log("Context Menu added with same name and id of existing Context Menu: " + id);
            return null;
        }

        var cmenu = new ContextMenu(id);
        contextMenuMap[id] = cmenu;
        return cmenu;
    }
function registerContextMenu ( id ) { if ( ! id ) { console . error ( "call to registerContextMenu() is missing required parameters" ) ; return null ; } // Guard against duplicate menu ids if ( contextMenuMap [ id ] ) { console . log ( "Context Menu added with same name and id of existing Context Menu: " + id ) ; return null ; } var cmenu = new ContextMenu ( id ) ; contextMenuMap [ id ] = cmenu ; return cmenu ; }
Registers new context menu with Brackets.

Extensions should generally use the predefined context menus built into Brackets. Use this
API to add a new context menu to UI that is specific to an extension.

After registering  a new context menu clients should:
- use addMenuItem() to add items to the context menu
- call open() to show the context menu.
For example:
$("#my_ID").contextmenu(function (e) {
if (e.which === 3) {
my_cmenu.open(e);
}
});

To make menu items be contextual to things like selection, listen for the "beforeContextMenuOpen"
to make changes to Command objects before the context menu is shown. MenuItems are views of
Commands, which control a MenuItem's name, enabled state, and checked state.

@param {string} id - unique identifier for context menu.
Core context menus in Brackets use a simple title as an id.
Extensions should use the following format: "author.myextension.mycontextmenu name"
@return {?ContextMenu} the newly created context menu
Registers new context menu with Brackets .