跳到主要内容
版本:Next

Class: ActivityBarService

molecule.ActivityBarService

Hierarchy​

Implements​

Constructors​

constructor​

• new ActivityBarService()

Overrides​

Component.constructor

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​

IActivityBarService.state

Overrides​

Component.state

Defined in​

services/workbench/activityBarService.ts:79

Methods​

add​

▸ add(data, isActive?): void

Add IActivityBarItem data

Parameters​

NameTypeDefault value
dataIActivityBarItem | IActivityBarItem[]undefined
isActivebooleanfalse

Returns​

void

Implementation of​

IActivityBarService.add

Defined in​

services/workbench/activityBarService.ts:102


addContextMenu​

▸ addContextMenu(contextMenu): void

Add new contextMenus for the activityBar

Parameters​

NameType
contextMenuIActivityMenuItemProps | IActivityMenuItemProps[]

Returns​

void

Implementation of​

IActivityBarService.addContextMenu

Defined in​

services/workbench/activityBarService.ts:196


count​

▸ count(name): number

Count the service event

Parameters​

NameTypeDescription
namestringEvent name

Returns​

number

Implementation of​

IActivityBarService.count

Inherited from​

Component.count

Defined in​

common/event/eventBus.ts:28


emit​

▸ emit(name, ...args): void

Emit the service event

Parameters​

NameTypeDescription
namestringEvent name
...argsanyArguments

Returns​

void

Implementation of​

IActivityBarService.emit

Inherited from​

Component.emit

Defined in​

common/event/eventBus.ts:20


forceUpdate​

▸ forceUpdate(): void

Force to update the Component

Returns​

void

Implementation of​

IActivityBarService.forceUpdate

Inherited from​

Component.forceUpdate

Defined in​

react/component.ts:81


getRemoveList​

▸ Private getRemoveList<T>(id, data): number[]

Type parameters​

NameType
Textends IActivityBarItem | IActivityMenuItemProps

Parameters​

NameType
idUniqueId | UniqueId[]
dataT[]

Returns​

number[]

Defined in​

services/workbench/activityBarService.ts:125


getState​

▸ getState(): IActivityBar

Get the Component state

Returns​

IActivityBar

Implementation of​

IActivityBarService.getState

Inherited from​

Component.getState

Defined in​

react/component.ts:85


onChange​

▸ onChange(callback): void

Called when activity bar item which is not global is changed

Parameters​

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

Returns​

void

Implementation of​

IActivityBarService.onChange

Defined in​

services/workbench/activityBarService.ts:237


onClick​

▸ onClick(callback): void

Add click event listener

Parameters​

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

Returns​

void

Implementation of​

IActivityBarService.onClick

Defined in​

services/workbench/activityBarService.ts:231


onUpdateState​

▸ onUpdateState(listener): void

Listen to the Component state update event

Parameters​

NameType
listener(prevState: IActivityBar, nextState: IActivityBar) => void

Returns​

void

Implementation of​

IActivityBarService.onUpdateState

Inherited from​

Component.onUpdateState

Defined in​

react/component.ts:73


remove​

▸ remove(id): void

Remove the specific activity bar by id

Parameters​

NameType
idUniqueId | UniqueId[]

Returns​

void

Implementation of​

IActivityBarService.remove

Defined in​

services/workbench/activityBarService.ts:138


removeContextMenu​

▸ removeContextMenu(id): void

Remove the specific contextMenu item by id

Parameters​

NameType
idUniqueId | 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​

NameType
listener?Function

Returns​

void

Implementation of​

IActivityBarService.removeOnUpdateState

Inherited from​

Component.removeOnUpdateState

Defined in​

react/component.ts:77


render​

▸ render(nextState?): void

Initiative notify the component to render the view by the state

Parameters​

NameType
nextState?IActivityBar

Returns​

void

Implementation of​

IActivityBarService.render

Inherited from​

Component.render

Defined in​

react/component.ts:69


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​

IActivityBarService.reset

Defined in​

services/workbench/activityBarService.ts:94


setActive​

▸ setActive(id?): void

Set active bar

Parameters​

NameType
id?UniqueId

Returns​

void

Implementation of​

IActivityBarService.setActive

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​

NameTypeDescription
valuesPartial<IActivityBar>update target state values
callback?(prevState: IActivityBar, nextState: IActivityBar) => void-

Returns​

void

Implementation of​

IActivityBarService.setState

Inherited from​

Component.setState

Defined in​

react/component.ts:56


subscribe​

▸ subscribe(name, listener): void

Subscribe the service event

Parameters​

NameTypeDescription
namestring | string[]Event name
listenerFunctionListener function

Returns​

void

Implementation of​

IActivityBarService.subscribe

Inherited from​

Component.subscribe

Defined in​

common/event/eventBus.ts:11


toggleBar​

▸ toggleBar(id): void

Toggle the specific activity bar between show or hide

Parameters​

NameType
idUniqueId

Returns​

void

Implementation of​

IActivityBarService.toggleBar

Defined in​

services/workbench/activityBarService.ts:158


toggleContextMenuChecked​

▸ toggleContextMenuChecked(id): void

Toggle the contextMenu between checked or unchecked

Parameters​

NameType
idUniqueId

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​

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

Returns​

void

Implementation of​

IActivityBarService.unsubscribe

Inherited from​

Component.unsubscribe

Defined in​

common/event/eventBus.ts:37