1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
18 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
19 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
21 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
22 | };
|
23 | var __metadata = (this && this.__metadata) || function (k, v) {
|
24 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
25 | };
|
26 | Object.defineProperty(exports, "__esModule", { value: true });
|
27 | exports.WindowContribution = exports.WindowCommands = void 0;
|
28 | const inversify_1 = require("inversify");
|
29 | const common_1 = require("../common");
|
30 | const window_service_1 = require("./window/window-service");
|
31 | const common_frontend_contribution_1 = require("../browser/common-frontend-contribution");
|
32 | var WindowCommands;
|
33 | (function (WindowCommands) {
|
34 | WindowCommands.NEW_WINDOW = common_1.Command.toDefaultLocalizedCommand({
|
35 | id: 'workbench.action.newWindow',
|
36 | label: 'New Window'
|
37 | });
|
38 | })(WindowCommands = exports.WindowCommands || (exports.WindowCommands = {}));
|
39 | let WindowContribution = class WindowContribution {
|
40 | registerCommands(commands) {
|
41 | commands.registerCommand(WindowCommands.NEW_WINDOW, {
|
42 | execute: () => {
|
43 | this.windowService.openNewDefaultWindow();
|
44 | }
|
45 | });
|
46 | }
|
47 | registerKeybindings(registry) {
|
48 | registry.registerKeybindings({
|
49 | command: WindowCommands.NEW_WINDOW.id,
|
50 | keybinding: this.isElectron() ? 'ctrlcmd+shift+n' : 'alt+shift+n'
|
51 | });
|
52 | }
|
53 | registerMenus(registry) {
|
54 | registry.registerMenuAction(common_frontend_contribution_1.CommonMenus.FILE_NEW_TEXT, {
|
55 | commandId: WindowCommands.NEW_WINDOW.id,
|
56 | order: 'c'
|
57 | });
|
58 | }
|
59 | isElectron() {
|
60 | return common_1.environment.electron.is();
|
61 | }
|
62 | };
|
63 | __decorate([
|
64 | (0, inversify_1.inject)(window_service_1.WindowService),
|
65 | __metadata("design:type", Object)
|
66 | ], WindowContribution.prototype, "windowService", void 0);
|
67 | WindowContribution = __decorate([
|
68 | (0, inversify_1.injectable)()
|
69 | ], WindowContribution);
|
70 | exports.WindowContribution = WindowContribution;
|
71 |
|
\ | No newline at end of file |