跳到主要内容
版本:0.9.0-beta.2

Class: ActivityBarService

molecule.ActivityBarService

Hierarchy

Implements

Constructors

constructor

new ActivityBarService()

Overrides

Component.constructor

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

IActivityBarService.state

Overrides

Component.state

Defined in

src/services/workbench/activityBarService.ts:78

Methods

add

add(data, isActive?): void

Add IActivityBarItem data

Parameters

NameTypeDefault value
dataIActivityBarItem | IActivityBarItem[]undefined
isActivebooleanfalse

Returns

void

Implementation of

IActivityBarService.add

Defined in

src/services/workbench/activityBarService.ts:101


addContextMenu

addContextMenu(contextMenu): void

Add new contextMenus for the activityBar

Parameters

NameType
contextMenuIActivityMenuItemProps | IActivityMenuItemProps[]

Returns

void

Implementation of

IActivityBarService.addContextMenu

Defined in

src/services/workbench/activityBarService.ts:195


count

count(name): number

Count the service event

Parameters

NameTypeDescription
namestringEvent name

Returns

number

Implementation of

IActivityBarService.count

Inherited from

Component.count

Defined in

src/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

src/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

src/react/component.ts:79


getRemoveList

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

Type parameters

NameType
Textends IActivityBarItem | IActivityMenuItemProps

Parameters

NameType
idUniqueId | UniqueId[]
dataT[]

Returns

number[]

Defined in

src/services/workbench/activityBarService.ts:124


getState

getState(): IActivityBar

Get the Component state

Returns

IActivityBar

Implementation of

IActivityBarService.getState

Inherited from

Component.getState

Defined in

src/react/component.ts:83


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

src/services/workbench/activityBarService.ts:236


onClick

onClick(callback): void

Add click event listener

Parameters

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

Returns

void

Implementation of

IActivityBarService.onClick

Defined in

src/services/workbench/activityBarService.ts:230


onUpdateState

onUpdateState(callback): void

Listen to the Component state update event

Parameters

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

Returns

void

Implementation of

IActivityBarService.onUpdateState

Inherited from

Component.onUpdateState

Defined in

src/react/component.ts:71


remove

remove(id): void

Remove the specific activity bar by id

Parameters

NameType
idUniqueId | UniqueId[]

Returns

void

Implementation of

IActivityBarService.remove

Defined in

src/services/workbench/activityBarService.ts:137


removeContextMenu

removeContextMenu(id): void

Remove the specific contextMenu item by id

Parameters

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

Component.removeOnUpdateState

Defined in

src/react/component.ts:75


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

src/react/component.ts:67


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

src/services/workbench/activityBarService.ts:93


setActive

setActive(id?): void

Set active bar

Parameters

NameType
id?UniqueId

Returns

void

Implementation of

IActivityBarService.setActive

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

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

src/react/component.ts:54


subscribe

subscribe(name, callback): void

Subscribe the service event

Parameters

NameTypeDescription
namestring | string[]Event name
callbackFunctionCallback function

Returns

void

Implementation of

IActivityBarService.subscribe

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

NameType
idUniqueId

Returns

void

Implementation of

IActivityBarService.toggleBar

Defined in

src/services/workbench/activityBarService.ts:157


toggleContextMenuChecked

toggleContextMenuChecked(id): void

Toggle the contextMenu between checked or unchecked

Parameters

NameType
idUniqueId

Returns

void

Implementation of

IActivityBarService.toggleContextMenuChecked

Defined in

src/services/workbench/activityBarService.ts:178


unsubscribe

unsubscribe(name): void

Unsubscribe the specific event

Parameters

NameTypeDescription
nameanyThe event name

Returns

void

Implementation of

IActivityBarService.unsubscribe

Inherited from

Component.unsubscribe

Defined in

src/common/event/eventBus.ts:37