@theia/bulk-edit 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 +30 -30
- package/lib/browser/bulk-edit-commands.d.ts +6 -6
- package/lib/browser/bulk-edit-commands.js +33 -33
- package/lib/browser/bulk-edit-contribution.d.ts +19 -19
- package/lib/browser/bulk-edit-contribution.js +115 -115
- package/lib/browser/bulk-edit-frontend-module.d.ts +4 -4
- package/lib/browser/bulk-edit-frontend-module.js +37 -37
- package/lib/browser/bulk-edit-tree/bulk-edit-node-selection.d.ts +14 -14
- package/lib/browser/bulk-edit-tree/bulk-edit-node-selection.js +35 -35
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-container.d.ts +4 -4
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-container.js +35 -35
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-model.d.ts +10 -10
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-model.js +58 -58
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-widget.d.ts +33 -33
- package/lib/browser/bulk-edit-tree/bulk-edit-tree-widget.js +231 -231
- package/lib/browser/bulk-edit-tree/bulk-edit-tree.d.ts +24 -24
- package/lib/browser/bulk-edit-tree/bulk-edit-tree.js +112 -112
- package/lib/browser/bulk-edit-tree/bulk-edit-tree.spec.d.ts +1 -1
- package/lib/browser/bulk-edit-tree/bulk-edit-tree.spec.js +62 -62
- package/lib/browser/bulk-edit-tree/bulk-edit-tree.spec.js.map +1 -1
- package/lib/browser/bulk-edit-tree/index.d.ts +5 -5
- package/lib/browser/bulk-edit-tree/index.js +32 -32
- package/lib/browser/bulk-edit-tree-label-provider.d.ts +15 -15
- package/lib/browser/bulk-edit-tree-label-provider.js +80 -80
- package/package.json +9 -9
- package/src/browser/bulk-edit-commands.ts +34 -34
- package/src/browser/bulk-edit-contribution.ts +112 -112
- package/src/browser/bulk-edit-frontend-module.ts +39 -39
- package/src/browser/bulk-edit-tree/bulk-edit-node-selection.ts +44 -44
- package/src/browser/bulk-edit-tree/bulk-edit-tree-container.ts +35 -35
- package/src/browser/bulk-edit-tree/bulk-edit-tree-model.ts +42 -42
- package/src/browser/bulk-edit-tree/bulk-edit-tree-widget.tsx +231 -231
- package/src/browser/bulk-edit-tree/bulk-edit-tree.spec.ts +73 -73
- package/src/browser/bulk-edit-tree/bulk-edit-tree.ts +114 -114
- package/src/browser/bulk-edit-tree/index.ts +21 -21
- package/src/browser/bulk-edit-tree-label-provider.ts +71 -71
- package/src/browser/style/bulk-edit.css +66 -66
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
<div align='center'>
|
|
2
|
-
|
|
3
|
-
<br />
|
|
4
|
-
|
|
5
|
-
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
-
|
|
7
|
-
<h2>ECLIPSE THEIA - BULK EDIT EXTENSION</h2>
|
|
8
|
-
|
|
9
|
-
<hr />
|
|
10
|
-
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
## Description
|
|
14
|
-
|
|
15
|
-
The `@theia/bulk-edit` extension contributes a `Refactor Preview` widget to the application that displays WorkspaceEdits to end-users.
|
|
16
|
-
|
|
17
|
-
## Additional Information
|
|
18
|
-
|
|
19
|
-
- [API documentation for `@theia/bulk-edit`](https://eclipse-theia.github.io/theia/docs/next/modules/bulk-edit.html)
|
|
20
|
-
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
21
|
-
- [Theia - Website](https://theia-ide.org/)
|
|
22
|
-
|
|
23
|
-
## License
|
|
24
|
-
|
|
25
|
-
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
26
|
-
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
27
|
-
|
|
28
|
-
## Trademark
|
|
29
|
-
"Theia" is a trademark of the Eclipse Foundation
|
|
30
|
-
https://www.eclipse.org/theia
|
|
1
|
+
<div align='center'>
|
|
2
|
+
|
|
3
|
+
<br />
|
|
4
|
+
|
|
5
|
+
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
+
|
|
7
|
+
<h2>ECLIPSE THEIA - BULK EDIT EXTENSION</h2>
|
|
8
|
+
|
|
9
|
+
<hr />
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
The `@theia/bulk-edit` extension contributes a `Refactor Preview` widget to the application that displays WorkspaceEdits to end-users.
|
|
16
|
+
|
|
17
|
+
## Additional Information
|
|
18
|
+
|
|
19
|
+
- [API documentation for `@theia/bulk-edit`](https://eclipse-theia.github.io/theia/docs/next/modules/bulk-edit.html)
|
|
20
|
+
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
21
|
+
- [Theia - Website](https://theia-ide.org/)
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
26
|
+
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
27
|
+
|
|
28
|
+
## Trademark
|
|
29
|
+
"Theia" is a trademark of the Eclipse Foundation
|
|
30
|
+
https://www.eclipse.org/theia
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Command } from '@theia/core/lib/common';
|
|
2
|
-
export declare namespace BulkEditCommands {
|
|
3
|
-
const TOGGLE_VIEW: Command;
|
|
4
|
-
const APPLY: Command;
|
|
5
|
-
const DISCARD: Command;
|
|
6
|
-
}
|
|
1
|
+
import { Command } from '@theia/core/lib/common';
|
|
2
|
+
export declare namespace BulkEditCommands {
|
|
3
|
+
const TOGGLE_VIEW: Command;
|
|
4
|
+
const APPLY: Command;
|
|
5
|
+
const DISCARD: Command;
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=bulk-edit-commands.d.ts.map
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company 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.BulkEditCommands = void 0;
|
|
19
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
20
|
-
var BulkEditCommands;
|
|
21
|
-
(function (BulkEditCommands) {
|
|
22
|
-
BulkEditCommands.TOGGLE_VIEW = {
|
|
23
|
-
id: 'bulk-edit:toggleView'
|
|
24
|
-
};
|
|
25
|
-
BulkEditCommands.APPLY = {
|
|
26
|
-
id: 'bulk-edit:apply',
|
|
27
|
-
iconClass: (0, browser_1.codicon)('check')
|
|
28
|
-
};
|
|
29
|
-
BulkEditCommands.DISCARD = {
|
|
30
|
-
id: 'bulk-edit:discard',
|
|
31
|
-
iconClass: (0, browser_1.codicon)('clear-all')
|
|
32
|
-
};
|
|
33
|
-
})(BulkEditCommands = exports.BulkEditCommands || (exports.BulkEditCommands = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 SAP SE or an SAP affiliate company 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.BulkEditCommands = void 0;
|
|
19
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
20
|
+
var BulkEditCommands;
|
|
21
|
+
(function (BulkEditCommands) {
|
|
22
|
+
BulkEditCommands.TOGGLE_VIEW = {
|
|
23
|
+
id: 'bulk-edit:toggleView'
|
|
24
|
+
};
|
|
25
|
+
BulkEditCommands.APPLY = {
|
|
26
|
+
id: 'bulk-edit:apply',
|
|
27
|
+
iconClass: (0, browser_1.codicon)('check')
|
|
28
|
+
};
|
|
29
|
+
BulkEditCommands.DISCARD = {
|
|
30
|
+
id: 'bulk-edit:discard',
|
|
31
|
+
iconClass: (0, browser_1.codicon)('clear-all')
|
|
32
|
+
};
|
|
33
|
+
})(BulkEditCommands = exports.BulkEditCommands || (exports.BulkEditCommands = {}));
|
|
34
34
|
//# sourceMappingURL=bulk-edit-commands.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Widget } from '@theia/core/lib/browser/widgets/widget';
|
|
2
|
-
import { CommandRegistry } from '@theia/core/lib/common';
|
|
3
|
-
import { AbstractViewContribution } from '@theia/core/lib/browser/shell/view-contribution';
|
|
4
|
-
import { MonacoBulkEditService } from '@theia/monaco/lib/browser/monaco-bulk-edit-service';
|
|
5
|
-
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
6
|
-
import { BulkEditTreeWidget } from './bulk-edit-tree';
|
|
7
|
-
import { QuickViewService } from '@theia/core/lib/browser';
|
|
8
|
-
export declare class BulkEditContribution extends AbstractViewContribution<BulkEditTreeWidget> implements TabBarToolbarContribution {
|
|
9
|
-
private readonly bulkEditService;
|
|
10
|
-
private edits;
|
|
11
|
-
protected readonly quickView: QuickViewService;
|
|
12
|
-
constructor(bulkEditService: MonacoBulkEditService);
|
|
13
|
-
registerCommands(registry: CommandRegistry): void;
|
|
14
|
-
registerToolbarItems(toolbarRegistry: TabBarToolbarRegistry): Promise<void>;
|
|
15
|
-
protected withWidget<T>(widget: Widget | undefined, cb: (bulkEdit: BulkEditTreeWidget) => T): T | false;
|
|
16
|
-
private previewEdit;
|
|
17
|
-
private apply;
|
|
18
|
-
private discard;
|
|
19
|
-
}
|
|
1
|
+
import { Widget } from '@theia/core/lib/browser/widgets/widget';
|
|
2
|
+
import { CommandRegistry } from '@theia/core/lib/common';
|
|
3
|
+
import { AbstractViewContribution } from '@theia/core/lib/browser/shell/view-contribution';
|
|
4
|
+
import { MonacoBulkEditService } from '@theia/monaco/lib/browser/monaco-bulk-edit-service';
|
|
5
|
+
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
6
|
+
import { BulkEditTreeWidget } from './bulk-edit-tree';
|
|
7
|
+
import { QuickViewService } from '@theia/core/lib/browser';
|
|
8
|
+
export declare class BulkEditContribution extends AbstractViewContribution<BulkEditTreeWidget> implements TabBarToolbarContribution {
|
|
9
|
+
private readonly bulkEditService;
|
|
10
|
+
private edits;
|
|
11
|
+
protected readonly quickView: QuickViewService;
|
|
12
|
+
constructor(bulkEditService: MonacoBulkEditService);
|
|
13
|
+
registerCommands(registry: CommandRegistry): void;
|
|
14
|
+
registerToolbarItems(toolbarRegistry: TabBarToolbarRegistry): Promise<void>;
|
|
15
|
+
protected withWidget<T>(widget: Widget | undefined, cb: (bulkEdit: BulkEditTreeWidget) => T): T | false;
|
|
16
|
+
private previewEdit;
|
|
17
|
+
private apply;
|
|
18
|
+
private discard;
|
|
19
|
+
}
|
|
20
20
|
//# sourceMappingURL=bulk-edit-contribution.d.ts.map
|
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company 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.BulkEditContribution = void 0;
|
|
28
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
-
const view_contribution_1 = require("@theia/core/lib/browser/shell/view-contribution");
|
|
30
|
-
const bulk_edit_commands_1 = require("./bulk-edit-commands");
|
|
31
|
-
const monaco_bulk_edit_service_1 = require("@theia/monaco/lib/browser/monaco-bulk-edit-service");
|
|
32
|
-
const bulk_edit_tree_1 = require("./bulk-edit-tree");
|
|
33
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
34
|
-
const nls_1 = require("@theia/core/lib/common/nls");
|
|
35
|
-
let BulkEditContribution = class BulkEditContribution extends view_contribution_1.AbstractViewContribution {
|
|
36
|
-
constructor(bulkEditService) {
|
|
37
|
-
super({
|
|
38
|
-
widgetId: bulk_edit_tree_1.BULK_EDIT_TREE_WIDGET_ID,
|
|
39
|
-
widgetName: bulk_edit_tree_1.BULK_EDIT_WIDGET_NAME,
|
|
40
|
-
defaultWidgetOptions: {
|
|
41
|
-
area: 'bottom'
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
this.bulkEditService = bulkEditService;
|
|
45
|
-
this.bulkEditService.setPreviewHandler((edits) => this.previewEdit(edits));
|
|
46
|
-
}
|
|
47
|
-
registerCommands(registry) {
|
|
48
|
-
var _a;
|
|
49
|
-
super.registerCommands(registry);
|
|
50
|
-
(_a = this.quickView) === null || _a === void 0 ? void 0 : _a.hideItem(bulk_edit_tree_1.BULK_EDIT_WIDGET_NAME);
|
|
51
|
-
registry.registerCommand(bulk_edit_commands_1.BulkEditCommands.APPLY, {
|
|
52
|
-
isEnabled: widget => this.withWidget(widget, () => true),
|
|
53
|
-
isVisible: widget => this.withWidget(widget, () => true),
|
|
54
|
-
execute: widget => this.withWidget(widget, () => this.apply())
|
|
55
|
-
});
|
|
56
|
-
registry.registerCommand(bulk_edit_commands_1.BulkEditCommands.DISCARD, {
|
|
57
|
-
isEnabled: widget => this.withWidget(widget, () => true),
|
|
58
|
-
isVisible: widget => this.withWidget(widget, () => true),
|
|
59
|
-
execute: widget => this.withWidget(widget, () => this.discard())
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
async registerToolbarItems(toolbarRegistry) {
|
|
63
|
-
toolbarRegistry.registerItem({
|
|
64
|
-
id: bulk_edit_commands_1.BulkEditCommands.APPLY.id,
|
|
65
|
-
command: bulk_edit_commands_1.BulkEditCommands.APPLY.id,
|
|
66
|
-
tooltip: nls_1.nls.localizeByDefault('Apply Refactoring'),
|
|
67
|
-
priority: 0,
|
|
68
|
-
});
|
|
69
|
-
toolbarRegistry.registerItem({
|
|
70
|
-
id: bulk_edit_commands_1.BulkEditCommands.DISCARD.id,
|
|
71
|
-
command: bulk_edit_commands_1.BulkEditCommands.DISCARD.id,
|
|
72
|
-
tooltip: nls_1.nls.localizeByDefault('Discard Refactoring'),
|
|
73
|
-
priority: 1,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
withWidget(widget = this.tryGetWidget(), cb) {
|
|
77
|
-
if (widget instanceof bulk_edit_tree_1.BulkEditTreeWidget) {
|
|
78
|
-
return cb(widget);
|
|
79
|
-
}
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
async previewEdit(edits) {
|
|
83
|
-
const widget = await this.openView({ activate: true });
|
|
84
|
-
if (widget) {
|
|
85
|
-
this.edits = edits;
|
|
86
|
-
await widget.initModel(edits);
|
|
87
|
-
}
|
|
88
|
-
return edits;
|
|
89
|
-
}
|
|
90
|
-
apply() {
|
|
91
|
-
if (this.edits) {
|
|
92
|
-
this.edits.forEach(edit => {
|
|
93
|
-
if (edit.metadata) {
|
|
94
|
-
edit.metadata.needsConfirmation = false;
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
this.bulkEditService.apply(this.edits);
|
|
98
|
-
}
|
|
99
|
-
this.closeView();
|
|
100
|
-
}
|
|
101
|
-
discard() {
|
|
102
|
-
this.edits = [];
|
|
103
|
-
this.closeView();
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
__decorate([
|
|
107
|
-
(0, inversify_1.inject)(browser_1.QuickViewService),
|
|
108
|
-
(0, inversify_1.optional)(),
|
|
109
|
-
__metadata("design:type", browser_1.QuickViewService)
|
|
110
|
-
], BulkEditContribution.prototype, "quickView", void 0);
|
|
111
|
-
BulkEditContribution = __decorate([
|
|
112
|
-
(0, inversify_1.injectable)(),
|
|
113
|
-
__metadata("design:paramtypes", [monaco_bulk_edit_service_1.MonacoBulkEditService])
|
|
114
|
-
], BulkEditContribution);
|
|
115
|
-
exports.BulkEditContribution = BulkEditContribution;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 SAP SE or an SAP affiliate company 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.BulkEditContribution = void 0;
|
|
28
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
+
const view_contribution_1 = require("@theia/core/lib/browser/shell/view-contribution");
|
|
30
|
+
const bulk_edit_commands_1 = require("./bulk-edit-commands");
|
|
31
|
+
const monaco_bulk_edit_service_1 = require("@theia/monaco/lib/browser/monaco-bulk-edit-service");
|
|
32
|
+
const bulk_edit_tree_1 = require("./bulk-edit-tree");
|
|
33
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
34
|
+
const nls_1 = require("@theia/core/lib/common/nls");
|
|
35
|
+
let BulkEditContribution = class BulkEditContribution extends view_contribution_1.AbstractViewContribution {
|
|
36
|
+
constructor(bulkEditService) {
|
|
37
|
+
super({
|
|
38
|
+
widgetId: bulk_edit_tree_1.BULK_EDIT_TREE_WIDGET_ID,
|
|
39
|
+
widgetName: bulk_edit_tree_1.BULK_EDIT_WIDGET_NAME,
|
|
40
|
+
defaultWidgetOptions: {
|
|
41
|
+
area: 'bottom'
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
this.bulkEditService = bulkEditService;
|
|
45
|
+
this.bulkEditService.setPreviewHandler((edits) => this.previewEdit(edits));
|
|
46
|
+
}
|
|
47
|
+
registerCommands(registry) {
|
|
48
|
+
var _a;
|
|
49
|
+
super.registerCommands(registry);
|
|
50
|
+
(_a = this.quickView) === null || _a === void 0 ? void 0 : _a.hideItem(bulk_edit_tree_1.BULK_EDIT_WIDGET_NAME);
|
|
51
|
+
registry.registerCommand(bulk_edit_commands_1.BulkEditCommands.APPLY, {
|
|
52
|
+
isEnabled: widget => this.withWidget(widget, () => true),
|
|
53
|
+
isVisible: widget => this.withWidget(widget, () => true),
|
|
54
|
+
execute: widget => this.withWidget(widget, () => this.apply())
|
|
55
|
+
});
|
|
56
|
+
registry.registerCommand(bulk_edit_commands_1.BulkEditCommands.DISCARD, {
|
|
57
|
+
isEnabled: widget => this.withWidget(widget, () => true),
|
|
58
|
+
isVisible: widget => this.withWidget(widget, () => true),
|
|
59
|
+
execute: widget => this.withWidget(widget, () => this.discard())
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async registerToolbarItems(toolbarRegistry) {
|
|
63
|
+
toolbarRegistry.registerItem({
|
|
64
|
+
id: bulk_edit_commands_1.BulkEditCommands.APPLY.id,
|
|
65
|
+
command: bulk_edit_commands_1.BulkEditCommands.APPLY.id,
|
|
66
|
+
tooltip: nls_1.nls.localizeByDefault('Apply Refactoring'),
|
|
67
|
+
priority: 0,
|
|
68
|
+
});
|
|
69
|
+
toolbarRegistry.registerItem({
|
|
70
|
+
id: bulk_edit_commands_1.BulkEditCommands.DISCARD.id,
|
|
71
|
+
command: bulk_edit_commands_1.BulkEditCommands.DISCARD.id,
|
|
72
|
+
tooltip: nls_1.nls.localizeByDefault('Discard Refactoring'),
|
|
73
|
+
priority: 1,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
withWidget(widget = this.tryGetWidget(), cb) {
|
|
77
|
+
if (widget instanceof bulk_edit_tree_1.BulkEditTreeWidget) {
|
|
78
|
+
return cb(widget);
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
async previewEdit(edits) {
|
|
83
|
+
const widget = await this.openView({ activate: true });
|
|
84
|
+
if (widget) {
|
|
85
|
+
this.edits = edits;
|
|
86
|
+
await widget.initModel(edits);
|
|
87
|
+
}
|
|
88
|
+
return edits;
|
|
89
|
+
}
|
|
90
|
+
apply() {
|
|
91
|
+
if (this.edits) {
|
|
92
|
+
this.edits.forEach(edit => {
|
|
93
|
+
if (edit.metadata) {
|
|
94
|
+
edit.metadata.needsConfirmation = false;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
this.bulkEditService.apply(this.edits);
|
|
98
|
+
}
|
|
99
|
+
this.closeView();
|
|
100
|
+
}
|
|
101
|
+
discard() {
|
|
102
|
+
this.edits = [];
|
|
103
|
+
this.closeView();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, inversify_1.inject)(browser_1.QuickViewService),
|
|
108
|
+
(0, inversify_1.optional)(),
|
|
109
|
+
__metadata("design:type", browser_1.QuickViewService)
|
|
110
|
+
], BulkEditContribution.prototype, "quickView", void 0);
|
|
111
|
+
BulkEditContribution = __decorate([
|
|
112
|
+
(0, inversify_1.injectable)(),
|
|
113
|
+
__metadata("design:paramtypes", [monaco_bulk_edit_service_1.MonacoBulkEditService])
|
|
114
|
+
], BulkEditContribution);
|
|
115
|
+
exports.BulkEditContribution = BulkEditContribution;
|
|
116
116
|
//# sourceMappingURL=bulk-edit-contribution.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
2
|
-
import '../../src/browser/style/bulk-edit.css';
|
|
3
|
-
declare const _default: ContainerModule;
|
|
4
|
-
export default _default;
|
|
1
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
2
|
+
import '../../src/browser/style/bulk-edit.css';
|
|
3
|
+
declare const _default: ContainerModule;
|
|
4
|
+
export default _default;
|
|
5
5
|
//# sourceMappingURL=bulk-edit-frontend-module.d.ts.map
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// *****************************************************************************
|
|
4
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
5
|
-
//
|
|
6
|
-
// This program and the accompanying materials are made available under the
|
|
7
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
-
//
|
|
10
|
-
// This Source Code may also be made available under the following Secondary
|
|
11
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
-
// with the GNU Classpath Exception which is available at
|
|
14
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
15
|
-
//
|
|
16
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
17
|
-
// *****************************************************************************
|
|
18
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
-
const widget_manager_1 = require("@theia/core/lib/browser/widget-manager");
|
|
20
|
-
const bulk_edit_tree_1 = require("./bulk-edit-tree");
|
|
21
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
-
const bulk_edit_contribution_1 = require("./bulk-edit-contribution");
|
|
23
|
-
const tab_bar_toolbar_1 = require("@theia/core/lib/browser/shell/tab-bar-toolbar");
|
|
24
|
-
const bulk_edit_tree_label_provider_1 = require("./bulk-edit-tree-label-provider");
|
|
25
|
-
require("../../src/browser/style/bulk-edit.css");
|
|
26
|
-
exports.default = new inversify_1.ContainerModule(bind => {
|
|
27
|
-
bind(bulk_edit_tree_1.BulkEditTreeWidget).toDynamicValue(ctx => (0, bulk_edit_tree_1.createBulkEditTreeWidget)(ctx.container));
|
|
28
|
-
bind(widget_manager_1.WidgetFactory).toDynamicValue(context => ({
|
|
29
|
-
id: bulk_edit_tree_1.BULK_EDIT_TREE_WIDGET_ID,
|
|
30
|
-
createWidget: () => context.container.get(bulk_edit_tree_1.BulkEditTreeWidget)
|
|
31
|
-
}));
|
|
32
|
-
(0, browser_1.bindViewContribution)(bind, bulk_edit_contribution_1.BulkEditContribution);
|
|
33
|
-
bind(browser_1.FrontendApplicationContribution).toService(bulk_edit_contribution_1.BulkEditContribution);
|
|
34
|
-
bind(tab_bar_toolbar_1.TabBarToolbarContribution).toService(bulk_edit_contribution_1.BulkEditContribution);
|
|
35
|
-
bind(bulk_edit_tree_label_provider_1.BulkEditTreeLabelProvider).toSelf().inSingletonScope();
|
|
36
|
-
bind(browser_1.LabelProviderContribution).toService(bulk_edit_tree_label_provider_1.BulkEditTreeLabelProvider);
|
|
37
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// *****************************************************************************
|
|
4
|
+
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
5
|
+
//
|
|
6
|
+
// This program and the accompanying materials are made available under the
|
|
7
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
+
//
|
|
10
|
+
// This Source Code may also be made available under the following Secondary
|
|
11
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
+
// with the GNU Classpath Exception which is available at
|
|
14
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
15
|
+
//
|
|
16
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
17
|
+
// *****************************************************************************
|
|
18
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
+
const widget_manager_1 = require("@theia/core/lib/browser/widget-manager");
|
|
20
|
+
const bulk_edit_tree_1 = require("./bulk-edit-tree");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const bulk_edit_contribution_1 = require("./bulk-edit-contribution");
|
|
23
|
+
const tab_bar_toolbar_1 = require("@theia/core/lib/browser/shell/tab-bar-toolbar");
|
|
24
|
+
const bulk_edit_tree_label_provider_1 = require("./bulk-edit-tree-label-provider");
|
|
25
|
+
require("../../src/browser/style/bulk-edit.css");
|
|
26
|
+
exports.default = new inversify_1.ContainerModule(bind => {
|
|
27
|
+
bind(bulk_edit_tree_1.BulkEditTreeWidget).toDynamicValue(ctx => (0, bulk_edit_tree_1.createBulkEditTreeWidget)(ctx.container));
|
|
28
|
+
bind(widget_manager_1.WidgetFactory).toDynamicValue(context => ({
|
|
29
|
+
id: bulk_edit_tree_1.BULK_EDIT_TREE_WIDGET_ID,
|
|
30
|
+
createWidget: () => context.container.get(bulk_edit_tree_1.BulkEditTreeWidget)
|
|
31
|
+
}));
|
|
32
|
+
(0, browser_1.bindViewContribution)(bind, bulk_edit_contribution_1.BulkEditContribution);
|
|
33
|
+
bind(browser_1.FrontendApplicationContribution).toService(bulk_edit_contribution_1.BulkEditContribution);
|
|
34
|
+
bind(tab_bar_toolbar_1.TabBarToolbarContribution).toService(bulk_edit_contribution_1.BulkEditContribution);
|
|
35
|
+
bind(bulk_edit_tree_label_provider_1.BulkEditTreeLabelProvider).toSelf().inSingletonScope();
|
|
36
|
+
bind(browser_1.LabelProviderContribution).toService(bulk_edit_tree_label_provider_1.BulkEditTreeLabelProvider);
|
|
37
|
+
});
|
|
38
38
|
//# sourceMappingURL=bulk-edit-frontend-module.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { SelectionService } from '@theia/core/lib/common/selection-service';
|
|
2
|
-
import { SelectionCommandHandler } from '@theia/core/lib/common/selection-command-handler';
|
|
3
|
-
import { ResourceFileEdit, ResourceTextEdit } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/bulkEditService';
|
|
4
|
-
export interface BulkEditNodeSelection {
|
|
5
|
-
bulkEdit: ResourceFileEdit | ResourceTextEdit;
|
|
6
|
-
}
|
|
7
|
-
export declare namespace BulkEditNodeSelection {
|
|
8
|
-
function is(arg: unknown): arg is BulkEditNodeSelection;
|
|
9
|
-
class CommandHandler extends SelectionCommandHandler<BulkEditNodeSelection> {
|
|
10
|
-
protected readonly selectionService: SelectionService;
|
|
11
|
-
protected readonly options: SelectionCommandHandler.Options<BulkEditNodeSelection>;
|
|
12
|
-
constructor(selectionService: SelectionService, options: SelectionCommandHandler.Options<BulkEditNodeSelection>);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
1
|
+
import { SelectionService } from '@theia/core/lib/common/selection-service';
|
|
2
|
+
import { SelectionCommandHandler } from '@theia/core/lib/common/selection-command-handler';
|
|
3
|
+
import { ResourceFileEdit, ResourceTextEdit } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/bulkEditService';
|
|
4
|
+
export interface BulkEditNodeSelection {
|
|
5
|
+
bulkEdit: ResourceFileEdit | ResourceTextEdit;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace BulkEditNodeSelection {
|
|
8
|
+
function is(arg: unknown): arg is BulkEditNodeSelection;
|
|
9
|
+
class CommandHandler extends SelectionCommandHandler<BulkEditNodeSelection> {
|
|
10
|
+
protected readonly selectionService: SelectionService;
|
|
11
|
+
protected readonly options: SelectionCommandHandler.Options<BulkEditNodeSelection>;
|
|
12
|
+
constructor(selectionService: SelectionService, options: SelectionCommandHandler.Options<BulkEditNodeSelection>);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
15
|
//# sourceMappingURL=bulk-edit-node-selection.d.ts.map
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company 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.BulkEditNodeSelection = void 0;
|
|
19
|
-
const selection_command_handler_1 = require("@theia/core/lib/common/selection-command-handler");
|
|
20
|
-
const common_1 = require("@theia/core/lib/common");
|
|
21
|
-
var BulkEditNodeSelection;
|
|
22
|
-
(function (BulkEditNodeSelection) {
|
|
23
|
-
function is(arg) {
|
|
24
|
-
return (0, common_1.isObject)(arg) && 'bulkEdit' in arg;
|
|
25
|
-
}
|
|
26
|
-
BulkEditNodeSelection.is = is;
|
|
27
|
-
class CommandHandler extends selection_command_handler_1.SelectionCommandHandler {
|
|
28
|
-
constructor(selectionService, options) {
|
|
29
|
-
super(selectionService, arg => BulkEditNodeSelection.is(arg) ? arg : undefined, options);
|
|
30
|
-
this.selectionService = selectionService;
|
|
31
|
-
this.options = options;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
BulkEditNodeSelection.CommandHandler = CommandHandler;
|
|
35
|
-
})(BulkEditNodeSelection = exports.BulkEditNodeSelection || (exports.BulkEditNodeSelection = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 SAP SE or an SAP affiliate company 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.BulkEditNodeSelection = void 0;
|
|
19
|
+
const selection_command_handler_1 = require("@theia/core/lib/common/selection-command-handler");
|
|
20
|
+
const common_1 = require("@theia/core/lib/common");
|
|
21
|
+
var BulkEditNodeSelection;
|
|
22
|
+
(function (BulkEditNodeSelection) {
|
|
23
|
+
function is(arg) {
|
|
24
|
+
return (0, common_1.isObject)(arg) && 'bulkEdit' in arg;
|
|
25
|
+
}
|
|
26
|
+
BulkEditNodeSelection.is = is;
|
|
27
|
+
class CommandHandler extends selection_command_handler_1.SelectionCommandHandler {
|
|
28
|
+
constructor(selectionService, options) {
|
|
29
|
+
super(selectionService, arg => BulkEditNodeSelection.is(arg) ? arg : undefined, options);
|
|
30
|
+
this.selectionService = selectionService;
|
|
31
|
+
this.options = options;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
BulkEditNodeSelection.CommandHandler = CommandHandler;
|
|
35
|
+
})(BulkEditNodeSelection = exports.BulkEditNodeSelection || (exports.BulkEditNodeSelection = {}));
|
|
36
36
|
//# sourceMappingURL=bulk-edit-node-selection.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { interfaces, Container } from '@theia/core/shared/inversify';
|
|
2
|
-
import { BulkEditTreeWidget } from './bulk-edit-tree-widget';
|
|
3
|
-
export declare function createBulkEditContainer(parent: interfaces.Container): Container;
|
|
4
|
-
export declare function createBulkEditTreeWidget(parent: interfaces.Container): BulkEditTreeWidget;
|
|
1
|
+
import { interfaces, Container } from '@theia/core/shared/inversify';
|
|
2
|
+
import { BulkEditTreeWidget } from './bulk-edit-tree-widget';
|
|
3
|
+
export declare function createBulkEditContainer(parent: interfaces.Container): Container;
|
|
4
|
+
export declare function createBulkEditTreeWidget(parent: interfaces.Container): BulkEditTreeWidget;
|
|
5
5
|
//# sourceMappingURL=bulk-edit-tree-container.d.ts.map
|