Interface: IMenuBarService
molecule.IMenuBarService
Hierarchy
Implemented by
Properties
state
• Protected
Abstract
state: IMenuBar
Inherited from
Defined in
Methods
append
▸ append(menuItem
, parentId
): void
Append a new menu into the specific menu found by parentId
Parameters
Name | Type | Description |
---|---|---|
menuItem | IMenuBarItem | the new menu |
parentId | UniqueId |
Returns
void
Defined in
src/services/workbench/menuBarService.ts:25
count
▸ count(name
): number
Count the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
Returns
number
Inherited from
Defined in
src/common/event/eventBus.ts:28
emit
▸ emit(name
, ...args
): void
Emit the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
...args | any | Arguments |
Returns
void
Inherited from
Defined in
src/common/event/eventBus.ts:20
forceUpdate
▸ forceUpdate(): void
Force to update the Component
Returns
void
Inherited from
Defined in
getMenuById
▸ getMenuById(menuId
): undefined
| IMenuBarItem
Get the specific menu item
Parameters
Name | Type |
---|---|
menuId | UniqueId |
Returns
undefined
| IMenuBarItem
Defined in
src/services/workbench/menuBarService.ts:35
getState
▸ getState(): IMenuBar
Get the Component state
Returns
Inherited from
Defined in
onSelect
▸ onSelect(callback
): void
listen to the onSelect event in menu
Parameters
Name | Type |
---|---|
callback | (menuId : UniqueId ) => void |
Returns
void
Defined in
src/services/workbench/menuBarService.ts:50
onUpdateState
▸ onUpdateState(callback
): void
Listen to the Component state update event
Parameters
Name | Type |
---|---|
callback | (prevState : IMenuBar , nextState : IMenuBar ) => void |
Returns
void
Inherited from
Defined in
remove
▸ remove(menuId
): void
Remove the specific menu item
Parameters
Name | Type |
---|---|
menuId | UniqueId |
Returns
void
Defined in
src/services/workbench/menuBarService.ts:30
removeOnUpdateState
▸ removeOnUpdateState(): void
Remove the Component update event listening
Returns
void
Inherited from
Defined in
render
▸ render(nextState?
): void
Initiative notify the component to render the view by the state
Parameters
Name | Type |
---|---|
nextState? | IMenuBar |
Returns
void
Inherited from
Defined in
reset
▸ reset(): void
Reset menu bar data;
Returns
void
Defined in
src/services/workbench/menuBarService.ts:45
setMenus
▸ setMenus(data
): void
Set the menus data
Parameters
Name | Type |
---|---|
data | IMenuBarItem [] |
Returns
void
Defined in
src/services/workbench/menuBarService.ts:19
setState
▸ setState(values
, callback?
): void
Set the state values, and notify the view component to re render
Parameters
Name | Type | Description |
---|---|---|
values | Partial <IMenuBar > | update target state values |
callback? | (prevState : IMenuBar , nextState : IMenuBar ) => void | - |
Returns
void
Inherited from
Defined in
subscribe
▸ subscribe(name
, callback
): void
Subscribe the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | string [] | Event name |
callback | Function | Callback function |
Returns
void
Inherited from
Defined in
src/common/event/eventBus.ts:11
unsubscribe
▸ unsubscribe(name
): void
Unsubscribe the specific event
Parameters
Name | Type | Description |
---|---|---|
name | any | The event name |
Returns
void
Inherited from
Defined in
src/common/event/eventBus.ts:37
update
▸ update(menuId
, menuItem
): void
Update the specific menu item data
Parameters
Name | Type |
---|---|
menuId | UniqueId |
menuItem | IMenuBarItem |
Returns
void