JSDoc: Class: AbstractMenu

# Class: AbstractMenu

## AbstractMenu

#### new AbstractMenu()

Implements:
  - Menu
Source:
  - abstract_menu.js, line 35

### Extends

- AbstractPostable

### Members

#### className

Source:
  - abstract_menu.js, line 40

#### role

Source:
  - abstract_menu.js, line 44

### Methods

#### addAttributes(attributes)

Adds a attributes and values to the HTML element.

##### Parameters:

Name | Type | Description
--- | --- | ---
`attributes` | Object.<string, string> | A dictionary of attributes.

Inherited From:
  - MenuElement#addAttributes
Source:
  - menu_element.js, line 39

#### addEvents(element)

Adds navigation events to an HTML element.

##### Parameters:

Name | Type | Description
--- | --- | ---
`element` | HTMLElement | The HTML element for navigation.

Inherited From:
  - AbstractNavigatable#addEvents
Source:
  - abstract_navigatable.js, line 147

#### bubbleKey()

Bubble this key event.

Inherited From:
  - AbstractNavigatable#bubbleKey
Source:
  - abstract_navigatable.js, line 38

#### click(event)

Navigation on mouse click events.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | MouseEvent | The mouse event that fired.

Inherited From:
  - AbstractNavigatable#click
Implements:
  - MouseNavigatable#click
Source:
  - mouse_navigatable.js, line 72

#### down(event)

Navigation on downwards arrow key pressed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | KeyboardEvent | The keyboard event that fired.

Overrides:
  - AbstractPostable#down
Implements:
  - KeyNavigatable#down
Source:
  - key_navigatable.js, line 82

#### escape(event)

Navigation on escape key pressed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | KeyboardEvent | The keyboard event that fired.

Inherited From:
  - AbstractNavigatable#escape
Implements:
  - KeyNavigatable#escape
Source:
  - key_navigatable.js, line 52

#### find(id) → (nullable) {Item}

Retrieves a menu item via its id by depth-first search.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | The item id.

Implements:
  - Menu#find
Source:
  - menu.js, line 62

##### Returns:

The item if it exists.

Type
  Item

#### focus()

Inherited From:
  - MenuElement#focus
Source:
  - menu_element.js, line 73

#### generateHtml()

Forces generation of the actual DOM element.

Overrides:
  - AbstractPostable#generateHtml
Implements:
  - Element#generateHtml
Source:
  - element.js, line 41

#### generateMenu()

Generates the HTML element containing the menu entries.

Implements:
  - Menu#generateMenu
Source:
  - menu.js, line 67

#### getFocused() → {Item}

Returns the currently focused Item.

Implements:
  - Menu#getFocused
Source:
  - menu.js, line 38

##### Returns:

The focused Item.

Type
  Item

#### getHtml() → {HTMLElement}

Generates the DOM element if it does not yet exists and returns it.

Inherited From:
  - MenuElement#getHtml
Implements:
  - Element#getHtml
Source:
  - element.js, line 31

##### Returns:

The HTML element associated with this entry.

Type
  HTMLElement

#### getItems() → {Array.<Item>}

Returns the items in that menu.

Implements:
  - Menu#getItems
Source:
  - menu.js, line 32

##### Returns:

The array of items.

Type
  Array.<Item>

#### getPool() → {VariablePool.<(string|boolean)>}

Implements:
  - Menu#getPool
Source:
  - menu.js, line 50

##### Returns:

The variable pool associated to this menu.

Type
  VariablePool.<(string|boolean)>

#### isPosted() → {boolean}

Inherited From:
  - Postable#isPosted
Implements:
  - Menu#isPosted
Source:
  - postable.js, line 30

##### Returns:

True if element is posted in the page.

Type
  boolean

#### keydown(event)

Navigation selection on keyboard events.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | KeyboardEvent | The keyboard event that fired.

Inherited From:
  - AbstractNavigatable#keydown
Implements:
  - KeyNavigatable#keydown
