1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | exports.CurrentWidgetCommandAdapter = void 0;
|
19 |
|
20 |
|
21 |
|
22 | class CurrentWidgetCommandAdapter {
|
23 | constructor(shell, handler) {
|
24 | this.execute = (event) => handler.execute(...this.transformArguments(shell, event));
|
25 | if (handler.isEnabled) {
|
26 | this.isEnabled = (event) => { var _a; return !!((_a = handler.isEnabled) === null || _a === void 0 ? void 0 : _a.call(handler, ...this.transformArguments(shell, event))); };
|
27 | }
|
28 | if (handler.isVisible) {
|
29 | this.isVisible = (event) => { var _a; return !!((_a = handler.isVisible) === null || _a === void 0 ? void 0 : _a.call(handler, ...this.transformArguments(shell, event))); };
|
30 | }
|
31 | if (handler.isToggled) {
|
32 | this.isToggled = (event) => { var _a; return !!((_a = handler.isToggled) === null || _a === void 0 ? void 0 : _a.call(handler, ...this.transformArguments(shell, event))); };
|
33 | }
|
34 | }
|
35 | transformArguments(shell, event) {
|
36 | const tabBar = shell.findTabBar(event);
|
37 | const title = tabBar && shell.findTitle(tabBar, event);
|
38 | return [title, tabBar, event];
|
39 | }
|
40 | }
|
41 | exports.CurrentWidgetCommandAdapter = CurrentWidgetCommandAdapter;
|
42 |
|
\ | No newline at end of file |