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

Class MenuBarController

src/controller/menuBar.ts:39–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38@singleton()
39export class MenuBarController
40 extends Controller
41 implements IMenuBarController
42{
43 private readonly menuBarService: IMenuBarService;
44 private readonly layoutService: ILayoutService;
45 private readonly monacoService: IMonacoService;
46 private readonly builtinService: IBuiltinService;
47 private readonly activityBarService: IActivityBarService;
48
49 private _focusinEle: HTMLElement | null = null;
50 private _automation = {};
51
52 constructor() {
53 super();
54 this.menuBarService = container.resolve(MenuBarService);
55 this.layoutService = container.resolve(LayoutService);
56 this.monacoService = container.resolve(MonacoService);
57 this.builtinService = container.resolve(BuiltinService);
58 this.activityBarService = container.resolve(ActivityBarService);
59 }
60
61 public initView() {
62 const { builtInMenuBarData } = this.builtinService.getModules();
63 const {
64 ACTION_QUICK_CREATE_FILE,
65 ACTION_QUICK_UNDO,
66 ACTION_QUICK_REDO,
67 ACTION_QUICK_SELECT_ALL,
68 ACTION_QUICK_COPY_LINE_UP,
69 MENU_VIEW_ACTIVITYBAR,
70 MENU_VIEW_AUXILIARY,
71 MENU_VIEW_MENUBAR,
72 MENU_VIEW_STATUSBAR,
73 MENU_QUICK_COMMAND,
74 MENU_VIEW_PANEL,
75 MENUBAR_MODE_HORIZONTAL,
76 MENUBAR_MODE_VERTICAL,
77 } = this.builtinService.getConstants();
78 if (builtInMenuBarData) {
79 const mode = this.layoutService.getMenuBarMode();
80 const menuBarData = this.getMenuBarDataByMode(
81 mode,
82 builtInMenuBarData
83 );
84 this.menuBarService.setMenus(menuBarData);
85 }
86 (
87 [
88 [ACTION_QUICK_CREATE_FILE, () => this.createFile()],
89 [ACTION_QUICK_UNDO, () => this.undo()],
90 [ACTION_QUICK_REDO, () => this.redo()],
91 [ACTION_QUICK_SELECT_ALL, () => this.selectAll()],
92 [ACTION_QUICK_COPY_LINE_UP, () => this.copyLineUp()],
93 [MENU_VIEW_ACTIVITYBAR, () => this.updateActivityBar()],
94 [MENU_VIEW_MENUBAR, () => this.updateMenuBar()],
95 [MENU_VIEW_STATUSBAR, () => this.updateStatusBar()],
96 [MENU_QUICK_COMMAND, () => this.gotoQuickCommand()],

Callers

nothing calls this directly

Calls 13

emitMethod · 0.80
getConstantsMethod · 0.65
executeCommandMethod · 0.65
updateMethod · 0.65
setMenuBarModeMethod · 0.65
getModulesMethod · 0.65
removeMethod · 0.65
appendMethod · 0.65

Tested by

no test coverage detected