Label | context-menu

### Hierarchy

- AbstractItem
  - Label

### Implements

- KeyNavigatable
- MouseNavigatable
- Element
- Entry
- Item

## Index

### Constructors

- constructor

### Properties

- className
- disabled
- role

### Methods

- activate
- addAttributes
- addEvents
- bubbleKey
- click
- deactivate
- disable
- down
- enable
- escape
- executeAction
- focus
- generateHtml
- getContent
- getHtml
- getId
- getMenu
- getType
- hide
- isHidden
- keydown
- left
- mousedown
- mouseout
- mouseover
- mouseup
- press
- registerCallback
- right
- setHtml
- setMenu
- show
- space
- stop
- unfocus
- unregisterCallback
- up
- parse

## Constructors

### constructor

- new Label(menu: Menu, content: string, id?: string): Label

- Overwrites AbstractItem.constructor

  - Defined in item_label.ts:42
  constructor
  extends

    {AbstractItem}

  #### Parameters

  - ##### menu: Menu

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

  - ##### content: string

    The content of the menu item.

  - ##### Optional id: string

    Optionally the id of the menu item.

  #### Returns Label

## Properties

### Protected className

className: "CtxtMenu_ContextMenu" | "CtxtMenu_Menu" | "CtxtMenu_MenuArrow" | "CtxtMenu_MenuActive" | "CtxtMenu_MenuCheck" | "CtxtMenu_MenuClose" | "CtxtMenu_MenuDisabled" | "CtxtMenu_MenuItem" | "CtxtMenu_MenuLabel" | "CtxtMenu_MenuRadioCheck" | "CtxtMenu_MenuRule" | "CtxtMenu_MousePost" | "CtxtMenu_RTL" | "CtxtMenu_Attached" | "CtxtMenu_Info" | "CtxtMenu_InfoClose" | "CtxtMenu_InfoContent" | "CtxtMenu_InfoSignature" | "CtxtMenu_InfoTitle" | "CtxtMenu_MenuFrame" = HtmlClasses['MENUITEM']

Inherited from AbstractEntry.className

Overwrites MenuElement.className

- Defined in abstract_entry.ts:38

Class name.

type

  {HtmlClass}

### Protected disabled

disabled: boolean = false

Inherited from AbstractItem.disabled

- Defined in abstract_item.ts:40

Flag indicating if element is disabled.

type

  {boolean}

### Protected role

role: string = "menuitem"

Inherited from AbstractEntry.role

Overwrites MenuElement.role

- Defined in abstract_entry.ts:44

Aria role element.

type

  {string}

## Methods

### Protected activate

- activate(): void

- Inherited from AbstractItem.activate

  - Defined in abstract_item.ts:150

  Sets active style for item.

  #### Returns void

### addAttributes

- addAttributes(attributes: object): void

- Inherited from MenuElement.addAttributes

  - Defined in menu_element.ts:50

  Adds a attributes and values to the HTML element.

  #### Parameters

  - ##### attributes: object

    A dictionary of attributes.

    - ##### [attr: string]: string

  #### Returns void

### addEvents

- addEvents(element: HTMLElement): void

- Inherited from AbstractNavigatable.addEvents

  - Defined in abstract_navigatable.ts:153

  Adds navigation events to an HTML element.

  #### Parameters

  - ##### element: HTMLElement

    The HTML element for navigation.

  #### Returns void

### bubbleKey

- bubbleKey(): void

- Inherited from AbstractNavigatable.bubbleKey

  - Defined in abstract_navigatable.ts:38

  Bubble this key event.

  #### Returns void

### click

- click(event: MouseEvent): void

- Implementation of MouseNavigatable.click

  Inherited from AbstractNavigatable.click

  - Defined in abstract_navigatable.ts:145
  override

  #### Parameters

  - ##### event: MouseEvent

  #### Returns void

### Protected deactivate

- deactivate(): void

- Inherited from AbstractItem.deactivate

  - Defined in abstract_item.ts:159

  Removes active style from item.

  #### Returns void

