Skip to main content
Version: 0.9.0-beta.2

Interface: IEditorTreeService

molecule.IEditorTreeService

Hierarchy

Implemented by

Properties

state

Protected Abstract state: IEditor

Inherited from

Component.state

Defined in

src/react/component.ts:42

Methods

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(): IEditor

Get the Component state

Returns

IEditor

Inherited from

Component.getState

Defined in

src/react/component.ts:83


onClose

onClose(callback): void

Callabck for close a certain tab

Parameters

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

Returns

void

Defined in

src/services/workbench/explorer/editorTreeService.ts:14


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

Defined in

src/services/workbench/explorer/editorTreeService.ts:37


onCloseOthers

onCloseOthers(callback): void

Callback for close others tabs except this tabItem

Parameters

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

Returns

void

Defined in

src/services/workbench/explorer/editorTreeService.ts:19


onCloseSaved

onCloseSaved(callback): void

Callback for close saved tabs in this group

Parameters

NameType
callback(groupId: UniqueId) => void

Returns

void

Defined in

src/services/workbench/explorer/editorTreeService.ts:26


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

Defined in

src/services/workbench/explorer/editorTreeService.ts:61


onLayout

onLayout(callback): void

Callback for adjust editor layout

Parameters

NameType
callback() => void

Returns

void

Defined in

src/services/workbench/explorer/editorTreeService.ts:56


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

Defined in

src/services/workbench/explorer/editorTreeService.ts:43


onSelect

onSelect(callback): void

Callback for select tab in this group

Parameters

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

Returns

void

Defined in

src/services/workbench/explorer/editorTreeService.ts:31


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

Defined in

src/services/workbench/explorer/editorTreeService.ts:49


onUpdateState

onUpdateState(callback): void

Listen to the Component state update event

Parameters

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

Returns

void

Inherited from

Component.onUpdateState

Defined in

src/react/component.ts:71


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

Returns

void

Inherited from

Component.render

Defined in

src/react/component.ts:67


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

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


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