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

Method initView

src/controller/explorer/explorer.tsx:59–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57 }
58
59 public initView() {
60 const explorerEvent = {
61 onClick: this.onClick,
62 onCollapseChange: this.onCollapseChange,
63 onActionsContextMenuClick: this.onActionsContextMenuClick,
64 onToolbarClick: this.onToolbarClick,
65 };
66
67 const ExplorerView = connect(this.explorerService, Explorer);
68
69 const id = this.builtinService.getConstants().EXPLORER_ACTIVITY_ITEM;
70
71 if (!id) return;
72
73 const explorePane = {
74 id,
75 title: 'EXPLORER',
76 render() {
77 return <ExplorerView {...explorerEvent} />;
78 },
79 };
80 const {
81 builtInExplorerActivityItem,
82 builtInExplorerFolderPanel,
83 builtInExplorerHeaderToolbar,
84 } = this.builtinService.getModules();
85
86 if (builtInExplorerHeaderToolbar) {
87 this.explorerService.setState({
88 headerToolBar: builtInExplorerHeaderToolbar,
89 });
90 }
91
92 if (builtInExplorerActivityItem && builtInExplorerFolderPanel) {
93 this.activityBarService.add(builtInExplorerActivityItem, true);
94 this.sidebarService.add(explorePane, true);
95
96 // add folder panel
97 this.explorerService.addPanel({
98 ...builtInExplorerFolderPanel,
99 renderPanel: this.renderFolderTree,
100 });
101 }
102 }
103
104 public readonly onClick = (
105 event: React.MouseEvent,

Callers

nothing calls this directly

Calls 6

connectFunction · 0.90
setStateMethod · 0.80
getConstantsMethod · 0.65
getModulesMethod · 0.65
addMethod · 0.65
addPanelMethod · 0.65

Tested by

no test coverage detected