JSDoc: Class: AbstractItem

# Class: AbstractItem

## AbstractItem

#### new AbstractItem(menu, type, content, idopt)

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`menu` | Menu |  | The context menu or sub-menu the item belongs to.
`type` | string |  | The type of the entry.
`content` | string |  | The content of the menu item.
`id` | string | <optional> | Optionally the id of the menu item.

Implements:
  - Item
Source:
  - abstract_item.js, line 39

### Extends

- AbstractEntry

### Members

#### className :HtmlClass

Class name.

##### Type:

- HtmlClass

Inherited From:
  - AbstractEntry#className
Source:
  - abstract_entry.js, line 40

#### disabled :boolean

Flag indicating if element is disabled.

##### Type:

- boolean

Source:
  - abstract_item.js, line 45

#### role :string

Aria role element.

##### Type:

- string

Inherited From:
  - AbstractEntry#role
Source:
  - abstract_entry.js, line 45

### Methods

#### activate()

Sets active style for item.

Source:
  - abstract_item.js, line 129

#### 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

#### deactivate()

Removes active style from item.

Source:
  - abstract_item.js, line 137

#### disable()

Disable item by greying it out.

Implements:
  - Item#disable
Source:
  - item.js, line 58

#### down(event)

Navigation on downwards arrow key pressed.

##### Parameters:

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

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

#### enable()

Enable item.

Implements:
  - Item#enable
Source:
  - item.js, line 63

#### escape(event)

Navigation on escape key pressed.

##### Parameters:

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

Overrides:
  - AbstractEntry#escape
Implements:
  - KeyNavigatable#escape
Source:
  - key_navigatable.js, line 52

#### executeAction()

Execute the item's action if it is not disabled.

Source:
  - abstract_item.js, line 74

#### executeCallbacks_()

Executes the additional callbacks registered with this menu item.

Source:
  - abstract_item.js, line 219

#### focus()

Setting focus to the menu item.

Implements:
  - Item#focus
Source:
  - item.js, line 48

#### generateHtml()

Forces generation of the actual DOM element.

Inherited From:
  - Element#generateHtml
Implements:
  - Item#generateHtml
Source:
  - element.js, line 41

#### getContent() → {string}

Implements:
  - Item#getContent
Source:
  - item.js, line 33

##### Returns:

The content message of this item.

Type
  string

#### getHtml() → {HTMLElement}

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

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

##### Returns:

The HTML element associated with this entry.

Type
  HTMLElement

#### getId() → {string}

Implements:
  - Item#getId
Source:
  - item.js, line 38

##### Returns:

The id of this item.

Type
  string

#### getMenu() → {Menu}

Inherited From:
  - AbstractEntry#getMenu
Implements:
  - Entry#getMenu
  - Item#getMenu
Source:
  - abstract_entry.js, line 54

##### Returns:

The context menu or sub-menu the entry belongs to.

Type
  Menu

#### getType() → {string}

Inherited From:
  - AbstractEntry#getType
Implements:
  - Entry#getType
  - Item#getType
Source:
  - abstract_entry.js, line 66

##### Returns:

The type of the menu entry, used for jsonification.

Type
  string

#### hide()

Hide entry in the menu.

Inherited From:
  - Entry#hide
Implements:
  - Item#hide
Source:
  - entry.js, line 46

#### isHidden() → {boolean}

Inherited From:
  - Entry#isHidden
Implements:
  - Item#isHidden
Source:
  - entry.js, line 56

##### Returns:

Indicates if item is hidden from display.

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.

Overrides:
  - AbstractEntry#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.

Overrides:
  - AbstractEntry#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.

Overrides:
  - AbstractEntry#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.

Overrides:
  - AbstractEntry#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

#### press()

Pressing the menu item.

Implements:
  - Item#press
Source:
  - item.js, line 43

#### registerCallback(func)

Registers a callback function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`func` | function | Callback that does not take any arguments.

Source:
  - abstract_item.js, line 80

#### right(event)

Navigation on right arrow key pressed.

##### Parameters:

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

Overrides:
  - AbstractEntry#right
Implements:
  - KeyNavigatable#right
Source:
  - key_navigatable.js, line 70

#### setHtml(element)

##### Parameters:

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

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

#### setMenu(menu)

##### Parameters:

Name | Type | Description
--- | --- | ---
`menu` | Menu | Sets the menu.

Inherited From:
  - AbstractEntry#setMenu
Implements:
  - Entry#setMenu
  - Item#setMenu
Source:
  - abstract_entry.js, line 60

#### show()

Show entry in the menu.

Inherited From:
  - Entry#show
Implements:
  - Item#show
Source:
  - entry.js, line 51

#### space(event)

Navigation on space key pressed.

##### Parameters:

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

Overrides:
  - AbstractEntry#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()

Unfocusing the menu item.

Implements:
  - Item#unfocus
Source:
  - item.js, line 53

#### unregisterCallback(func)

Removes a callback function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`func` | function | Callback that does not take any arguments.

Source:
  - abstract_item.js, line 90

#### up(event)

Navigation on upwards arrow key pressed.

##### Parameters:

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

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