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
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
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
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
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
services/workbench/menuBarService.ts:50
onUpdateState
▸ onUpdateState(listener
): void
Listen to the Component state update event
Parameters
Name | Type |
---|---|
listener | (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
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
Name | Type |
---|---|
listener? | Function |
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
services/workbench/menuBarService.ts:45
setMenus
▸ setMenus(data
): void
Set the menus data
Parameters
Name | Type |
---|---|
data | IMenuBarItem [] |
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
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
, listener
): void
Subscribe the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | string [] | Event name |
listener | Function | Listener function |
Returns
void
Inherited from
Defined in
unsubscribe
▸ unsubscribe(name
, listener?
): void
Unsubscribe the specific event and the listener function
Parameters
Name | Type | Description |
---|---|---|
name | any | The event name |
listener? | Function | optional, it unsubscribes events via name if not pass the listener function |
Returns
void
Inherited from
Defined in
update
▸ update(menuId
, menuItem
): void
Update the specific menu item data
Parameters
Name | Type |
---|---|
menuId | UniqueId |
menuItem | IMenuBarItem |
Returns
void