Namespace MenuBar

Represents JOSMs global menu bar.

Name Description
Properties
length Replies the number of menus in the JOSM menu bar.
menuNames Replies an array with the symbolic menu names.
Methods
get Replies a menu in the JOSM menu bar.

Properties

length:number

Replies the number of menus in the JOSM menu bar.

// display the number of menus 
josm.alert(josm.menu.length);

Replies an array with the symbolic menu names.

Functions

get:JMenu

Replies a menu in the JOSM menu bar.

key is either a numberic index or one of the following symbolic names as string:

  • file
  • edit
  • view
  • tools
  • presets
  • imagery
  • window
  • help

Parameters

Name Type Description
key number the key denoting the menu.

Examples

// get the edit menu with a numeric index
var editmenu = josm.menu.get(1);  

// get the file menu with a symbolic name 
var filemenu = josm.menu.get("file");