Skip to main content

Interface: IActivityBarService

services.IActivityBarService

Hierarchy

Table of contents

Properties

Methods

Properties

state

Protected Abstract state: IActivityBar

Inherited from

Component.state

Defined in

src/react/component.ts:44

Methods

add

add(data, isActive?): void

Add IActivityBarItem data

Parameters

NameTypeDescription
dataIActivityBarItem | IActivityBarItem[]-
isActive?booleanIf provide, Activity Bar will set data active automatically. Only works in one data

Returns

void

Defined in

src/services/workbench/activityBarService.ts:18


addContextMenu

addContextMenu(data): void

Add new contextMenus for the activityBar

Parameters

NameType
dataIActivityMenuItemProps | IActivityMenuItemProps[]

Returns

void

Defined in

src/services/workbench/activityBarService.ts:41


onChange

onChange(callback): any

Called when activity bar item which is not global is changed

Parameters

NameType
callback(prevSelectedKey?: UniqueId, nextSelectedKey?: UniqueId) => void

Returns

any

Defined in

src/services/workbench/activityBarService.ts:55


onClick

onClick(callback): any

Add click event listener

Parameters

NameType
callback(selectedKey: UniqueId, item: IActivityBarItem) => void

Returns

any

Defined in

src/services/workbench/activityBarService.ts:51


remove

remove(id): void

Remove the specific activity bar by id

Parameters

NameType
idUniqueId | UniqueId[]

Returns

void

Defined in

src/services/workbench/activityBarService.ts:27


removeContextMenu

removeContextMenu(id): void

Remove the specific contextMenu item by id

Parameters

NameTypeDescription
idUniqueId | UniqueId[]contextmenu id

Returns

void

Defined in

src/services/workbench/activityBarService.ts:46


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

src/services/workbench/activityBarService.ts:13


setActive

setActive(id?): void

Set active bar

Parameters

NameType
id?UniqueId

Returns

void

Defined in

src/services/workbench/activityBarService.ts:22


subscribe

subscribe(name, listener): void

Subscribe the service event

Parameters

NameTypeDescription
namestring | string[]Event name
listenerFunctionListener function

Returns

void

Inherited from

Component.subscribe

Defined in

src/common/event/eventBus.ts:11


toggleBar

toggleBar(id): void

Toggle the specific activity bar between show or hide

Parameters

NameTypeDescription
idUniqueIdactivity bar id

Returns

void

Defined in

src/services/workbench/activityBarService.ts:32


toggleContextMenuChecked

toggleContextMenuChecked(id): void

Toggle the contextMenu between checked or unchecked

Parameters

NameTypeDescription
idUniqueIdcontextmenu id

Returns

void

Defined in

src/services/workbench/activityBarService.ts:37


unsubscribe

unsubscribe(name, listener?): void

Unsubscribe the specific event and the listener function

Parameters

NameTypeDescription
nameanyThe event name
listener?Functionoptional, it unsubscribes events via name if not pass the listener function

Returns

void

Inherited from

Component.unsubscribe

Defined in

src/common/event/eventBus.ts:39