Skip to main content
Version: 1.x

Class: EditorTreeService

molecule.EditorTreeService

Hierarchy

Implements

Constructors

constructor

new EditorTreeService()

Overrides

Component.constructor

Defined in

services/workbench/explorer/editorTreeService.ts:78

Properties

editorService

Private Readonly editorService: EditorService

Defined in

services/workbench/explorer/editorTreeService.ts:76


state

Protected state: IEditor

Implementation of

IEditorTreeService.state

Overrides

Component.state

Defined in

services/workbench/explorer/editorTreeService.ts:75

Methods

count

count(name): number

Count the service event

Parameters

NameTypeDescription
namestringEvent name

Returns

number

Implementation of

IEditorTreeService.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

IEditorTreeService.emit

Inherited from

Component.emit

Defined in

common/event/eventBus.ts:20


forceUpdate

forceUpdate(): void

Force to update the Component

Returns

void

Implementation of

IEditorTreeService.forceUpdate

Inherited from

Component.forceUpdate

Defined in

react/component.ts:81


getState

getState(): IEditor

Get the Component state

Returns

IEditor

Implementation of

IEditorTreeService.getState

Inherited from

Component.getState

Defined in

react/component.ts:85


onClose

onClose(callback): void

Callabck for close a certain tab

Parameters

NameType
callback(tabId: UniqueId, groupId: UniqueId) => void

Returns

void

Implementation of

IEditorTreeService.onClose

Defined in

services/workbench/explorer/editorTreeService.ts:84


onCloseAll

onCloseAll(callback): void

Callback for close all tabs When specify groupId, it'll close that group

Parameters

NameType
callback(groupId?: UniqueId) => void

Returns

void

Implementation of

IEditorTreeService.onCloseAll

Defined in

services/workbench/explorer/editorTreeService.ts:102


onCloseOthers

onCloseOthers(callback): void

Callback for close others tabs except this tabItem

Parameters

NameType
callback(tabItem: IEditorTab<BuiltInEditorTabDataType>, groupId: UniqueId) => void

Returns

void

Implementation of

IEditorTreeService.onCloseOthers

Defined in

services/workbench/explorer/editorTreeService.ts:88


onCloseSaved

onCloseSaved(callback): void

Callback for close saved tabs in this group

Parameters

NameType
callback(groupId: UniqueId) => void

Returns

void

Implementation of

IEditorTreeService.onCloseSaved

Defined in

services/workbench/explorer/editorTreeService.ts:94


onContextMenu

onContextMenu(callback): void

Callback for context menu click event which isn't in buit-in menus

Parameters

NameType
callback(menu: IMenuItemProps, file: ITabProps<any, any>, groupId: UniqueId) => void

Returns

void

Implementation of

IEditorTreeService.onContextMenu

Defined in

services/workbench/explorer/editorTreeService.ts:120


onLayout

onLayout(callback): void

Callback for adjust editor layout

Parameters

NameType
callback() => void

Returns

void

Implementation of

IEditorTreeService.onLayout

Defined in

services/workbench/explorer/editorTreeService.ts:116


onSaveAll

onSaveAll(callback): void

Callback for save all tabs When specify groupId, it'll save that group

Parameters

NameType
callback(groupId?: UniqueId) => void

Returns

void

Implementation of

IEditorTreeService.onSaveAll

Defined in

services/workbench/explorer/editorTreeService.ts:106


onSelect

onSelect(callback): void

Callback for select tab in this group

Parameters

NameType
callback(tabId: UniqueId, groupId: UniqueId) => void

Returns

void

Implementation of

IEditorTreeService.onSelect

Defined in

services/workbench/explorer/editorTreeService.ts:98


onToolbarClick

onToolbarClick(callback): void

Callback for the click event from toolbar buttons, except for saving button and closing button, if you want to subscribe to the click events for these two buttons, please use the methods of onSaveAll and onCloseAll

Parameters

NameType
callback(toolbar: IActionBarItemProps<any>, groupId?: UniqueId) => void

Returns

void

Implementation of

IEditorTreeService.onToolbarClick

Defined in

services/workbench/explorer/editorTreeService.ts:110


onUpdateState

onUpdateState(listener): void

Listen to the Component state update event

Parameters

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

Returns

void

Implementation of

IEditorTreeService.onUpdateState

Inherited from

Component.onUpdateState

Defined in

react/component.ts:73


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

IEditorTreeService.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?IEditor

Returns

void

Implementation of

IEditorTreeService.render

Inherited from

Component.render

Defined in

react/component.ts:69


setState

setState(values, callback?): void

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

Parameters

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

Returns

void

Implementation of

IEditorTreeService.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

IEditorTreeService.subscribe

Inherited from

Component.subscribe

Defined in

common/event/eventBus.ts:11


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

IEditorTreeService.unsubscribe

Inherited from

Component.unsubscribe

Defined in

common/event/eventBus.ts:37