Class: EditorTreeService
molecule.EditorTreeService
Hierarchy
Implements
Constructors
constructor
• new EditorTreeService()
Overrides
Defined in
src/services/workbench/explorer/editorTreeService.ts:77
Properties
editorService
• Private
Readonly
editorService: EditorService
Defined in
src/services/workbench/explorer/editorTreeService.ts:75
state
• Protected
state: IEditor
Implementation of
Overrides
Defined in
src/services/workbench/explorer/editorTreeService.ts:74
Methods
count
▸ count(name
): number
Count the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
Returns
number
Implementation of
Inherited from
Defined in
src/common/event/eventBus.ts:28
emit
▸ emit(name
, ...args
): void
Emit the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
...args | any | Arguments |
Returns
void
Implementation of
Inherited from
Defined in
src/common/event/eventBus.ts:20
forceUpdate
▸ forceUpdate(): void
Force to update the Component
Returns
void
Implementation of
IEditorTreeService.forceUpdate
Inherited from
Defined in
getState
▸ getState(): IEditor
Get the Component state
Returns
Implementation of
Inherited from
Defined in
onClose
▸ onClose(callback
): void
Callabck for close a certain tab
Parameters
Name | Type |
---|---|
callback | (tabId : UniqueId , groupId : UniqueId ) => void |
Returns
void
Implementation of
Defined in
src/services/workbench/explorer/editorTreeService.ts:83
onCloseAll
▸ onCloseAll(callback
): void
Callback for close all tabs When specify groupId, it'll close that group
Parameters
Name | Type |
---|---|
callback | (groupId? : UniqueId ) => void |
Returns
void
Implementation of
Defined in
src/services/workbench/explorer/editorTreeService.ts:101
onCloseOthers
▸ onCloseOthers(callback
): void
Callback for close others tabs except this tabItem
Parameters
Name | Type |
---|---|
callback | (tabItem : IEditorTab <BuiltInEditorTabDataType >, groupId : UniqueId ) => void |
Returns
void
Implementation of
IEditorTreeService.onCloseOthers
Defined in
src/services/workbench/explorer/editorTreeService.ts:87
onCloseSaved
▸ onCloseSaved(callback
): void
Callback for close saved tabs in this group
Parameters
Name | Type |
---|---|
callback | (groupId : UniqueId ) => void |
Returns
void
Implementation of
IEditorTreeService.onCloseSaved
Defined in
src/services/workbench/explorer/editorTreeService.ts:93
onContextMenu
▸ onContextMenu(callback
): void
Callback for context menu click event which isn't in buit-in menus
Parameters
Name | Type |
---|---|
callback | (menu : IMenuItemProps , file : ITabProps <any , any >, groupId : UniqueId ) => void |
Returns
void
Implementation of
IEditorTreeService.onContextMenu
Defined in
src/services/workbench/explorer/editorTreeService.ts:119
onLayout
▸ onLayout(callback
): void
Callback for adjust editor layout
Parameters
Name | Type |
---|---|
callback | () => void |
Returns
void
Implementation of
Defined in
src/services/workbench/explorer/editorTreeService.ts:115
onSaveAll
▸ onSaveAll(callback
): void
Callback for save all tabs When specify groupId, it'll save that group
Parameters
Name | Type |
---|---|
callback | (groupId? : UniqueId ) => void |
Returns
void
Implementation of
Defined in
src/services/workbench/explorer/editorTreeService.ts:105
onSelect
▸ onSelect(callback
): void
Callback for select tab in this group
Parameters
Name | Type |
---|---|
callback | (tabId : UniqueId , groupId : UniqueId ) => void |
Returns
void
Implementation of
Defined in
src/services/workbench/explorer/editorTreeService.ts:97
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
Name | Type |
---|---|
callback | (toolbar : IActionBarItemProps <any >, groupId? : UniqueId ) => void |
Returns
void
Implementation of
IEditorTreeService.onToolbarClick
Defined in
src/services/workbench/explorer/editorTreeService.ts:109
onUpdateState
▸ onUpdateState(callback
): void
Listen to the Component state update event
Parameters
Name | Type |
---|---|
callback | (prevState : IEditor , nextState : IEditor ) => void |
Returns
void
Implementation of
IEditorTreeService.onUpdateState
Inherited from
Defined in
removeOnUpdateState
▸ removeOnUpdateState(): void
Remove the Component update event listening
Returns
void
Implementation of
IEditorTreeService.removeOnUpdateState
Inherited from
Defined in
render
▸ render(nextState?
): void
Initiative notify the component to render the view by the state
Parameters
Name | Type |
---|---|
nextState? | IEditor |
Returns
void
Implementation of
Inherited from
Defined in
setState
▸ setState(values
, callback?
): void
Set the state values, and notify the view component to re render
Parameters
Name | Type | Description |
---|---|---|
values | Partial <IEditor > | update target state values |
callback? | (prevState : IEditor , nextState : IEditor ) => void | - |
Returns
void
Implementation of
Inherited from
Defined in
subscribe
▸ subscribe(name
, callback
): void
Subscribe the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | string [] | Event name |
callback | Function | Callback function |
Returns
void
Implementation of
Inherited from
Defined in
src/common/event/eventBus.ts:11
unsubscribe
▸ unsubscribe(name
): void
Unsubscribe the specific event
Parameters
Name | Type | Description |
---|---|---|
name | any | The event name |
Returns
void
Implementation of
IEditorTreeService.unsubscribe