Skip to main content

Interface: IMenuBarService

services.IMenuBarService

Hierarchy

Table of contents

Properties

Methods

Properties

state

Protected Abstract state: IMenuBar

Inherited from

Component.state

Defined in

src/react/component.ts:44

Methods

append

append(menuItem, parentId): void

Append a new menu into the specific menu found by parentId

Parameters

NameTypeDescription
menuItemIMenuBarItemthe new menu
parentIdUniqueId

Returns

void

Defined in

src/services/workbench/menuBarService.ts:16


getMenuById

getMenuById(menuId): undefined | IMenuBarItem

Get the specific menu item

Parameters

NameType
menuIdUniqueId

Returns

undefined | IMenuBarItem

Defined in

src/services/workbench/menuBarService.ts:26


onSelect

onSelect(callback): void

listen to the onSelect event in menu

Parameters

NameType
callback(menuId: UniqueId) => void

Returns

void

Defined in

src/services/workbench/menuBarService.ts:41


remove

remove(menuId): void

Remove the specific menu item

Parameters

NameType
menuIdUniqueId

Returns

void

Defined in

src/services/workbench/menuBarService.ts:21


reset

reset(): void

Reset menu bar data;

Returns

void

Defined in

src/services/workbench/menuBarService.ts:36


setMenus

setMenus(data): void

Set the menus data

Parameters

NameType
dataIMenuBarItem[]

Returns

void

Defined in

src/services/workbench/menuBarService.ts:10


subscribe

subscribe(name, listener): void

Subscribe the service event

Parameters

NameTypeDescription
namestring | string[]Event name
listenerFunctionListener function

Returns

void

Inherited from

Component.subscribe

Defined in

src/common/event/eventBus.ts:11


unsubscribe

unsubscribe(name, listener?): void

Unsubscribe the specific event and the listener function

Parameters

NameTypeDescription
nameanyThe event name
listener?Functionoptional, it unsubscribes events via name if not pass the listener function

Returns

void

Inherited from

Component.unsubscribe

Defined in

src/common/event/eventBus.ts:39


update

update(menuId, menuItem): void

Update the specific menu item data

Parameters

NameType
menuIdUniqueId
menuItemIMenuBarItem

Returns

void

Defined in

src/services/workbench/menuBarService.ts:32