Class: MenuBar

josm/ui/menu~ MenuBar


Represents JOSMs global menu bar.
Source:

Members


<static> length

the number of menus in the JOSM menu bar

Replies the number of menus in the JOSM menu bar.
Properties:
Name Type Description
length number the number of menues
Source:
Example
import josm from 'josm'
// display the number of menus
josm.alert(josm.menu.length)

<static, readonly> menuNames

Replies an array with the symbolic menu names.

Replies an array with the symbolic menu names.
Properties:
Name Type Description
menuNames array the names of the menues in the menu bar
Source:

Methods


<static> get(key)

Replies a menu in the JOSM menu bar.

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 | string the key denoting the menu
Source:
Returns:
the menu
Type
JMenu
Example
import josm from 'josm'
// get the edit menu with a numeric index
const editMenu = josm.menu.get(1)

// get the file menu with a symbolic name
const fileMenu = josm.menu.get('file')