MCPcopy Create free account
hub / github.com/DTStack/molecule / initView

Method initView

src/controller/editor.tsx:71–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69 }
70
71 public initView() {
72 const {
73 builtInEditorInitialActions,
74 builtInEditorInitialMenu,
75 BuiltInEditorOptions,
76 } = this.builtinService.getModules();
77
78 const defaultActions = this.editorService.getDefaultActions();
79 if (!defaultActions.length) {
80 const builtinActions = builtInEditorInitialActions || [];
81 this.editorService.setDefaultActions(builtinActions);
82 }
83
84 const defaultMenus = this.editorService.getDefaultMenus();
85 if (!defaultMenus.length) {
86 const builtinMenus = builtInEditorInitialMenu || [];
87 this.editorService.setDefaultMenus(builtinMenus);
88 }
89
90 this.editorService.setState({
91 editorOptions: BuiltInEditorOptions || {},
92 });
93 }
94
95 public open<T>(tab: IEditorTab<any>, groupId?: UniqueId) {
96 this.editorService.open<T>(tab, groupId);

Callers

nothing calls this directly

Calls 6

setStateMethod · 0.80
getModulesMethod · 0.65
getDefaultActionsMethod · 0.65
setDefaultActionsMethod · 0.65
getDefaultMenusMethod · 0.65
setDefaultMenusMethod · 0.65

Tested by

no test coverage detected