跳到主要内容
版本:1.x

Interface: IMenuBarService

molecule.IMenuBarService

Hierarchy​

Implemented by​

Properties​

state​

• Protected Abstract state: IMenuBar

Inherited from​

Component.state

Defined in​

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​

services/workbench/menuBarService.ts:25


count​

▸ count(name): number

Count the service event

Parameters​

NameTypeDescription
namestringEvent name

Returns​

number

Inherited from​

Component.count

Defined in​

common/event/eventBus.ts:28


emit​

▸ emit(name, ...args): void

Emit the service event

Parameters​

NameTypeDescription
namestringEvent name
...argsanyArguments

Returns​

void

Inherited from​

Component.emit

Defined in​

common/event/eventBus.ts:20


forceUpdate​

▸ forceUpdate(): void

Force to update the Component

Returns​

void

Inherited from​

Component.forceUpdate

Defined in​

react/component.ts:81


getMenuById​

▸ getMenuById(menuId): undefined | IMenuBarItem

Get the specific menu item

Parameters​

NameType
menuIdUniqueId

Returns​

undefined | IMenuBarItem

Defined in​

services/workbench/menuBarService.ts:35


getState​

▸ getState(): IMenuBar

Get the Component state

Returns​

IMenuBar

Inherited from​

Component.getState

Defined in​

react/component.ts:85


onSelect​

▸ onSelect(callback): void

listen to the onSelect event in menu

Parameters​

NameType
callback(menuId: UniqueId) => void

Returns​

void

Defined in​

services/workbench/menuBarService.ts:50


onUpdateState​

▸ onUpdateState(listener): void

Listen to the Component state update event

Parameters​

NameType
listener(prevState: IMenuBar, nextState: IMenuBar) => void

Returns​

void

Inherited from​

Component.onUpdateState

Defined in​

react/component.ts:73


remove​

▸ remove(menuId): void

Remove the specific menu item

Parameters​

NameType
menuIdUniqueId

Returns​

void

Defined in​

services/workbench/menuBarService.ts:30


removeOnUpdateState​

▸ removeOnUpdateState(listener?): void

Remove the Component update event listening, default is remove all, also you can remove one by pass the listener

Parameters​

NameType
listener?Function

Returns​

void

Inherited from​

Component.removeOnUpdateState

Defined in​

react/component.ts:77


render​

▸ render(nextState?): void

Initiative notify the component to render the view by the state

Parameters​

NameType
nextState?IMenuBar

Returns​

void

Inherited from​

Component.render

Defined in​

react/component.ts:69


reset​

▸ reset(): void

Reset menu bar data;

Returns​

void

Defined in​

services/workbench/menuBarService.ts:45


setMenus​

▸ setMenus(data): void

Set the menus data

Parameters​

NameType
dataIMenuBarItem[]

Returns​

void

Defined in​

services/workbench/menuBarService.ts:19


setState​

▸ setState(values, callback?): void

Set the state values, and notify the view component to re render

Parameters​

NameTypeDescription
valuesPartial<IMenuBar>update target state values
callback?(prevState: IMenuBar, nextState: IMenuBar) => void-

Returns​

void

Inherited from​

Component.setState

Defined in​

react/component.ts:56


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​

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​

common/event/eventBus.ts:37


update​

▸ update(menuId, menuItem): void

Update the specific menu item data

Parameters​

NameType
menuIdUniqueId
menuItemIMenuBarItem

Returns​

void

Defined in​

services/workbench/menuBarService.ts:41