Class: ActivityBarService
molecule.ActivityBarService
Hierarchy
↳
ActivityBarService
Implements
Constructors
constructor
• new ActivityBarService()
Overrides
Defined in
src/services/workbench/activityBarService.ts:81
Properties
sidebarService
• Private
sidebarService: ISidebarService
Defined in
src/services/workbench/activityBarService.ts:79
state
• Protected
state: IActivityBar
Implementation of
Overrides
Defined in
src/services/workbench/activityBarService.ts:78
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
src/services/workbench/activityBarService.ts:101
addContextMenu
▸ addContextMenu(contextMenu
): void
Add new contextMenus for the activityBar
Parameters
Name | Type |
---|---|
contextMenu | IActivityMenuItemProps | IActivityMenuItemProps [] |
Returns
void
Implementation of
IActivityBarService.addContextMenu
Defined in
src/services/workbench/activityBarService.ts:195
count
▸ count(name
): number
Count the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
Returns
number
Implementation of
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
Implementation of
Inherited from
Defined in
src/common/event/eventBus.ts:20
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
src/services/workbench/activityBarService.ts:124
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
src/services/workbench/activityBarService.ts:236
onClick
▸ onClick(callback
): void
Add click event listener
Parameters
Name | Type |
---|---|
callback | (selectedKey : UniqueId , item : IActivityBarItem ) => void |
Returns
void
Implementation of
Defined in
src/services/workbench/activityBarService.ts:230
onUpdateState
▸ onUpdateState(callback
): void
Listen to the Component state update event
Parameters
Name | Type |
---|---|
callback | (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
src/services/workbench/activityBarService.ts:137
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
src/services/workbench/activityBarService.ts:210
removeOnUpdateState
▸ removeOnUpdateState(): void
Remove the Component update event listening
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
src/services/workbench/activityBarService.ts:93
setActive
▸ setActive(id?
): void
Set active bar
Parameters
Name | Type |
---|---|
id? | UniqueId |
Returns
void
Implementation of
Defined in
src/services/workbench/activityBarService.ts:87
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
, callback
): void
Subscribe the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | string [] | Event name |
callback | Function | Callback function |
Returns
void
Implementation of
Inherited from
Defined in
src/common/event/eventBus.ts:11
toggleBar
▸ toggleBar(id
): void
Toggle the specific activity bar between show or hide
Parameters
Name | Type |
---|---|
id | UniqueId |
Returns
void
Implementation of
Defined in
src/services/workbench/activityBarService.ts:157
toggleContextMenuChecked
▸ toggleContextMenuChecked(id
): void
Toggle the contextMenu between checked or unchecked
Parameters
Name | Type |
---|---|
id | UniqueId |
Returns
void
Implementation of
IActivityBarService.toggleContextMenuChecked
Defined in
src/services/workbench/activityBarService.ts:178
unsubscribe
▸ unsubscribe(name
): void
Unsubscribe the specific event
Parameters
Name | Type | Description |
---|---|---|
name | any | The event name |
Returns
void
Implementation of
IActivityBarService.unsubscribe