Interface: IActivityBarService
molecule.IActivityBarService
Hierarchy
↳
IActivityBarService
Implemented by
Properties
state
• Protected
Abstract
state: IActivityBar
Inherited from
Defined in
Methods
add
▸ add(data
, isActive?
): void
Add IActivityBarItem data
Parameters
Name | Type | Description |
---|---|---|
data | IActivityBarItem | IActivityBarItem [] | - |
isActive? | boolean | If provide, Activity Bar will set data active automatically. Only works in one data |
Returns
void
Defined in
services/workbench/activityBarService.ts:27
addContextMenu
▸ addContextMenu(data
): void
Add new contextMenus for the activityBar
Parameters
Name | Type |
---|---|
data | IActivityMenuItemProps | IActivityMenuItemProps [] |
Returns
void
Defined in
services/workbench/activityBarService.ts:50
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
getState
▸ getState(): IActivityBar
Get the Component state
Returns
Inherited from
Defined in
onChange
▸ onChange(callback
): any
Called when activity bar item which is not global is changed
Parameters
Name | Type |
---|---|
callback | (prevSelectedKey? : UniqueId , nextSelectedKey? : UniqueId ) => void |
Returns
any
Defined in
services/workbench/activityBarService.ts:66
onClick
▸ onClick(callback
): any
Add click event listener
Parameters
Name | Type |
---|---|
callback | (selectedKey : UniqueId , item : IActivityBarItem ) => void |
Returns
any
Defined in
services/workbench/activityBarService.ts:62
onUpdateState
▸ onUpdateState(listener
): void
Listen to the Component state update event
Parameters
Name | Type |
---|---|
listener | (prevState : IActivityBar , nextState : IActivityBar ) => void |
Returns
void
Inherited from
Defined in
remove
▸ remove(id
): void
Remove the specific activity bar by id
Parameters
Name | Type |
---|---|
id | UniqueId | UniqueId [] |
Returns
void
Defined in
services/workbench/activityBarService.ts:36
removeContextMenu
▸ removeContextMenu(id
): void
Remove the specific contextMenu item by id
Parameters
Name | Type | Description |
---|---|---|
id | UniqueId | UniqueId [] | contextmenu id |
Returns
void
Defined in
services/workbench/activityBarService.ts:57
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? | IActivityBar |
Returns
void
Inherited from
Defined in
reset
▸ reset(): void
Reset the activityBar state data, if you want to whole customize the activityBar, you can reset it first, and then using the activityBar.add() method to fill the data you need.
Returns
void
Defined in
services/workbench/activityBarService.ts:22
setActive
▸ setActive(id?
): void
Set active bar
Parameters
Name | Type |
---|---|
id? | UniqueId |
Returns
void
Defined in
services/workbench/activityBarService.ts:31
setState
▸ setState(values
, callback?
): void
Set the state values, and notify the view component to re render
Parameters
Name | Type | Description |
---|---|---|
values | Partial <IActivityBar > | update target state values |
callback? | (prevState : IActivityBar , nextState : IActivityBar ) => 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
toggleBar
▸ toggleBar(id
): void
Toggle the specific activity bar between show or hide
Parameters
Name | Type | Description |
---|---|---|
id | UniqueId | activity bar id |
Returns
void
Defined in
services/workbench/activityBarService.ts:41
toggleContextMenuChecked
▸ toggleContextMenuChecked(id
): void
Toggle the contextMenu between checked or unchecked
Parameters
Name | Type | Description |
---|---|---|
id | UniqueId | contextmenu id |
Returns
void
Defined in
services/workbench/activityBarService.ts:46
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