### disable

- disable(): void

- Implementation of Item.disable

  Inherited from AbstractItem.disable

  - Defined in abstract_item.ts:232
  override

  #### Returns void

### down

- down(event: KeyboardEvent): void

- Implementation of KeyNavigatable.down

  Inherited from AbstractItem.down

  Overwrites AbstractNavigatable.down

  - Defined in abstract_item.ts:197
  override

  #### Parameters

  - ##### event: KeyboardEvent

  #### Returns void

### enable

- enable(): void

- Implementation of Item.enable

  Inherited from AbstractItem.enable

  - Defined in abstract_item.ts:242
  override

  #### Returns void

### escape

- escape(event: KeyboardEvent): void

- Implementation of KeyNavigatable.escape

  Inherited from AbstractItem.escape

  Overwrites AbstractNavigatable.escape

  - Defined in abstract_item.ts:183
  override

  #### Parameters

  - ##### event: KeyboardEvent

  #### Returns void

### Protected executeAction

- executeAction(): void

- Inherited from AbstractItem.executeAction

  - Defined in abstract_item.ts:88

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

  #### Returns void

### focus

- focus(): void

- Implementation of Item.focus

  Inherited from AbstractItem.focus

  Overwrites MenuElement.focus

  - Defined in abstract_item.ts:166
  override

  #### Returns void

### generateHtml

- generateHtml(): void

- Implementation of Item.generateHtml

  Overwrites AbstractItem.generateHtml

  - Defined in item_label.ts:58
  override

  #### Returns void

### getContent

- getContent(): string

- Implementation of Item.getContent

  Inherited from AbstractItem.getContent

  - Defined in abstract_item.ts:64
  override

  #### Returns string

### getHtml

- getHtml(): HTMLElement

- Implementation of Item.getHtml

  Inherited from MenuElement.getHtml

  - Defined in menu_element.ts:59
  override

  #### Returns HTMLElement

### getId

- getId(): string

- Implementation of Item.getId

  Inherited from AbstractItem.getId

  - Defined in abstract_item.ts:71
  override

  #### Returns string

### getMenu

- getMenu(): Menu

- Implementation of Item.getMenu

  Inherited from AbstractEntry.getMenu

  - Defined in abstract_entry.ts:66

  #### Returns Menu

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

### getType

- getType(): string

- Implementation of Item.getType

  Inherited from AbstractEntry.getType

  - Defined in abstract_entry.ts:80

  #### Returns string

  The type of the menu entry, used for jsonification.

### hide

- hide(): void

- Implementation of Item.hide

  Inherited from AbstractEntry.hide

  - Defined in abstract_entry.ts:87
  override

  #### Returns void

### isHidden

- isHidden(): boolean

- Implementation of Item.isHidden

  Inherited from AbstractEntry.isHidden

  - Defined in abstract_entry.ts:103
  override

  #### Returns boolean

### keydown

- keydown(event: KeyboardEvent): void

- Implementation of KeyNavigatable.keydown

  Inherited from AbstractNavigatable.keydown

  - Defined in abstract_navigatable.ts:45
  override

  #### Parameters

  - ##### event: KeyboardEvent

  #### Returns void

### left

- left(event: KeyboardEvent): void

- Implementation of KeyNavigatable.left

  Inherited from AbstractItem.left

  Overwrites AbstractNavigatable.left

  - Defined in abstract_item.ts:205
  override

  #### Parameters

  - ##### event: KeyboardEvent

  #### Returns void

### mousedown

- mousedown(event: MouseEvent): void

- Implementation of MouseNavigatable.mousedown

  Inherited from AbstractItem.mousedown

  Overwrites AbstractNavigatable.mousedown

  - Defined in abstract_item.ts:116
  override

  #### Parameters

  - ##### event: MouseEvent

  #### Returns void

### mouseout

- mouseout(event: MouseEvent): void