Source:
  - key_navigatable.js, line 46

#### left(event)

Navigation on left arrow key pressed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | KeyboardEvent | The keyboard event that fired.

Inherited From:
  - AbstractNavigatable#left
Implements:
  - KeyNavigatable#left
Source:
  - key_navigatable.js, line 64

#### mousedown(event)

Navigation selection on mouse down events.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | MouseEvent | The mouse event that fired.

Inherited From:
  - AbstractNavigatable#mousedown
Implements:
  - MouseNavigatable#mousedown
Source:
  - mouse_navigatable.js, line 48

#### mouseout(event)

Navigation selection on mouse out events.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | MouseEvent | The mouse event that fired.

Inherited From:
  - AbstractNavigatable#mouseout
Implements:
  - MouseNavigatable#mouseout
Source:
  - mouse_navigatable.js, line 66

#### mouseover(event)

Navigation selection on mouse over events.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | MouseEvent | The mouse event that fired.

Inherited From:
  - AbstractNavigatable#mouseover
Implements:
  - MouseNavigatable#mouseover
Source:
  - mouse_navigatable.js, line 60

#### mouseup(event)

Navigation selection on mouse up events.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | MouseEvent | The mouse event that fired.

Inherited From:
  - AbstractNavigatable#mouseup
Implements:
  - MouseNavigatable#mouseup
Source:
  - mouse_navigatable.js, line 54

#### parseItem(items)

Parses items in JSON formats and attaches them to the menu.

##### Parameters:

Name | Type | Description
--- | --- | ---
`items` | Array.<JSON> | List of JSON menu items.

Source:
  - abstract_menu.js, line 200

##### Returns:

#### parseItems(items)

Parses items in JSON formats and attaches them to the menu.

##### Parameters:

Name | Type | Description
--- | --- | ---
`items` | Array.<JSON> | List of JSON menu items.

Source:
  - abstract_menu.js, line 191

#### post()

Posts the element.

Overrides:
  - Postable#post
Implements:
  - Menu#post
Source:
  - postable.js, line 35

#### right(event)

Navigation on right arrow key pressed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | KeyboardEvent | The keyboard event that fired.

Inherited From:
  - AbstractNavigatable#right
Implements:
  - KeyNavigatable#right
Source:
  - key_navigatable.js, line 70

#### setFocused(item)

Sets the currently focused Item.

##### Parameters:

Name | Type | Description
--- | --- | ---
`item` | Item | The new focused Item.

Implements:
  - Menu#setFocused
Source:
  - menu.js, line 44

#### setHtml(element)

##### Parameters:

Name | Type | Description
--- | --- | ---
`element` | HTMLElement | Sets the HTML Element.

Inherited From:
  - MenuElement#setHtml
Implements:
  - Element#setHtml
Source:
  - element.js, line 36

#### space(event)

Navigation on space key pressed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | KeyboardEvent | The keyboard event that fired.

Inherited From:
  - AbstractNavigatable#space
Implements:
  - KeyNavigatable#space
Source:
  - key_navigatable.js, line 58

#### stop(event)

Stops event propagation and bubbling.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | Event | The keyboard event that fired.

Inherited From:
  - AbstractNavigatable#stop
Source:
  - abstract_navigatable.js, line 105

#### unfocus()

Inherited From:
  - MenuElement#unfocus
Source:
  - menu_element.js, line 81

#### unpost()

Removes element from page.

Inherited From:
  - Postable#unpost
Implements:
  - Menu#unpost
Source:
  - postable.js, line 47

#### unpostSubmenus()

Unposts all submenus of this menu.

Implements:
  - Menu#unpostSubmenus
Source:
  - menu.js, line 55

#### up(event)

Navigation on upwards arrow key pressed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | KeyboardEvent | The keyboard event that fired.

Overrides:
  - AbstractPostable#up
Implements:
  - KeyNavigatable#up
Source:
  - key_navigatable.js, line 76