Skip to main content
Version: 0.9.0-beta.2

Interface: IActivityBarService

molecule.IActivityBarService

Hierarchy

Implemented by

Properties

state

Protected Abstract state: IActivityBar

Inherited from

Component.state

Defined in

src/react/component.ts:42

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:27


addContextMenu

addContextMenu(data): void

Add new contextMenus for the activityBar

Parameters

NameType
dataIActivityMenuItemProps | IActivityMenuItemProps[]

Returns

void

Defined in

src/services/workbench/activityBarService.ts:50


count

count(name): number

Count the service event

Parameters

NameTypeDescription
namestringEvent name

Returns

number

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

Inherited from

Component.emit

Defined in

src/common/event/eventBus.ts:20


forceUpdate

forceUpdate(): void

Force to update the Component

Returns

void

Inherited from

Component.forceUpdate

Defined in

src/react/component.ts:79


getState

getState(): IActivityBar

Get the Component state

Returns

IActivityBar

Inherited from

Component.getState

Defined in

src/react/component.ts:83


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:66


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:62


onUpdateState

onUpdateState(callback): void

Listen to the Component state update event

Parameters

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

Returns

void

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

Defined in

src/services/workbench/activityBarService.ts:36


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:57


removeOnUpdateState

removeOnUpdateState(): void

Remove the Component update event listening

Returns

void

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

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

Defined in

src/services/workbench/activityBarService.ts:22


setActive

setActive(id?): void

Set active bar

Parameters

NameType
id?UniqueId

Returns

void

Defined in

src/services/workbench/activityBarService.ts:31


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

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

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:41


toggleContextMenuChecked

toggleContextMenuChecked(id): void

Toggle the contextMenu between checked or unchecked

Parameters

NameTypeDescription
idUniqueIdcontextmenu id

Returns

void

Defined in

src/services/workbench/activityBarService.ts:46


unsubscribe

unsubscribe(name): void

Unsubscribe the specific event

Parameters

NameTypeDescription
nameanyThe event name

Returns

void

Inherited from

Component.unsubscribe

Defined in

src/common/event/eventBus.ts:37