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

Class: ExplorerService

molecule.ExplorerService

Hierarchy​

Implements​

Constructors​

constructor​

• new ExplorerService()

Overrides​

Component.constructor

Defined in​

src/services/workbench/explorer/explorerService.ts:85

Properties​

state​

• Protected state: IExplorer

Implementation of​

IExplorerService.state

Overrides​

Component.state

Defined in​

src/services/workbench/explorer/explorerService.ts:84

Methods​

addAction​

▸ addAction(action): void

Only add an action in toolbar actions

Parameters​

NameType
actionIMenuItemProps | IMenuItemProps[]

Returns​

void

Implementation of​

IExplorerService.addAction

Defined in​

src/services/workbench/explorer/explorerService.ts:193


addPanel​

▸ addPanel(data): void

Add a new panel, as well as add a new data for toolbar data

Parameters​

NameType
dataIExplorerPanelItem | IExplorerPanelItem[]

Returns​

void

Implementation of​

IExplorerService.addPanel

Defined in​

src/services/workbench/explorer/explorerService.ts:160


count​

▸ count(name): number

Count the service event

Parameters​

NameTypeDescription
namestringEvent name

Returns​

number

Implementation of​

IExplorerService.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​

IExplorerService.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​

IExplorerService.forceUpdate

Inherited from​

Component.forceUpdate

Defined in​

src/react/component.ts:79


getAction​

▸ getAction(id): undefined | IMenuItemProps

Get the specific action in toolbar actions

Parameters​

NameType
idUniqueId

Returns​

undefined | IMenuItemProps

Implementation of​

IExplorerService.getAction

Defined in​

src/services/workbench/explorer/explorerService.ts:94


getState​

▸ getState(): IExplorer

Get the Component state

Returns​

IExplorer

Implementation of​

IExplorerService.getState

Inherited from​

Component.getState

Defined in​

src/react/component.ts:83


onClick​

▸ onClick(callback): void

Listen to the Explorer header toolbar click event

Parameters​

NameType
callback(e: MouseEvent, item: IActionBarItemProps<any>) => void

Returns​

void

Implementation of​

IExplorerService.onClick

Defined in​

src/services/workbench/explorer/explorerService.ts:305


onPanelToolbarClick​

▸ onPanelToolbarClick(callback): void

Listen to the Explorer panel toolbar click event

Parameters​

NameType
callback(panel: IExplorerPanelItem, toolbarId: string) => void

Returns​

void

Implementation of​

IExplorerService.onPanelToolbarClick

Defined in​

src/services/workbench/explorer/explorerService.ts:315


onRemovePanel​

▸ onRemovePanel(callback): void

Listen to the Explorer panel remove event

Parameters​

NameType
callback(panel: IExplorerPanelItem) => void

Returns​

void

Implementation of​

IExplorerService.onRemovePanel

Defined in​

src/services/workbench/explorer/explorerService.ts:311


onUpdateState​

▸ onUpdateState(callback): void

Listen to the Component state update event

Parameters​

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

Returns​

void

Implementation of​

IExplorerService.onUpdateState

Inherited from​

Component.onUpdateState

Defined in​

src/react/component.ts:71


removeAction​

▸ removeAction(id): void

Remove the specific header toolbar action

Parameters​

NameType
idUniqueId

Returns​

void

Implementation of​

IExplorerService.removeAction

Defined in​

src/services/workbench/explorer/explorerService.ts:240


removeOnUpdateState​

▸ removeOnUpdateState(): void

Remove the Component update event listening

Returns​

void

Implementation of​

IExplorerService.removeOnUpdateState

Inherited from​

Component.removeOnUpdateState

Defined in​

src/react/component.ts:75


removePanel​

▸ removePanel(id): void

Remove a panel via id, as well as remove the corresponding action bar

Parameters​

NameType
idUniqueId

Returns​

void

Implementation of​

IExplorerService.removePanel

Defined in​

src/services/workbench/explorer/explorerService.ts:225


render​

▸ render(nextState?): void

Initiative notify the component to render the view by the state

Parameters​

NameType
nextState?IExplorer

Returns​

void

Implementation of​

IExplorerService.render

Inherited from​

Component.render

Defined in​

src/react/component.ts:67


reset​

▸ reset(): void

Reset the ExplorerService state, it's mainly for customizing the Explorer

Returns​

void

Implementation of​

IExplorerService.reset

Defined in​

src/services/workbench/explorer/explorerService.ts:298


setState​

▸ setState(values, callback?): void

Set the state values, and notify the view component to re render

Parameters​

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

Returns​

void

Implementation of​

IExplorerService.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​

IExplorerService.subscribe

Inherited from​

Component.subscribe

Defined in​

src/common/event/eventBus.ts:11


toggleHeaderBar​

▸ toggleHeaderBar(id): void

Only toggle the toolbar status

Parameters​

NameType
idUniqueId

Returns​

void

Implementation of​

IExplorerService.toggleHeaderBar

Defined in​

src/services/workbench/explorer/explorerService.ts:276


toggleIcon​

▸ Private toggleIcon(icon?): "" | "check"

Parameters​

NameType
icon?string

Returns​

"" | "check"

Defined in​

src/services/workbench/explorer/explorerService.ts:90


togglePanel​

▸ togglePanel(id): void

Toggle panel hidden, as well as toggle the toolbar status

Parameters​

NameType
idUniqueId

Returns​

void

Implementation of​

IExplorerService.togglePanel

Defined in​

src/services/workbench/explorer/explorerService.ts:260


unsubscribe​

▸ unsubscribe(name): void

Unsubscribe the specific event

Parameters​

NameTypeDescription
nameanyThe event name

Returns​

void

Implementation of​

IExplorerService.unsubscribe

Inherited from​

Component.unsubscribe

Defined in​

src/common/event/eventBus.ts:37


updateAction​

▸ updateAction(action): void

Update the action in toolbar actions

Parameters​

NameType
actionPartial<IMenuItemProps>

Returns​

void

Implementation of​

IExplorerService.updateAction

Defined in​

src/services/workbench/explorer/explorerService.ts:128


updatePanel​

▸ updatePanel(data): void

Update the panels data, as well as modify toolbar data

Parameters​

NameType
dataPartial<IExplorerPanelItem>

Returns​

void

Implementation of​

IExplorerService.updatePanel

Defined in​

src/services/workbench/explorer/explorerService.ts:100