@theia/core 1.20.0 → 1.21.0-next.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/browser/common-frontend-contribution.d.ts +1 -13
- package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/common-frontend-contribution.js +86 -127
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/frontend-application-module.d.ts.map +1 -1
- package/lib/browser/frontend-application-module.js +6 -5
- package/lib/browser/frontend-application-module.js.map +1 -1
- package/lib/browser/preferences/preference-provider.d.ts +0 -2
- package/lib/browser/preferences/preference-provider.d.ts.map +1 -1
- package/lib/browser/preferences/preference-provider.js +1 -5
- package/lib/browser/preferences/preference-provider.js.map +1 -1
- package/lib/browser/preferences/preference-service.spec.js +0 -3
- package/lib/browser/preferences/preference-service.spec.js.map +1 -1
- package/lib/browser/shell/application-shell.d.ts +7 -7
- package/lib/browser/shell/application-shell.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.js +10 -17
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/browser/shell/current-widget-command-adapter.d.ts +39 -0
- package/lib/browser/shell/current-widget-command-adapter.d.ts.map +1 -0
- package/lib/browser/shell/current-widget-command-adapter.js +42 -0
- package/lib/browser/shell/current-widget-command-adapter.js.map +1 -0
- package/lib/browser/shell/tab-bars.d.ts +8 -2
- package/lib/browser/shell/tab-bars.d.ts.map +1 -1
- package/lib/browser/shell/tab-bars.js +30 -3
- package/lib/browser/shell/tab-bars.js.map +1 -1
- package/lib/common/promise-util.d.ts +3 -0
- package/lib/common/promise-util.d.ts.map +1 -1
- package/lib/common/promise-util.js +16 -1
- package/lib/common/promise-util.js.map +1 -1
- package/lib/common/promise-util.spec.d.ts +2 -0
- package/lib/common/promise-util.spec.d.ts.map +1 -0
- package/lib/common/promise-util.spec.js +42 -0
- package/lib/common/promise-util.spec.js.map +1 -0
- package/lib/electron-main/electron-main-application.d.ts +10 -0
- package/lib/electron-main/electron-main-application.d.ts.map +1 -1
- package/lib/electron-main/electron-main-application.js +13 -3
- package/lib/electron-main/electron-main-application.js.map +1 -1
- package/package.json +3 -3
- package/src/browser/common-frontend-contribution.ts +75 -132
- package/src/browser/frontend-application-module.ts +6 -5
- package/src/browser/preferences/preference-provider.ts +1 -5
- package/src/browser/preferences/preference-service.spec.ts +0 -3
- package/src/browser/shell/application-shell.ts +17 -22
- package/src/browser/shell/current-widget-command-adapter.ts +57 -0
- package/src/browser/shell/tab-bars.ts +30 -5
- package/src/common/promise-util.spec.ts +41 -0
- package/src/common/promise-util.ts +20 -1
- package/src/electron-main/electron-main-application.ts +24 -5
package/README.md
CHANGED
|
@@ -78,9 +78,9 @@ export class SomeClass {
|
|
|
78
78
|
- [`@phosphor/signaling@1`](https://www.npmjs.com/package/@phosphor/signaling)
|
|
79
79
|
- [`@phosphor/virtualdom@1`](https://www.npmjs.com/package/@phosphor/virtualdom)
|
|
80
80
|
- [`@phosphor/widgets@1`](https://www.npmjs.com/package/@phosphor/widgets)
|
|
81
|
-
- [`@theia/application-package@1.
|
|
82
|
-
- [`@theia/application-package/lib/api@1.
|
|
83
|
-
- [`@theia/application-package/lib/environment@1.
|
|
81
|
+
- [`@theia/application-package@1.20.0`](https://www.npmjs.com/package/@theia/application-package)
|
|
82
|
+
- [`@theia/application-package/lib/api@1.20.0`](https://www.npmjs.com/package/@theia/application-package)
|
|
83
|
+
- [`@theia/application-package/lib/environment@1.20.0`](https://www.npmjs.com/package/@theia/application-package)
|
|
84
84
|
- [`dompurify@^2.2.9`](https://www.npmjs.com/package/dompurify)
|
|
85
85
|
- [`electron@^9.0.2`](https://www.npmjs.com/package/electron)
|
|
86
86
|
- [`express@^4.16.3`](https://www.npmjs.com/package/express)
|
|
@@ -86,6 +86,7 @@ export declare namespace CommonCommands {
|
|
|
86
86
|
const PREVIOUS_TAB_GROUP: Command;
|
|
87
87
|
const CLOSE_TAB: Command;
|
|
88
88
|
const CLOSE_OTHER_TABS: Command;
|
|
89
|
+
const CLOSE_SAVED_TABS: Command;
|
|
89
90
|
const CLOSE_RIGHT_TABS: Command;
|
|
90
91
|
const CLOSE_ALL_TABS: Command;
|
|
91
92
|
const CLOSE_MAIN_TAB: Command;
|
|
@@ -142,19 +143,6 @@ export declare class CommonFrontendContribution implements FrontendApplicationCo
|
|
|
142
143
|
protected initResourceContextKeys(): void;
|
|
143
144
|
registerMenus(registry: MenuModelRegistry): void;
|
|
144
145
|
registerCommands(commandRegistry: CommandRegistry): void;
|
|
145
|
-
private findTabArea;
|
|
146
|
-
/**
|
|
147
|
-
* Finds the index of the selected title from the tab-bar.
|
|
148
|
-
* @param tabBar: used for providing an array of titles.
|
|
149
|
-
* @returns the index of the selected title if it is available in the tab-bar, else returns the index of currently-selected title.
|
|
150
|
-
*/
|
|
151
|
-
private findTitleIndex;
|
|
152
|
-
private canToggleMaximized;
|
|
153
|
-
/**
|
|
154
|
-
* Maximize the bottom or the main dockpanel based on the widget.
|
|
155
|
-
* @param event used to find the selected widget.
|
|
156
|
-
*/
|
|
157
|
-
private toggleMaximized;
|
|
158
146
|
private isElectron;
|
|
159
147
|
registerKeybindings(registry: KeybindingRegistry): void;
|
|
160
148
|
protected openAbout(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-frontend-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/common-frontend-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;
|
|
1
|
+
{"version":3,"file":"common-frontend-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/common-frontend-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAMlF,OAAO,EAAgC,gBAAgB,EAAE,iBAAiB,EAAiB,MAAM,gBAAgB,CAAC;AAClH,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,+BA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AAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IA+CxD,SAAS,CAAC,YAAY,IAAI,IAAI;IAO9B,SAAS,CAAC,qBAAqB,CAAC,cAAc,EAAE,sBAAsB,GAAG,qBAAqB,GAAG,IAAI;IAYrG,SAAS,CAAC,yBAAyB,CAAC,cAAc,EAAE,sBAAsB,GAAG,qBAAqB,GAAG,IAAI;IAczG,SAAS,CAAC,sBAAsB,CAAC,CAAC,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,EAAE,GAAG,EAAE,mBAAmB,GAAG,IAAI;IA8B7G,OAAO,IAAI,IAAI;IAKf,MAAM,IAAI,IAAI;IAKd,SAAS,CAAC,uBAAuB,IAAI,IAAI;IAUzC,aAAa,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAqIhD,gBAAgB,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI;IA+MxD,OAAO,CAAC,UAAU;IAIlB,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;cAiHvC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C,SAAS,CAAC,kBAAkB,UAAS;IAErC;;;;;;OAMG;IACH,SAAS,CAAC,qBAAqB,IAAI,IAAI;IAcvC,UAAU,IAAI,IAAI,GAAG,SAAS;cAUd,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAqBzD,SAAS,CAAC,eAAe,IAAI,IAAI;IAsCjC,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAyClC,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;CA22B9C"}
|
|
@@ -31,7 +31,6 @@ exports.CommonFrontendContribution = exports.RECENT_COMMANDS_STORAGE_KEY = expor
|
|
|
31
31
|
/* eslint-disable max-len, @typescript-eslint/indent */
|
|
32
32
|
const debounce = require("lodash.debounce");
|
|
33
33
|
const inversify_1 = require("inversify");
|
|
34
|
-
const widgets_1 = require("@phosphor/widgets");
|
|
35
34
|
const menu_1 = require("../common/menu");
|
|
36
35
|
const command_1 = require("../common/command");
|
|
37
36
|
const uri_command_handler_1 = require("../common/uri-command-handler");
|
|
@@ -61,9 +60,11 @@ const encoding_registry_1 = require("./encoding-registry");
|
|
|
61
60
|
const encodings_1 = require("../common/encodings");
|
|
62
61
|
const env_variables_1 = require("../common/env-variables");
|
|
63
62
|
const authentication_service_1 = require("./authentication-service");
|
|
63
|
+
const saveable_1 = require("./saveable");
|
|
64
64
|
const quick_input_1 = require("./quick-input");
|
|
65
65
|
const localization_1 = require("../common/i18n/localization");
|
|
66
66
|
const nls_1 = require("../common/nls");
|
|
67
|
+
const current_widget_command_adapter_1 = require("./shell/current-widget-command-adapter");
|
|
67
68
|
var CommonMenus;
|
|
68
69
|
(function (CommonMenus) {
|
|
69
70
|
CommonMenus.FILE = [...menu_1.MAIN_MENU_BAR, '1_file'];
|
|
@@ -177,6 +178,11 @@ var CommonCommands;
|
|
|
177
178
|
category: CommonCommands.VIEW_CATEGORY,
|
|
178
179
|
label: 'Close Other Tabs'
|
|
179
180
|
}, 'theia/core/common/closeOthers', CommonCommands.VIEW_CATEGORY_KEY);
|
|
181
|
+
CommonCommands.CLOSE_SAVED_TABS = command_1.Command.toDefaultLocalizedCommand({
|
|
182
|
+
id: 'workbench.action.closeUnmodifiedEditors',
|
|
183
|
+
category: CommonCommands.VIEW_CATEGORY,
|
|
184
|
+
label: 'Close Saved Editors in Group',
|
|
185
|
+
});
|
|
180
186
|
CommonCommands.CLOSE_RIGHT_TABS = command_1.Command.toLocalizedCommand({
|
|
181
187
|
id: 'core.close.right.tabs',
|
|
182
188
|
category: CommonCommands.VIEW_CATEGORY,
|
|
@@ -473,35 +479,45 @@ let CommonFrontendContribution = class CommonFrontendContribution {
|
|
|
473
479
|
commandId: CommonCommands.COLLAPSE_ALL_PANELS.id,
|
|
474
480
|
order: '2'
|
|
475
481
|
});
|
|
476
|
-
registry.registerMenuAction(tab_bars_1.
|
|
482
|
+
registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
|
|
477
483
|
commandId: CommonCommands.CLOSE_TAB.id,
|
|
478
484
|
label: nls_1.nls.localizeByDefault('Close'),
|
|
479
485
|
order: '0'
|
|
480
486
|
});
|
|
481
|
-
registry.registerMenuAction(tab_bars_1.
|
|
487
|
+
registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
|
|
482
488
|
commandId: CommonCommands.CLOSE_OTHER_TABS.id,
|
|
483
489
|
label: nls_1.nls.localizeByDefault('Close Others'),
|
|
484
490
|
order: '1'
|
|
485
491
|
});
|
|
486
|
-
registry.registerMenuAction(tab_bars_1.
|
|
492
|
+
registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
|
|
487
493
|
commandId: CommonCommands.CLOSE_RIGHT_TABS.id,
|
|
488
494
|
label: nls_1.nls.localizeByDefault('Close to the Right'),
|
|
489
495
|
order: '2'
|
|
490
496
|
});
|
|
491
|
-
registry.registerMenuAction(tab_bars_1.
|
|
497
|
+
registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
|
|
498
|
+
commandId: CommonCommands.CLOSE_SAVED_TABS.id,
|
|
499
|
+
label: nls_1.nls.localizeByDefault('Close Saved'),
|
|
500
|
+
order: '3',
|
|
501
|
+
});
|
|
502
|
+
registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_CLOSE, {
|
|
492
503
|
commandId: CommonCommands.CLOSE_ALL_TABS.id,
|
|
493
504
|
label: nls_1.nls.localizeByDefault('Close All'),
|
|
494
|
-
order: '
|
|
505
|
+
order: '4'
|
|
495
506
|
});
|
|
496
|
-
registry.registerMenuAction(tab_bars_1.
|
|
507
|
+
registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_SPLIT, {
|
|
497
508
|
commandId: CommonCommands.COLLAPSE_PANEL.id,
|
|
498
509
|
label: CommonCommands.COLLAPSE_PANEL.label,
|
|
499
|
-
order: '
|
|
510
|
+
order: '5'
|
|
500
511
|
});
|
|
501
|
-
registry.registerMenuAction(tab_bars_1.
|
|
512
|
+
registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_SPLIT, {
|
|
502
513
|
commandId: CommonCommands.TOGGLE_MAXIMIZED.id,
|
|
503
514
|
label: CommonCommands.TOGGLE_MAXIMIZED.label,
|
|
504
|
-
order: '
|
|
515
|
+
order: '6'
|
|
516
|
+
});
|
|
517
|
+
registry.registerMenuAction(tab_bars_1.SHELL_TABBAR_CONTEXT_COPY, {
|
|
518
|
+
commandId: CommonCommands.COPY_PATH.id,
|
|
519
|
+
label: CommonCommands.COPY_PATH.label,
|
|
520
|
+
order: '1',
|
|
505
521
|
});
|
|
506
522
|
registry.registerMenuAction(CommonMenus.HELP, {
|
|
507
523
|
commandId: CommonCommands.ABOUT_COMMAND.id,
|
|
@@ -559,6 +575,8 @@ let CommonFrontendContribution = class CommonFrontendContribution {
|
|
|
559
575
|
}
|
|
560
576
|
});
|
|
561
577
|
commandRegistry.registerCommand(CommonCommands.COPY_PATH, uri_command_handler_1.UriAwareCommandHandler.MultiSelect(this.selectionService, {
|
|
578
|
+
isVisible: uris => Array.isArray(uris) && uris.some(uri => uri instanceof uri_1.default),
|
|
579
|
+
isEnabled: uris => Array.isArray(uris) && uris.some(uri => uri instanceof uri_1.default),
|
|
562
580
|
execute: async (uris) => {
|
|
563
581
|
if (uris.length) {
|
|
564
582
|
const lineDelimiter = os_1.isWindows ? '\r\n' : '\n';
|
|
@@ -609,62 +627,58 @@ let CommonFrontendContribution = class CommonFrontendContribution {
|
|
|
609
627
|
isEnabled: () => this.shell.previousTabBar() !== undefined,
|
|
610
628
|
execute: () => this.shell.activatePreviousTabBar()
|
|
611
629
|
});
|
|
612
|
-
commandRegistry.registerCommand(CommonCommands.CLOSE_TAB, {
|
|
613
|
-
isEnabled:
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
const tabBar = this.shell.findTabBar(event);
|
|
638
|
-
const currentTitle = this.shell.findTitle(tabBar, event);
|
|
639
|
-
this.shell.closeTabs(tabBar, title => title !== currentTitle && title.closable);
|
|
640
|
-
}
|
|
641
|
-
});
|
|
642
|
-
commandRegistry.registerCommand(CommonCommands.CLOSE_RIGHT_TABS, {
|
|
643
|
-
isEnabled: (event) => {
|
|
644
|
-
const tabBar = this.shell.findTabBar(event);
|
|
645
|
-
if (!tabBar) {
|
|
646
|
-
return false;
|
|
647
|
-
}
|
|
648
|
-
const currentIndex = this.findTitleIndex(tabBar, event);
|
|
649
|
-
return tabBar.titles.some((title, index) => index > currentIndex && title.closable);
|
|
630
|
+
commandRegistry.registerCommand(CommonCommands.CLOSE_TAB, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
|
|
631
|
+
isEnabled: title => Boolean(title === null || title === void 0 ? void 0 : title.closable),
|
|
632
|
+
execute: (title, tabBar) => tabBar && this.shell.closeTabs(tabBar, candidate => candidate === title),
|
|
633
|
+
}));
|
|
634
|
+
commandRegistry.registerCommand(CommonCommands.CLOSE_OTHER_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
|
|
635
|
+
isEnabled: (title, tabbar) => Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(candidate => candidate !== title && candidate.closable)),
|
|
636
|
+
execute: (title, tabbar) => tabbar && this.shell.closeTabs(tabbar, candidate => candidate !== title && candidate.closable),
|
|
637
|
+
}));
|
|
638
|
+
commandRegistry.registerCommand(CommonCommands.CLOSE_SAVED_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
|
|
639
|
+
isEnabled: (_title, tabbar) => Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(candidate => candidate.closable && !saveable_1.Saveable.isDirty(candidate.owner))),
|
|
640
|
+
execute: (_title, tabbar) => tabbar && this.shell.closeTabs(tabbar, candidate => candidate.closable && !saveable_1.Saveable.isDirty(candidate.owner)),
|
|
641
|
+
}));
|
|
642
|
+
commandRegistry.registerCommand(CommonCommands.CLOSE_RIGHT_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
|
|
643
|
+
isEnabled: (title, tabbar) => {
|
|
644
|
+
let targetSeen = false;
|
|
645
|
+
return Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(candidate => {
|
|
646
|
+
if (targetSeen && candidate.closable) {
|
|
647
|
+
return true;
|
|
648
|
+
}
|
|
649
|
+
;
|
|
650
|
+
if (candidate === title) {
|
|
651
|
+
targetSeen = true;
|
|
652
|
+
}
|
|
653
|
+
;
|
|
654
|
+
}));
|
|
650
655
|
},
|
|
651
|
-
isVisible: (
|
|
652
|
-
|
|
656
|
+
isVisible: (_title, tabbar) => {
|
|
657
|
+
var _a;
|
|
658
|
+
const area = (_a = (tabbar && this.shell.getAreaFor(tabbar))) !== null && _a !== void 0 ? _a : this.shell.currentTabArea;
|
|
653
659
|
return area !== undefined && area !== 'left' && area !== 'right';
|
|
654
660
|
},
|
|
655
|
-
execute: (
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
661
|
+
execute: (title, tabbar) => {
|
|
662
|
+
if (tabbar) {
|
|
663
|
+
let targetSeen = false;
|
|
664
|
+
this.shell.closeTabs(tabbar, candidate => {
|
|
665
|
+
if (targetSeen && candidate.closable) {
|
|
666
|
+
return true;
|
|
667
|
+
}
|
|
668
|
+
;
|
|
669
|
+
if (candidate === title) {
|
|
670
|
+
targetSeen = true;
|
|
671
|
+
}
|
|
672
|
+
;
|
|
673
|
+
return false;
|
|
674
|
+
});
|
|
675
|
+
}
|
|
659
676
|
}
|
|
660
|
-
});
|
|
661
|
-
commandRegistry.registerCommand(CommonCommands.CLOSE_ALL_TABS, {
|
|
662
|
-
isEnabled: (
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
},
|
|
666
|
-
execute: (event) => this.shell.closeTabs(this.shell.findTabBar(event), title => title.closable)
|
|
667
|
-
});
|
|
677
|
+
}));
|
|
678
|
+
commandRegistry.registerCommand(CommonCommands.CLOSE_ALL_TABS, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
|
|
679
|
+
isEnabled: (_title, tabbar) => Boolean(tabbar === null || tabbar === void 0 ? void 0 : tabbar.titles.some(title => title.closable)),
|
|
680
|
+
execute: (_title, tabbar) => tabbar && this.shell.closeTabs(tabbar, candidate => candidate.closable),
|
|
681
|
+
}));
|
|
668
682
|
commandRegistry.registerCommand(CommonCommands.CLOSE_MAIN_TAB, {
|
|
669
683
|
isEnabled: () => {
|
|
670
684
|
const currentWidget = this.shell.getCurrentWidget('main');
|
|
@@ -687,11 +701,11 @@ let CommonFrontendContribution = class CommonFrontendContribution {
|
|
|
687
701
|
isEnabled: () => this.shell.mainAreaTabBars.some(tb => tb.titles.some(title => title.closable)),
|
|
688
702
|
execute: () => this.shell.closeTabs('main', title => title.closable)
|
|
689
703
|
});
|
|
690
|
-
commandRegistry.registerCommand(CommonCommands.COLLAPSE_PANEL, {
|
|
691
|
-
isEnabled: (
|
|
692
|
-
isVisible: (
|
|
693
|
-
execute: (
|
|
694
|
-
});
|
|
704
|
+
commandRegistry.registerCommand(CommonCommands.COLLAPSE_PANEL, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
|
|
705
|
+
isEnabled: (_title, tabbar) => Boolean(tabbar && application_shell_1.ApplicationShell.isSideArea(this.shell.getAreaFor(tabbar))),
|
|
706
|
+
isVisible: (_title, tabbar) => Boolean(tabbar && application_shell_1.ApplicationShell.isSideArea(this.shell.getAreaFor(tabbar))),
|
|
707
|
+
execute: (_title, tabbar) => tabbar && this.shell.collapsePanel(this.shell.getAreaFor(tabbar))
|
|
708
|
+
}));
|
|
695
709
|
commandRegistry.registerCommand(CommonCommands.COLLAPSE_ALL_PANELS, {
|
|
696
710
|
execute: () => {
|
|
697
711
|
this.shell.collapsePanel('left');
|
|
@@ -713,11 +727,11 @@ let CommonFrontendContribution = class CommonFrontendContribution {
|
|
|
713
727
|
commandRegistry.registerCommand(CommonCommands.TOGGLE_STATUS_BAR, {
|
|
714
728
|
execute: () => this.preferenceService.updateValue('workbench.statusBar.visible', !this.preferences['workbench.statusBar.visible'])
|
|
715
729
|
});
|
|
716
|
-
commandRegistry.registerCommand(CommonCommands.TOGGLE_MAXIMIZED, {
|
|
717
|
-
isEnabled: (
|
|
718
|
-
isVisible: (
|
|
719
|
-
execute: (
|
|
720
|
-
});
|
|
730
|
+
commandRegistry.registerCommand(CommonCommands.TOGGLE_MAXIMIZED, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
|
|
731
|
+
isEnabled: title => Boolean((title === null || title === void 0 ? void 0 : title.owner) && this.shell.canToggleMaximized(title === null || title === void 0 ? void 0 : title.owner)),
|
|
732
|
+
isVisible: title => Boolean((title === null || title === void 0 ? void 0 : title.owner) && this.shell.canToggleMaximized(title === null || title === void 0 ? void 0 : title.owner)),
|
|
733
|
+
execute: title => (title === null || title === void 0 ? void 0 : title.owner) && this.shell.toggleMaximized(title === null || title === void 0 ? void 0 : title.owner),
|
|
734
|
+
}));
|
|
721
735
|
commandRegistry.registerCommand(CommonCommands.SAVE, {
|
|
722
736
|
execute: () => this.shell.save({ formatType: 1 /* ON */ })
|
|
723
737
|
});
|
|
@@ -743,61 +757,6 @@ let CommonFrontendContribution = class CommonFrontendContribution {
|
|
|
743
757
|
execute: () => this.configureDisplayLanguage()
|
|
744
758
|
});
|
|
745
759
|
}
|
|
746
|
-
findTabArea(event) {
|
|
747
|
-
const tabBar = this.shell.findTabBar(event);
|
|
748
|
-
if (tabBar) {
|
|
749
|
-
return this.shell.getAreaFor(tabBar);
|
|
750
|
-
}
|
|
751
|
-
return this.shell.currentTabArea;
|
|
752
|
-
}
|
|
753
|
-
/**
|
|
754
|
-
* Finds the index of the selected title from the tab-bar.
|
|
755
|
-
* @param tabBar: used for providing an array of titles.
|
|
756
|
-
* @returns the index of the selected title if it is available in the tab-bar, else returns the index of currently-selected title.
|
|
757
|
-
*/
|
|
758
|
-
findTitleIndex(tabBar, event) {
|
|
759
|
-
if (event) {
|
|
760
|
-
const targetTitle = this.shell.findTitle(tabBar, event);
|
|
761
|
-
return targetTitle ? tabBar.titles.indexOf(targetTitle) : tabBar.currentIndex;
|
|
762
|
-
}
|
|
763
|
-
return tabBar.currentIndex;
|
|
764
|
-
}
|
|
765
|
-
canToggleMaximized(event) {
|
|
766
|
-
if ((event === null || event === void 0 ? void 0 : event.target) instanceof HTMLElement) {
|
|
767
|
-
const widget = this.shell.findWidgetForElement(event.target);
|
|
768
|
-
if (widget) {
|
|
769
|
-
return this.shell.mainPanel.contains(widget) || this.shell.bottomPanel.contains(widget);
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
return this.shell.canToggleMaximized();
|
|
773
|
-
}
|
|
774
|
-
/**
|
|
775
|
-
* Maximize the bottom or the main dockpanel based on the widget.
|
|
776
|
-
* @param event used to find the selected widget.
|
|
777
|
-
*/
|
|
778
|
-
toggleMaximized(event) {
|
|
779
|
-
if ((event === null || event === void 0 ? void 0 : event.target) instanceof HTMLElement) {
|
|
780
|
-
const widget = this.shell.findWidgetForElement(event.target);
|
|
781
|
-
if (widget) {
|
|
782
|
-
if (this.shell.mainPanel.contains(widget)) {
|
|
783
|
-
this.shell.mainPanel.toggleMaximized();
|
|
784
|
-
}
|
|
785
|
-
else if (this.shell.bottomPanel.contains(widget)) {
|
|
786
|
-
this.shell.bottomPanel.toggleMaximized();
|
|
787
|
-
}
|
|
788
|
-
if (widget instanceof widgets_1.TabBar) {
|
|
789
|
-
// reveals the widget when maximized.
|
|
790
|
-
const title = this.shell.findTitle(widget, event);
|
|
791
|
-
if (title) {
|
|
792
|
-
this.shell.revealWidget(title.owner.id);
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
else {
|
|
798
|
-
this.shell.toggleMaximized();
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
760
|
isElectron() {
|
|
802
761
|
return environment_1.environment.electron.is();
|
|
803
762
|
}
|