Interface: IEditorService
molecule.IEditorService
Hierarchy
Implemented by
Properties
editorInstance
• Readonly
editorInstance: IStandaloneCodeEditor
The instance of MonacoEditor
Defined in
src/services/workbench/editorService.ts:195
state
• Protected
Abstract
state: IEditor
Inherited from
Defined in
Methods
cloneGroup
▸ cloneGroup(groupId?
): IEditorGroup
<any
, any
>
Clone a specific group, if the argument groupId
is undefined,
there default clone the current group
Parameters
Name | Type |
---|---|
groupId? | UniqueId |
Returns
IEditorGroup
<any
, any
>
Defined in
src/services/workbench/editorService.ts:91
closeAll
▸ closeAll(groupId
): void
Close the specific group all opened tabs
Parameters
Name | Type | Description |
---|---|---|
groupId | UniqueId | The groupId is required |
Returns
void
Defined in
src/services/workbench/editorService.ts:80
closeOther
▸ closeOther(tab
, groupId
): void
Close other opened tabs in Editor Group
Parameters
Name | Type | Description |
---|---|---|
tab | IEditorTab <BuiltInEditorTabDataType > | The id is required |
groupId | UniqueId | The groupId is required |
Returns
void
Defined in
src/services/workbench/editorService.ts:63
closeTab
▸ closeTab(tabId
, groupId
): void
Close the specific Tab opened in Editor Group view
Parameters
Name | Type | Description |
---|---|---|
tabId | UniqueId | The tabId is required |
groupId | UniqueId | The groupId is required |
Returns
void
Defined in
src/services/workbench/editorService.ts:57
closeToLeft
▸ closeToLeft(tab
, groupId
): void
Close the left opened Tabs in Editor Group
Parameters
Name | Type | Description |
---|---|---|
tab | IEditorTab <BuiltInEditorTabDataType > | The id is required, the start point of close to left |
groupId | UniqueId | The groupId is required |
Returns
void
Defined in
src/services/workbench/editorService.ts:75
closeToRight
▸ closeToRight(tab
, groupId
): void
Close the right opened tabs in Editor Group
Parameters
Name | Type | Description |
---|---|---|
tab | IEditorTab <BuiltInEditorTabDataType > | The id is required, the start point of close to right |
groupId | UniqueId | The groupId is required |
Returns
void
Defined in
src/services/workbench/editorService.ts:69
count
▸ count(name
): number
Count the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
Returns
number
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
Inherited from
Defined in
src/common/event/eventBus.ts:20
forceUpdate
▸ forceUpdate(): void
Force to update the Component
Returns
void
Inherited from
Defined in
getDefaultActions
▸ getDefaultActions(): IEditorActionsProps
[]
Get the default group actions
Returns
Defined in
src/services/workbench/editorService.ts:182
getDefaultMenus
▸ getDefaultMenus(): IMenuItemProps
[]
Get the default group menus
Returns
Defined in
src/services/workbench/editorService.ts:186
getGroupById
▸ getGroupById(groupId
): undefined
| IEditorGroup
<any
, any
>
Get the specific group
Parameters
Name | Type | Description |
---|---|---|
groupId | UniqueId | The groupId is required |
Returns
undefined
| IEditorGroup
<any
, any
>
Defined in
src/services/workbench/editorService.ts:85
getGroupIdByTab
▸ getGroupIdByTab(tabId
): null
| UniqueId
Get the group's id which contains the tab
Parameters
Name | Type |
---|---|
tabId | UniqueId |
Returns
null
| UniqueId
Defined in
src/services/workbench/editorService.ts:200
getState
▸ getState(): IEditor
Get the Component state
Returns
Inherited from
Defined in
getTabById
▸ getTabById<T
>(tabId
, groupId
): undefined
| IEditorTab
<T
>
Get a tab from a specific group via the tab ID
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
tabId | UniqueId |
groupId | UniqueId |
Returns
undefined
| IEditorTab
<T
>
Defined in
src/services/workbench/editorService.ts:33
isOpened
▸ isOpened(tabId
): boolean
Judge the specific tabs whether opened in Editor view
Parameters
Name | Type | Description |
---|---|---|
tabId | UniqueId | The tabId is required |
Returns
boolean
Defined in
src/services/workbench/editorService.ts:51
onActionsClick
▸ onActionsClick(callback
): void
Listen to the Group Actions click event
Parameters
Name | Type |
---|---|
callback | (menuId : UniqueId , currentGroup : IEditorGroup <any , any >) => void |
Returns
void
Defined in
src/services/workbench/editorService.ts:143
onCloseAll
▸ onCloseAll(callback
): any
Listen to the all tabs close event
Parameters
Name | Type |
---|---|
callback | (groupId? : UniqueId ) => void |
Returns
any
Defined in
src/services/workbench/editorService.ts:118
onCloseOther
▸ onCloseOther(callback
): any
Listen to the other tabs close event
Parameters
Name | Type |
---|---|
callback | (tabItem : IEditorTab <BuiltInEditorTabDataType >, groupId? : UniqueId ) => void |
Returns
any
Defined in
src/services/workbench/editorService.ts:128
onCloseTab
▸ onCloseTab(callback
): any
Listen to the tab close event
Parameters
Name | Type |
---|---|
callback | (tabId : UniqueId , groupId? : UniqueId ) => void |
Returns
any
Defined in
src/services/workbench/editorService.ts:123
onCloseToLeft
▸ onCloseToLeft(callback
): any
Listen to the left tabs close event
Parameters
Name | Type |
---|---|
callback | (tabItem : IEditorTab <BuiltInEditorTabDataType >, groupId? : UniqueId ) => void |
Returns
any
Defined in
src/services/workbench/editorService.ts:133
onCloseToRight
▸ onCloseToRight(callback
): any
Listen to the right tabs close event
Parameters
Name | Type |
---|---|
callback | (tabItem : IEditorTab <BuiltInEditorTabDataType >, groupId? : UniqueId ) => void |
Returns
any
Defined in
src/services/workbench/editorService.ts:138
onMoveTab
▸ onMoveTab(callback
): any
Listen to the tab move event
Parameters
Name | Type |
---|---|
callback | (updateTabs : IEditorTab <any >[], groupId? : UniqueId ) => void |
Returns
any
Defined in
src/services/workbench/editorService.ts:106
onOpenTab
▸ onOpenTab(callback
): void
Listen to the tab opening event
Parameters
Name | Type |
---|---|
callback | (tab : IEditorTab <BuiltInEditorTabDataType >) => void |
Returns
void
Defined in
src/services/workbench/editorService.ts:101
onSelectTab
▸ onSelectTab(callback
): any
Listen to the tab select event
Parameters
Name | Type |
---|---|
callback | (tabId : UniqueId , groupId? : UniqueId ) => void |
Returns
any
Defined in
src/services/workbench/editorService.ts:113
onUpdateState
▸ onUpdateState(callback
): void
Listen to the Component state update event
Parameters
Name | Type |
---|---|
callback | (prevState : IEditor , nextState : IEditor ) => void |
Returns
void
Inherited from
Defined in
onUpdateTab
▸ onUpdateTab(callback
): void
Listen to the Editor tab changed event
Parameters
Name | Type |
---|---|
callback | (tab : IEditorTab <BuiltInEditorTabDataType >) => void |
Returns
void
Defined in
src/services/workbench/editorService.ts:96
open
▸ open<T
>(tab
, groupId?
): void
Open a new tab in a specific group
Type parameters
Name | Type |
---|---|
T | any |
Parameters
Name | Type | Description |
---|---|---|
tab | IEditorTab <T > | Tab data |
groupId? | UniqueId | Group ID |
Returns
void
Defined in
src/services/workbench/editorService.ts:27
removeOnUpdateState
▸ removeOnUpdateState(): void
Remove the Component update event listening
Returns
void
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
Inherited from
Defined in
setActive
▸ setActive(groupId
, tabId
): any
Set active group and tab
Parameters
Name | Type | Description |
---|---|---|
groupId | UniqueId | Target group ID |
tabId | UniqueId | Target tab ID |
Returns
any
Defined in
src/services/workbench/editorService.ts:151
setDefaultActions
▸ setDefaultActions(actions
): void
Set default actions when create a new group
Parameters
Name | Type |
---|---|
actions | IEditorActionsProps [] |
Returns
void
Defined in
src/services/workbench/editorService.ts:162
setDefaultMenus
▸ setDefaultMenus(menus
): void
Set default menus when create a new group
Parameters
Name | Type |
---|---|
menus | IMenuItemProps [] |
Returns
void
Defined in
src/services/workbench/editorService.ts:167
setEntry
▸ setEntry(component
): void
Specify the Entry page of Workbench
Parameters
Name | Type |
---|---|
component | ReactNode |
Returns
void
Defined in
src/services/workbench/editorService.ts:46
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
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
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
Inherited from
Defined in
src/common/event/eventBus.ts:37
updateActions
▸ updateActions(actions
, groupId?
): void
Update actions in specific group
Parameters
Name | Type |
---|---|
actions | IMenuItemProps [] |
groupId? | UniqueId |
Returns
void
Defined in
src/services/workbench/editorService.ts:173
updateCurrentGroup
▸ updateCurrentGroup(currentValues
): void
Update the current group
Parameters
Name | Type |
---|---|
currentValues | any |
Returns
void
Defined in
src/services/workbench/editorService.ts:178
updateEditorOptions
▸ updateEditorOptions(options
): void
Update the editor options
Parameters
Name | Type |
---|---|
options | IEditorOptions |
Returns
void
Defined in
src/services/workbench/editorService.ts:191
updateGroup
▸ updateGroup(groupId
, groupValues
): void
Update the specific group
Parameters
Name | Type |
---|---|
groupId | UniqueId |
groupValues | Omit <IEditorGroup <any , any >, "id" > |
Returns
void
Defined in
src/services/workbench/editorService.ts:157
updateTab
▸ updateTab(tab
, groupId?
): IEditorTab
<BuiltInEditorTabDataType
>
Update the specific tab, if the groupId provide, then update the tab of specific group
Parameters
Name | Type | Description |
---|---|---|
tab | IEditorTab <BuiltInEditorTabDataType > | The id is required |
groupId? | UniqueId |
Returns
IEditorTab
<BuiltInEditorTabDataType
>