Class: ActivityBarService
molecule.ActivityBarService
Hierarchy
↳
ActivityBarService
Implements
Constructors
constructor
• new ActivityBarService()
Overrides
Defined in
services/workbench/activityBarService.ts:82
Properties
sidebarService
• Private
sidebarService: ISidebarService
Defined in
services/workbench/activityBarService.ts:80
state
• Protected
state: IActivityBar
Implementation of
Overrides
Defined in
services/workbench/activityBarService.ts:79
Methods
add
▸ add(data
, isActive?
): void
Add IActivityBarItem data
Parameters
Name | Type | Default value |
---|---|---|
data | IActivityBarItem | IActivityBarItem [] | undefined |
isActive | boolean | false |
Returns
void
Implementation of
Defined in
services/workbench/activityBarService.ts:102
addContextMenu
▸ addContextMenu(contextMenu
): void
Add new contextMenus for the activityBar
Parameters
Name | Type |
---|---|
contextMenu | IActivityMenuItemProps | IActivityMenuItemProps [] |
Returns
void
Implementation of
IActivityBarService.addContextMenu
Defined in
services/workbench/activityBarService.ts:196
count
▸ count(name
): number
Count the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
Returns
number
Implementation of
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
Implementation of
Inherited from
Defined in
forceUpdate
▸ forceUpdate(): void
Force to update the Component
Returns
void
Implementation of
IActivityBarService.forceUpdate
Inherited from
Defined in
getRemoveList
▸ Private
getRemoveList<T
>(id
, data
): number
[]
Type parameters
Name | Type |
---|---|
T | extends IActivityBarItem | IActivityMenuItemProps |
Parameters
Name | Type |
---|---|
id | UniqueId | UniqueId [] |
data | T [] |
Returns
number
[]
Defined in
services/workbench/activityBarService.ts:125
getState
▸ getState(): IActivityBar
Get the Component state
Returns
Implementation of
Inherited from
Defined in
onChange
▸ onChange(callback
): void
Called when activity bar item which is not global is changed
Parameters
Name | Type |
---|---|
callback | (prevSelectedKey? : UniqueId , nextSelectedKey? : UniqueId ) => void |
Returns
void
Implementation of
Defined in
services/workbench/activityBarService.ts:237
onClick
▸ onClick(callback
): void
Add click event listener
Parameters
Name | Type |
---|---|
callback | (selectedKey : UniqueId , item : IActivityBarItem ) => void |
Returns
void
Implementation of
Defined in
services/workbench/activityBarService.ts:231
onUpdateState
▸ onUpdateState(listener
): void
Listen to the Component state update event
Parameters
Name | Type |
---|---|
listener | (prevState : IActivityBar , nextState : IActivityBar ) => void |
Returns
void
Implementation of
IActivityBarService.onUpdateState
Inherited from
Defined in
remove
▸ remove(id
): void
Remove the specific activity bar by id
Parameters
Name | Type |
---|---|
id | UniqueId | UniqueId [] |
Returns
void
Implementation of
Defined in
services/workbench/activityBarService.ts:138
removeContextMenu
▸ removeContextMenu(id
): void
Remove the specific contextMenu item by id
Parameters
Name | Type |
---|---|
id | UniqueId | UniqueId [] |
Returns
void
Implementation of
IActivityBarService.removeContextMenu
Defined in
services/workbench/activityBarService.ts:211
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
Implementation of
IActivityBarService.removeOnUpdateState
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
Implementation of
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
Implementation of
Defined in
services/workbench/activityBarService.ts:94
setActive
▸ setActive(id?
): void
Set active bar
Parameters
Name | Type |
---|---|
id? | UniqueId |
Returns
void
Implementation of
Defined in
services/workbench/activityBarService.ts:88
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
Implementation of
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
Implementation of
Inherited from
Defined in
toggleBar
▸ toggleBar(id
): void
Toggle the specific activity bar between show or hide
Parameters
Name | Type |
---|---|
id | UniqueId |
Returns
void
Implementation of
Defined in
services/workbench/activityBarService.ts:158
toggleContextMenuChecked
▸ toggleContextMenuChecked(id
): void
Toggle the contextMenu between checked or unchecked
Parameters
Name | Type |
---|---|
id | UniqueId |
Returns
void
Implementation of
IActivityBarService.toggleContextMenuChecked
Defined in
services/workbench/activityBarService.ts:179
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
Implementation of
IActivityBarService.unsubscribe