@theia/output 1.45.0 → 1.46.0-next.72
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 +33 -33
- package/lib/browser/output-channel.d.ts +125 -125
- package/lib/browser/output-channel.js +334 -334
- package/lib/browser/output-commands.d.ts +17 -17
- package/lib/browser/output-commands.js +84 -84
- package/lib/browser/output-context-menu.d.ts +11 -11
- package/lib/browser/output-context-menu.js +42 -42
- package/lib/browser/output-contribution.d.ts +29 -29
- package/lib/browser/output-contribution.js +284 -284
- package/lib/browser/output-editor-factory.d.ts +12 -12
- package/lib/browser/output-editor-factory.d.ts.map +1 -1
- package/lib/browser/output-editor-factory.js +79 -84
- package/lib/browser/output-editor-factory.js.map +1 -1
- package/lib/browser/output-editor-model-factory.d.ts +15 -15
- package/lib/browser/output-editor-model-factory.js +61 -61
- package/lib/browser/output-frontend-module.d.ts +3 -3
- package/lib/browser/output-frontend-module.js +50 -50
- package/lib/browser/output-preferences.d.ts +11 -11
- package/lib/browser/output-preferences.js +46 -46
- package/lib/browser/output-resource.d.ts +18 -18
- package/lib/browser/output-resource.js +54 -54
- package/lib/browser/output-toolbar-contribution.d.ts +21 -21
- package/lib/browser/output-toolbar-contribution.js +125 -125
- package/lib/browser/output-widget.d.ts +48 -48
- package/lib/browser/output-widget.js +248 -248
- package/lib/common/output-uri.d.ts +7 -7
- package/lib/common/output-uri.js +47 -47
- package/lib/common/output-uri.spec.d.ts +1 -1
- package/lib/common/output-uri.spec.js +50 -50
- package/package.json +7 -7
- package/src/browser/output-channel.ts +366 -366
- package/src/browser/output-commands.ts +100 -100
- package/src/browser/output-context-menu.ts +34 -34
- package/src/browser/output-contribution.ts +274 -274
- package/src/browser/output-editor-factory.ts +68 -74
- package/src/browser/output-editor-model-factory.ts +54 -54
- package/src/browser/output-frontend-module.ts +53 -53
- package/src/browser/output-preferences.ts +58 -58
- package/src/browser/output-resource.ts +65 -65
- package/src/browser/output-toolbar-contribution.tsx +116 -116
- package/src/browser/output-widget.ts +256 -256
- package/src/browser/style/output.css +31 -31
- package/src/common/output-uri.spec.ts +53 -53
- package/src/common/output-uri.ts +47 -47
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2020 TypeFox and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.OutputResource = void 0;
|
|
19
|
-
const common_1 = require("@theia/core/lib/common");
|
|
20
|
-
class OutputResource {
|
|
21
|
-
constructor(uri, editorModelRef) {
|
|
22
|
-
this.uri = uri;
|
|
23
|
-
this.editorModelRef = editorModelRef;
|
|
24
|
-
this.onDidChangeContentsEmitter = new common_1.Emitter();
|
|
25
|
-
this.toDispose = new common_1.DisposableCollection(this.onDidChangeContentsEmitter);
|
|
26
|
-
this.editorModelRef.promise.then(modelRef => {
|
|
27
|
-
if (this.toDispose.disposed) {
|
|
28
|
-
modelRef.dispose();
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const textModel = modelRef.object.textEditorModel;
|
|
32
|
-
this._textModel = textModel;
|
|
33
|
-
this.toDispose.push(modelRef);
|
|
34
|
-
this.toDispose.push(this._textModel.onDidChangeContent(() => this.onDidChangeContentsEmitter.fire()));
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
get textModel() {
|
|
38
|
-
return this._textModel;
|
|
39
|
-
}
|
|
40
|
-
get onDidChangeContents() {
|
|
41
|
-
return this.onDidChangeContentsEmitter.event;
|
|
42
|
-
}
|
|
43
|
-
async readContents(options) {
|
|
44
|
-
if (this._textModel) {
|
|
45
|
-
const modelRef = await this.editorModelRef.promise;
|
|
46
|
-
return modelRef.object.textEditorModel.getValue();
|
|
47
|
-
}
|
|
48
|
-
return '';
|
|
49
|
-
}
|
|
50
|
-
dispose() {
|
|
51
|
-
this.toDispose.dispose();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.OutputResource = OutputResource;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2020 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.OutputResource = void 0;
|
|
19
|
+
const common_1 = require("@theia/core/lib/common");
|
|
20
|
+
class OutputResource {
|
|
21
|
+
constructor(uri, editorModelRef) {
|
|
22
|
+
this.uri = uri;
|
|
23
|
+
this.editorModelRef = editorModelRef;
|
|
24
|
+
this.onDidChangeContentsEmitter = new common_1.Emitter();
|
|
25
|
+
this.toDispose = new common_1.DisposableCollection(this.onDidChangeContentsEmitter);
|
|
26
|
+
this.editorModelRef.promise.then(modelRef => {
|
|
27
|
+
if (this.toDispose.disposed) {
|
|
28
|
+
modelRef.dispose();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const textModel = modelRef.object.textEditorModel;
|
|
32
|
+
this._textModel = textModel;
|
|
33
|
+
this.toDispose.push(modelRef);
|
|
34
|
+
this.toDispose.push(this._textModel.onDidChangeContent(() => this.onDidChangeContentsEmitter.fire()));
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
get textModel() {
|
|
38
|
+
return this._textModel;
|
|
39
|
+
}
|
|
40
|
+
get onDidChangeContents() {
|
|
41
|
+
return this.onDidChangeContentsEmitter.event;
|
|
42
|
+
}
|
|
43
|
+
async readContents(options) {
|
|
44
|
+
if (this._textModel) {
|
|
45
|
+
const modelRef = await this.editorModelRef.promise;
|
|
46
|
+
return modelRef.object.textEditorModel.getValue();
|
|
47
|
+
}
|
|
48
|
+
return '';
|
|
49
|
+
}
|
|
50
|
+
dispose() {
|
|
51
|
+
this.toDispose.dispose();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.OutputResource = OutputResource;
|
|
55
55
|
//# sourceMappingURL=output-resource.js.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import * as React from '@theia/core/shared/react';
|
|
3
|
-
import { Emitter } from '@theia/core/lib/common/event';
|
|
4
|
-
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
5
|
-
import { SelectOption } from '@theia/core/lib/browser/widgets/select-component';
|
|
6
|
-
import { OutputContribution } from './output-contribution';
|
|
7
|
-
import { OutputChannelManager } from './output-channel';
|
|
8
|
-
export declare class OutputToolbarContribution implements TabBarToolbarContribution {
|
|
9
|
-
protected readonly outputChannelManager: OutputChannelManager;
|
|
10
|
-
protected readonly outputContribution: OutputContribution;
|
|
11
|
-
protected readonly onOutputWidgetStateChangedEmitter: Emitter<void>;
|
|
12
|
-
protected readonly onOutputWidgetStateChanged: import("@theia/core/lib/common/event").Event<void>;
|
|
13
|
-
protected readonly onChannelsChangedEmitter: Emitter<void>;
|
|
14
|
-
protected readonly onChannelsChanged: import("@theia/core/lib/common/event").Event<void>;
|
|
15
|
-
protected init(): void;
|
|
16
|
-
registerToolbarItems(toolbarRegistry: TabBarToolbarRegistry): void;
|
|
17
|
-
protected readonly NONE = "<no channels>";
|
|
18
|
-
protected readonly OUTPUT_CHANNEL_LIST_ID = "outputChannelList";
|
|
19
|
-
protected renderChannelSelector(): React.ReactNode;
|
|
20
|
-
protected changeChannel: (option: SelectOption) => void;
|
|
21
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as React from '@theia/core/shared/react';
|
|
3
|
+
import { Emitter } from '@theia/core/lib/common/event';
|
|
4
|
+
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
5
|
+
import { SelectOption } from '@theia/core/lib/browser/widgets/select-component';
|
|
6
|
+
import { OutputContribution } from './output-contribution';
|
|
7
|
+
import { OutputChannelManager } from './output-channel';
|
|
8
|
+
export declare class OutputToolbarContribution implements TabBarToolbarContribution {
|
|
9
|
+
protected readonly outputChannelManager: OutputChannelManager;
|
|
10
|
+
protected readonly outputContribution: OutputContribution;
|
|
11
|
+
protected readonly onOutputWidgetStateChangedEmitter: Emitter<void>;
|
|
12
|
+
protected readonly onOutputWidgetStateChanged: import("@theia/core/lib/common/event").Event<void>;
|
|
13
|
+
protected readonly onChannelsChangedEmitter: Emitter<void>;
|
|
14
|
+
protected readonly onChannelsChanged: import("@theia/core/lib/common/event").Event<void>;
|
|
15
|
+
protected init(): void;
|
|
16
|
+
registerToolbarItems(toolbarRegistry: TabBarToolbarRegistry): void;
|
|
17
|
+
protected readonly NONE = "<no channels>";
|
|
18
|
+
protected readonly OUTPUT_CHANNEL_LIST_ID = "outputChannelList";
|
|
19
|
+
protected renderChannelSelector(): React.ReactNode;
|
|
20
|
+
protected changeChannel: (option: SelectOption) => void;
|
|
21
|
+
}
|
|
22
22
|
//# sourceMappingURL=output-toolbar-contribution.d.ts.map
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2019 Arm and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
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.OutputToolbarContribution = void 0;
|
|
28
|
-
const React = require("@theia/core/shared/react");
|
|
29
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
-
const event_1 = require("@theia/core/lib/common/event");
|
|
31
|
-
const select_component_1 = require("@theia/core/lib/browser/widgets/select-component");
|
|
32
|
-
const output_widget_1 = require("./output-widget");
|
|
33
|
-
const output_commands_1 = require("./output-commands");
|
|
34
|
-
const output_contribution_1 = require("./output-contribution");
|
|
35
|
-
const output_channel_1 = require("./output-channel");
|
|
36
|
-
const nls_1 = require("@theia/core/lib/common/nls");
|
|
37
|
-
let OutputToolbarContribution = class OutputToolbarContribution {
|
|
38
|
-
constructor() {
|
|
39
|
-
this.onOutputWidgetStateChangedEmitter = new event_1.Emitter();
|
|
40
|
-
this.onOutputWidgetStateChanged = this.onOutputWidgetStateChangedEmitter.event;
|
|
41
|
-
this.onChannelsChangedEmitter = new event_1.Emitter();
|
|
42
|
-
this.onChannelsChanged = this.onChannelsChangedEmitter.event;
|
|
43
|
-
this.NONE = '<no channels>';
|
|
44
|
-
this.OUTPUT_CHANNEL_LIST_ID = 'outputChannelList';
|
|
45
|
-
this.changeChannel = (option) => {
|
|
46
|
-
const channelName = option.value;
|
|
47
|
-
if (channelName !== this.NONE && channelName) {
|
|
48
|
-
this.outputChannelManager.getChannel(channelName).show();
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
init() {
|
|
53
|
-
this.outputContribution.widget.then(widget => {
|
|
54
|
-
widget.onStateChanged(() => this.onOutputWidgetStateChangedEmitter.fire());
|
|
55
|
-
});
|
|
56
|
-
const fireChannelsChanged = () => this.onChannelsChangedEmitter.fire();
|
|
57
|
-
this.outputChannelManager.onSelectedChannelChanged(fireChannelsChanged);
|
|
58
|
-
this.outputChannelManager.onChannelAdded(fireChannelsChanged);
|
|
59
|
-
this.outputChannelManager.onChannelDeleted(fireChannelsChanged);
|
|
60
|
-
this.outputChannelManager.onChannelWasShown(fireChannelsChanged);
|
|
61
|
-
this.outputChannelManager.onChannelWasHidden(fireChannelsChanged);
|
|
62
|
-
}
|
|
63
|
-
registerToolbarItems(toolbarRegistry) {
|
|
64
|
-
toolbarRegistry.registerItem({
|
|
65
|
-
id: 'channels',
|
|
66
|
-
render: () => this.renderChannelSelector(),
|
|
67
|
-
isVisible: widget => widget instanceof output_widget_1.OutputWidget,
|
|
68
|
-
onDidChange: this.onChannelsChanged
|
|
69
|
-
});
|
|
70
|
-
toolbarRegistry.registerItem({
|
|
71
|
-
id: output_commands_1.OutputCommands.CLEAR__WIDGET.id,
|
|
72
|
-
command: output_commands_1.OutputCommands.CLEAR__WIDGET.id,
|
|
73
|
-
tooltip: nls_1.nls.localizeByDefault('Clear Output'),
|
|
74
|
-
priority: 1,
|
|
75
|
-
});
|
|
76
|
-
toolbarRegistry.registerItem({
|
|
77
|
-
id: output_commands_1.OutputCommands.LOCK__WIDGET.id,
|
|
78
|
-
command: output_commands_1.OutputCommands.LOCK__WIDGET.id,
|
|
79
|
-
tooltip: nls_1.nls.localizeByDefault('Turn Auto Scrolling Off'),
|
|
80
|
-
onDidChange: this.onOutputWidgetStateChanged,
|
|
81
|
-
priority: 2
|
|
82
|
-
});
|
|
83
|
-
toolbarRegistry.registerItem({
|
|
84
|
-
id: output_commands_1.OutputCommands.UNLOCK__WIDGET.id,
|
|
85
|
-
command: output_commands_1.OutputCommands.UNLOCK__WIDGET.id,
|
|
86
|
-
tooltip: nls_1.nls.localizeByDefault('Turn Auto Scrolling On'),
|
|
87
|
-
onDidChange: this.onOutputWidgetStateChanged,
|
|
88
|
-
priority: 2
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
renderChannelSelector() {
|
|
92
|
-
var _a, _b;
|
|
93
|
-
const channelOptionElements = [];
|
|
94
|
-
this.outputChannelManager.getVisibleChannels().forEach((channel, i) => {
|
|
95
|
-
channelOptionElements.push({
|
|
96
|
-
value: channel.name
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
if (channelOptionElements.length === 0) {
|
|
100
|
-
channelOptionElements.push({
|
|
101
|
-
value: this.NONE
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
return React.createElement("div", { id: this.OUTPUT_CHANNEL_LIST_ID, key: this.OUTPUT_CHANNEL_LIST_ID },
|
|
105
|
-
React.createElement(select_component_1.SelectComponent, { key: (_a = this.outputChannelManager.selectedChannel) === null || _a === void 0 ? void 0 : _a.name, options: channelOptionElements, defaultValue: (_b = this.outputChannelManager.selectedChannel) === null || _b === void 0 ? void 0 : _b.name, onChange: option => this.changeChannel(option) }));
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
__decorate([
|
|
109
|
-
(0, inversify_1.inject)(output_channel_1.OutputChannelManager),
|
|
110
|
-
__metadata("design:type", output_channel_1.OutputChannelManager)
|
|
111
|
-
], OutputToolbarContribution.prototype, "outputChannelManager", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
(0, inversify_1.inject)(output_contribution_1.OutputContribution),
|
|
114
|
-
__metadata("design:type", output_contribution_1.OutputContribution)
|
|
115
|
-
], OutputToolbarContribution.prototype, "outputContribution", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
(0, inversify_1.postConstruct)(),
|
|
118
|
-
__metadata("design:type", Function),
|
|
119
|
-
__metadata("design:paramtypes", []),
|
|
120
|
-
__metadata("design:returntype", void 0)
|
|
121
|
-
], OutputToolbarContribution.prototype, "init", null);
|
|
122
|
-
OutputToolbarContribution = __decorate([
|
|
123
|
-
(0, inversify_1.injectable)()
|
|
124
|
-
], OutputToolbarContribution);
|
|
125
|
-
exports.OutputToolbarContribution = OutputToolbarContribution;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 Arm and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
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.OutputToolbarContribution = void 0;
|
|
28
|
+
const React = require("@theia/core/shared/react");
|
|
29
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
+
const event_1 = require("@theia/core/lib/common/event");
|
|
31
|
+
const select_component_1 = require("@theia/core/lib/browser/widgets/select-component");
|
|
32
|
+
const output_widget_1 = require("./output-widget");
|
|
33
|
+
const output_commands_1 = require("./output-commands");
|
|
34
|
+
const output_contribution_1 = require("./output-contribution");
|
|
35
|
+
const output_channel_1 = require("./output-channel");
|
|
36
|
+
const nls_1 = require("@theia/core/lib/common/nls");
|
|
37
|
+
let OutputToolbarContribution = class OutputToolbarContribution {
|
|
38
|
+
constructor() {
|
|
39
|
+
this.onOutputWidgetStateChangedEmitter = new event_1.Emitter();
|
|
40
|
+
this.onOutputWidgetStateChanged = this.onOutputWidgetStateChangedEmitter.event;
|
|
41
|
+
this.onChannelsChangedEmitter = new event_1.Emitter();
|
|
42
|
+
this.onChannelsChanged = this.onChannelsChangedEmitter.event;
|
|
43
|
+
this.NONE = '<no channels>';
|
|
44
|
+
this.OUTPUT_CHANNEL_LIST_ID = 'outputChannelList';
|
|
45
|
+
this.changeChannel = (option) => {
|
|
46
|
+
const channelName = option.value;
|
|
47
|
+
if (channelName !== this.NONE && channelName) {
|
|
48
|
+
this.outputChannelManager.getChannel(channelName).show();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
init() {
|
|
53
|
+
this.outputContribution.widget.then(widget => {
|
|
54
|
+
widget.onStateChanged(() => this.onOutputWidgetStateChangedEmitter.fire());
|
|
55
|
+
});
|
|
56
|
+
const fireChannelsChanged = () => this.onChannelsChangedEmitter.fire();
|
|
57
|
+
this.outputChannelManager.onSelectedChannelChanged(fireChannelsChanged);
|
|
58
|
+
this.outputChannelManager.onChannelAdded(fireChannelsChanged);
|
|
59
|
+
this.outputChannelManager.onChannelDeleted(fireChannelsChanged);
|
|
60
|
+
this.outputChannelManager.onChannelWasShown(fireChannelsChanged);
|
|
61
|
+
this.outputChannelManager.onChannelWasHidden(fireChannelsChanged);
|
|
62
|
+
}
|
|
63
|
+
registerToolbarItems(toolbarRegistry) {
|
|
64
|
+
toolbarRegistry.registerItem({
|
|
65
|
+
id: 'channels',
|
|
66
|
+
render: () => this.renderChannelSelector(),
|
|
67
|
+
isVisible: widget => widget instanceof output_widget_1.OutputWidget,
|
|
68
|
+
onDidChange: this.onChannelsChanged
|
|
69
|
+
});
|
|
70
|
+
toolbarRegistry.registerItem({
|
|
71
|
+
id: output_commands_1.OutputCommands.CLEAR__WIDGET.id,
|
|
72
|
+
command: output_commands_1.OutputCommands.CLEAR__WIDGET.id,
|
|
73
|
+
tooltip: nls_1.nls.localizeByDefault('Clear Output'),
|
|
74
|
+
priority: 1,
|
|
75
|
+
});
|
|
76
|
+
toolbarRegistry.registerItem({
|
|
77
|
+
id: output_commands_1.OutputCommands.LOCK__WIDGET.id,
|
|
78
|
+
command: output_commands_1.OutputCommands.LOCK__WIDGET.id,
|
|
79
|
+
tooltip: nls_1.nls.localizeByDefault('Turn Auto Scrolling Off'),
|
|
80
|
+
onDidChange: this.onOutputWidgetStateChanged,
|
|
81
|
+
priority: 2
|
|
82
|
+
});
|
|
83
|
+
toolbarRegistry.registerItem({
|
|
84
|
+
id: output_commands_1.OutputCommands.UNLOCK__WIDGET.id,
|
|
85
|
+
command: output_commands_1.OutputCommands.UNLOCK__WIDGET.id,
|
|
86
|
+
tooltip: nls_1.nls.localizeByDefault('Turn Auto Scrolling On'),
|
|
87
|
+
onDidChange: this.onOutputWidgetStateChanged,
|
|
88
|
+
priority: 2
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
renderChannelSelector() {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
const channelOptionElements = [];
|
|
94
|
+
this.outputChannelManager.getVisibleChannels().forEach((channel, i) => {
|
|
95
|
+
channelOptionElements.push({
|
|
96
|
+
value: channel.name
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
if (channelOptionElements.length === 0) {
|
|
100
|
+
channelOptionElements.push({
|
|
101
|
+
value: this.NONE
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return React.createElement("div", { id: this.OUTPUT_CHANNEL_LIST_ID, key: this.OUTPUT_CHANNEL_LIST_ID },
|
|
105
|
+
React.createElement(select_component_1.SelectComponent, { key: (_a = this.outputChannelManager.selectedChannel) === null || _a === void 0 ? void 0 : _a.name, options: channelOptionElements, defaultValue: (_b = this.outputChannelManager.selectedChannel) === null || _b === void 0 ? void 0 : _b.name, onChange: option => this.changeChannel(option) }));
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, inversify_1.inject)(output_channel_1.OutputChannelManager),
|
|
110
|
+
__metadata("design:type", output_channel_1.OutputChannelManager)
|
|
111
|
+
], OutputToolbarContribution.prototype, "outputChannelManager", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, inversify_1.inject)(output_contribution_1.OutputContribution),
|
|
114
|
+
__metadata("design:type", output_contribution_1.OutputContribution)
|
|
115
|
+
], OutputToolbarContribution.prototype, "outputContribution", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, inversify_1.postConstruct)(),
|
|
118
|
+
__metadata("design:type", Function),
|
|
119
|
+
__metadata("design:paramtypes", []),
|
|
120
|
+
__metadata("design:returntype", void 0)
|
|
121
|
+
], OutputToolbarContribution.prototype, "init", null);
|
|
122
|
+
OutputToolbarContribution = __decorate([
|
|
123
|
+
(0, inversify_1.injectable)()
|
|
124
|
+
], OutputToolbarContribution);
|
|
125
|
+
exports.OutputToolbarContribution = OutputToolbarContribution;
|
|
126
126
|
//# sourceMappingURL=output-toolbar-contribution.js.map
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import '../../src/browser/style/output.css';
|
|
2
|
-
import { SelectionService } from '@theia/core/lib/common/selection-service';
|
|
3
|
-
import { MonacoEditorProvider } from '@theia/monaco/lib/browser/monaco-editor-provider';
|
|
4
|
-
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
5
|
-
import { Message, BaseWidget, DockPanel, Widget, StatefulWidget } from '@theia/core/lib/browser';
|
|
6
|
-
import { OutputChannelManager } from './output-channel';
|
|
7
|
-
import { Emitter, Event } from '@theia/core';
|
|
8
|
-
export declare class OutputWidget extends BaseWidget implements StatefulWidget {
|
|
9
|
-
static readonly ID = "outputView";
|
|
10
|
-
static readonly LABEL: string;
|
|
11
|
-
protected readonly selectionService: SelectionService;
|
|
12
|
-
protected readonly editorProvider: MonacoEditorProvider;
|
|
13
|
-
protected readonly outputChannelManager: OutputChannelManager;
|
|
14
|
-
protected _state: OutputWidget.State;
|
|
15
|
-
protected readonly editorContainer: DockPanel;
|
|
16
|
-
protected readonly toDisposeOnSelectedChannelChanged: DisposableCollection;
|
|
17
|
-
protected readonly onStateChangedEmitter: Emitter<OutputWidget.State>;
|
|
18
|
-
constructor();
|
|
19
|
-
protected init(): void;
|
|
20
|
-
storeState(): object;
|
|
21
|
-
restoreState(oldState: object & Partial<OutputWidget.State>): void;
|
|
22
|
-
protected get state(): OutputWidget.State;
|
|
23
|
-
protected set state(state: OutputWidget.State);
|
|
24
|
-
protected refreshEditorWidget({ preserveFocus }?: {
|
|
25
|
-
preserveFocus: boolean;
|
|
26
|
-
}): Promise<void>;
|
|
27
|
-
protected onAfterAttach(message: Message): void;
|
|
28
|
-
protected onActivateRequest(message: Message): void;
|
|
29
|
-
protected onResize(message: Widget.ResizeMessage): void;
|
|
30
|
-
protected onAfterShow(msg: Message): void;
|
|
31
|
-
get onStateChanged(): Event<OutputWidget.State>;
|
|
32
|
-
clear(): void;
|
|
33
|
-
selectAll(): void;
|
|
34
|
-
lock(): void;
|
|
35
|
-
unlock(): void;
|
|
36
|
-
get isLocked(): boolean;
|
|
37
|
-
protected revealLastLine(): void;
|
|
38
|
-
private get selectedChannel();
|
|
39
|
-
private createEditorWidget;
|
|
40
|
-
private get editorWidget();
|
|
41
|
-
private get editor();
|
|
42
|
-
getText(): string | undefined;
|
|
43
|
-
}
|
|
44
|
-
export declare namespace OutputWidget {
|
|
45
|
-
interface State {
|
|
46
|
-
locked?: boolean;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
1
|
+
import '../../src/browser/style/output.css';
|
|
2
|
+
import { SelectionService } from '@theia/core/lib/common/selection-service';
|
|
3
|
+
import { MonacoEditorProvider } from '@theia/monaco/lib/browser/monaco-editor-provider';
|
|
4
|
+
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
5
|
+
import { Message, BaseWidget, DockPanel, Widget, StatefulWidget } from '@theia/core/lib/browser';
|
|
6
|
+
import { OutputChannelManager } from './output-channel';
|
|
7
|
+
import { Emitter, Event } from '@theia/core';
|
|
8
|
+
export declare class OutputWidget extends BaseWidget implements StatefulWidget {
|
|
9
|
+
static readonly ID = "outputView";
|
|
10
|
+
static readonly LABEL: string;
|
|
11
|
+
protected readonly selectionService: SelectionService;
|
|
12
|
+
protected readonly editorProvider: MonacoEditorProvider;
|
|
13
|
+
protected readonly outputChannelManager: OutputChannelManager;
|
|
14
|
+
protected _state: OutputWidget.State;
|
|
15
|
+
protected readonly editorContainer: DockPanel;
|
|
16
|
+
protected readonly toDisposeOnSelectedChannelChanged: DisposableCollection;
|
|
17
|
+
protected readonly onStateChangedEmitter: Emitter<OutputWidget.State>;
|
|
18
|
+
constructor();
|
|
19
|
+
protected init(): void;
|
|
20
|
+
storeState(): object;
|
|
21
|
+
restoreState(oldState: object & Partial<OutputWidget.State>): void;
|
|
22
|
+
protected get state(): OutputWidget.State;
|
|
23
|
+
protected set state(state: OutputWidget.State);
|
|
24
|
+
protected refreshEditorWidget({ preserveFocus }?: {
|
|
25
|
+
preserveFocus: boolean;
|
|
26
|
+
}): Promise<void>;
|
|
27
|
+
protected onAfterAttach(message: Message): void;
|
|
28
|
+
protected onActivateRequest(message: Message): void;
|
|
29
|
+
protected onResize(message: Widget.ResizeMessage): void;
|
|
30
|
+
protected onAfterShow(msg: Message): void;
|
|
31
|
+
get onStateChanged(): Event<OutputWidget.State>;
|
|
32
|
+
clear(): void;
|
|
33
|
+
selectAll(): void;
|
|
34
|
+
lock(): void;
|
|
35
|
+
unlock(): void;
|
|
36
|
+
get isLocked(): boolean;
|
|
37
|
+
protected revealLastLine(): void;
|
|
38
|
+
private get selectedChannel();
|
|
39
|
+
private createEditorWidget;
|
|
40
|
+
private get editorWidget();
|
|
41
|
+
private get editor();
|
|
42
|
+
getText(): string | undefined;
|
|
43
|
+
}
|
|
44
|
+
export declare namespace OutputWidget {
|
|
45
|
+
interface State {
|
|
46
|
+
locked?: boolean;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
49
|
//# sourceMappingURL=output-widget.d.ts.map
|