- Implementation of MouseNavigatable.mouseout

  Inherited from AbstractItem.mouseout

  Overwrites AbstractNavigatable.mouseout

  - Defined in abstract_item.ts:132
  override

  #### Parameters

  - ##### event: MouseEvent

  #### Returns void

### mouseover

- mouseover(event: MouseEvent): void

- Implementation of MouseNavigatable.mouseover

  Inherited from AbstractItem.mouseover

  Overwrites AbstractNavigatable.mouseover

  - Defined in abstract_item.ts:124
  override

  #### Parameters

  - ##### event: MouseEvent

  #### Returns void

### mouseup

- mouseup(event: MouseEvent): void

- Implementation of MouseNavigatable.mouseup

  Inherited from AbstractNavigatable.mouseup

  - Defined in abstract_navigatable.ts:124
  override

  #### Parameters

  - ##### event: MouseEvent

  #### Returns void

### press

- press(): void

- Implementation of Item.press

  Inherited from AbstractItem.press

  - Defined in abstract_item.ts:78
  override

  #### Returns void

### registerCallback

- registerCallback(func: Function): void

- Inherited from AbstractItem.registerCallback

  - Defined in abstract_item.ts:95

  Registers a callback function.

  final

  #### Parameters

  - ##### func: Function

    Callback that does not take any arguments.

  #### Returns void

### right

- right(event: KeyboardEvent): void

- Implementation of KeyNavigatable.right

  Inherited from AbstractItem.right

  Overwrites AbstractNavigatable.right

  - Defined in abstract_item.ts:218
  override

  #### Parameters

  - ##### event: KeyboardEvent

  #### Returns void

### setHtml

- setHtml(html: HTMLElement): void

- Implementation of Item.setHtml

  Inherited from MenuElement.setHtml

  - Defined in menu_element.ts:69
  override

  #### Parameters

  - ##### html: HTMLElement

  #### Returns void

### setMenu

- setMenu(menu: Menu): void

- Implementation of Item.setMenu

  Inherited from AbstractEntry.setMenu

  - Defined in abstract_entry.ts:73

  #### Parameters

  - ##### menu: Menu

    Sets the menu.

  #### Returns void

### show

- show(): void

- Implementation of Item.show

  Inherited from AbstractEntry.show

  - Defined in abstract_entry.ts:95
  override

  #### Returns void

### space

- space(event: KeyboardEvent): void

- Implementation of KeyNavigatable.space

  Inherited from AbstractItem.space

  Overwrites AbstractNavigatable.space

  - Defined in abstract_item.ts:225
  override

  #### Parameters

  - ##### event: KeyboardEvent

  #### Returns void

### Protected stop

- stop(event: Event): void

- Inherited from AbstractNavigatable.stop

  - Defined in abstract_navigatable.ts:106

  Stops event propagation and bubbling.

  #### Parameters

  - ##### event: Event

    The keyboard event that fired.

  #### Returns void

### unfocus

- unfocus(): void

- Implementation of Item.unfocus

  Inherited from AbstractItem.unfocus

  Overwrites MenuElement.unfocus

  - Defined in abstract_item.ts:175
  override

  #### Returns void

### unregisterCallback

- unregisterCallback(func: Function): void

- Inherited from AbstractItem.unregisterCallback

  - Defined in abstract_item.ts:106

  Removes a callback function.

  final

  #### Parameters

  - ##### func: Function

    Callback that does not take any arguments.

  #### Returns void

### up

- up(event: KeyboardEvent): void

- Implementation of KeyNavigatable.up

  Inherited from AbstractItem.up

  Overwrites AbstractNavigatable.up

  - Defined in abstract_item.ts:190
  override

  #### Parameters

  - ##### event: KeyboardEvent

  #### Returns void

### Static parse

- parse(__namedParameters: object, menu: Menu): Label

- - Defined in item_label.ts:38

  Parses a JSON respresentation of a label item.

  #### Parameters

  - ##### __namedParameters: object

    - ##### content: string

    - ##### id: string

  - ##### menu: Menu

    The menu the item is attached to.

  #### Returns Label

  The new label object.

Generated using TypeDoc