@theia/outline-view 1.34.2 → 1.34.3
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/LICENSE +641 -641
- package/README.md +30 -30
- package/lib/browser/index.d.ts +2 -2
- package/lib/browser/index.js +29 -29
- package/lib/browser/outline-breadcrumbs-contribution.d.ts +57 -57
- package/lib/browser/outline-breadcrumbs-contribution.js +222 -222
- package/lib/browser/outline-decorator-service.d.ts +13 -13
- package/lib/browser/outline-decorator-service.js +53 -53
- package/lib/browser/outline-view-contribution.d.ts +31 -31
- package/lib/browser/outline-view-contribution.js +108 -108
- package/lib/browser/outline-view-frontend-module.d.ts +4 -4
- package/lib/browser/outline-view-frontend-module.js +68 -68
- package/lib/browser/outline-view-service.d.ts +26 -26
- package/lib/browser/outline-view-service.js +89 -89
- package/lib/browser/outline-view-tree-model.d.ts +17 -17
- package/lib/browser/outline-view-tree-model.js +59 -59
- package/lib/browser/outline-view-widget.d.ts +73 -73
- package/lib/browser/outline-view-widget.js +180 -180
- package/lib/package.spec.js +25 -25
- package/package.json +4 -4
- package/src/browser/index.ts +18 -18
- package/src/browser/outline-breadcrumbs-contribution.tsx +229 -229
- package/src/browser/outline-decorator-service.ts +36 -36
- package/src/browser/outline-view-contribution.ts +104 -104
- package/src/browser/outline-view-frontend-module.ts +84 -84
- package/src/browser/outline-view-service.ts +82 -82
- package/src/browser/outline-view-tree-model.ts +52 -52
- package/src/browser/outline-view-widget.tsx +203 -203
- package/src/browser/styles/index.css +24 -24
- package/src/package.spec.ts +28 -28
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017 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 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.OutlineViewContribution = exports.OutlineViewCommands = exports.OUTLINE_WIDGET_FACTORY_ID = 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 widgets_1 = require("@theia/core/lib/browser/widgets");
|
|
31
|
-
const outline_view_widget_1 = require("./outline-view-widget");
|
|
32
|
-
const tree_1 = require("@theia/core/lib/browser/tree");
|
|
33
|
-
const os_1 = require("@theia/core/lib/common/os");
|
|
34
|
-
const nls_1 = require("@theia/core/lib/common/nls");
|
|
35
|
-
exports.OUTLINE_WIDGET_FACTORY_ID = 'outline-view';
|
|
36
|
-
/**
|
|
37
|
-
* Collection of `outline-view` commands.
|
|
38
|
-
*/
|
|
39
|
-
var OutlineViewCommands;
|
|
40
|
-
(function (OutlineViewCommands) {
|
|
41
|
-
/**
|
|
42
|
-
* Command which collapses all nodes
|
|
43
|
-
* from the `outline-view` tree.
|
|
44
|
-
*/
|
|
45
|
-
OutlineViewCommands.COLLAPSE_ALL = {
|
|
46
|
-
id: 'outlineView.collapse.all',
|
|
47
|
-
iconClass: (0, widgets_1.codicon)('collapse-all')
|
|
48
|
-
};
|
|
49
|
-
})(OutlineViewCommands = exports.OutlineViewCommands || (exports.OutlineViewCommands = {}));
|
|
50
|
-
let OutlineViewContribution = class OutlineViewContribution extends view_contribution_1.AbstractViewContribution {
|
|
51
|
-
constructor() {
|
|
52
|
-
super({
|
|
53
|
-
widgetId: exports.OUTLINE_WIDGET_FACTORY_ID,
|
|
54
|
-
widgetName: outline_view_widget_1.OutlineViewWidget.LABEL,
|
|
55
|
-
defaultWidgetOptions: {
|
|
56
|
-
area: 'right',
|
|
57
|
-
rank: 500
|
|
58
|
-
},
|
|
59
|
-
toggleCommandId: 'outlineView:toggle',
|
|
60
|
-
toggleKeybinding: os_1.OS.type() !== os_1.OS.Type.Linux
|
|
61
|
-
? 'ctrlcmd+shift+i'
|
|
62
|
-
: undefined
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
async initializeLayout(app) {
|
|
66
|
-
await this.openView();
|
|
67
|
-
}
|
|
68
|
-
registerCommands(commands) {
|
|
69
|
-
super.registerCommands(commands);
|
|
70
|
-
commands.registerCommand(OutlineViewCommands.COLLAPSE_ALL, {
|
|
71
|
-
isEnabled: widget => this.withWidget(widget, () => true),
|
|
72
|
-
isVisible: widget => this.withWidget(widget, () => true),
|
|
73
|
-
execute: () => this.collapseAllItems()
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
registerToolbarItems(toolbar) {
|
|
77
|
-
toolbar.registerItem({
|
|
78
|
-
id: OutlineViewCommands.COLLAPSE_ALL.id,
|
|
79
|
-
command: OutlineViewCommands.COLLAPSE_ALL.id,
|
|
80
|
-
tooltip: nls_1.nls.localizeByDefault('Collapse All'),
|
|
81
|
-
priority: 0
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Collapse all nodes in the outline view tree.
|
|
86
|
-
*/
|
|
87
|
-
async collapseAllItems() {
|
|
88
|
-
const { model } = await this.widget;
|
|
89
|
-
const root = model.root;
|
|
90
|
-
if (tree_1.CompositeTreeNode.is(root)) {
|
|
91
|
-
model.collapseAll(root);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Determine if the current widget is the `outline-view`.
|
|
96
|
-
*/
|
|
97
|
-
withWidget(widget = this.tryGetWidget(), cb) {
|
|
98
|
-
if (widget instanceof outline_view_widget_1.OutlineViewWidget && widget.id === exports.OUTLINE_WIDGET_FACTORY_ID) {
|
|
99
|
-
return cb(widget);
|
|
100
|
-
}
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
OutlineViewContribution = __decorate([
|
|
105
|
-
(0, inversify_1.injectable)(),
|
|
106
|
-
__metadata("design:paramtypes", [])
|
|
107
|
-
], OutlineViewContribution);
|
|
108
|
-
exports.OutlineViewContribution = OutlineViewContribution;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2017 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 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.OutlineViewContribution = exports.OutlineViewCommands = exports.OUTLINE_WIDGET_FACTORY_ID = 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 widgets_1 = require("@theia/core/lib/browser/widgets");
|
|
31
|
+
const outline_view_widget_1 = require("./outline-view-widget");
|
|
32
|
+
const tree_1 = require("@theia/core/lib/browser/tree");
|
|
33
|
+
const os_1 = require("@theia/core/lib/common/os");
|
|
34
|
+
const nls_1 = require("@theia/core/lib/common/nls");
|
|
35
|
+
exports.OUTLINE_WIDGET_FACTORY_ID = 'outline-view';
|
|
36
|
+
/**
|
|
37
|
+
* Collection of `outline-view` commands.
|
|
38
|
+
*/
|
|
39
|
+
var OutlineViewCommands;
|
|
40
|
+
(function (OutlineViewCommands) {
|
|
41
|
+
/**
|
|
42
|
+
* Command which collapses all nodes
|
|
43
|
+
* from the `outline-view` tree.
|
|
44
|
+
*/
|
|
45
|
+
OutlineViewCommands.COLLAPSE_ALL = {
|
|
46
|
+
id: 'outlineView.collapse.all',
|
|
47
|
+
iconClass: (0, widgets_1.codicon)('collapse-all')
|
|
48
|
+
};
|
|
49
|
+
})(OutlineViewCommands = exports.OutlineViewCommands || (exports.OutlineViewCommands = {}));
|
|
50
|
+
let OutlineViewContribution = class OutlineViewContribution extends view_contribution_1.AbstractViewContribution {
|
|
51
|
+
constructor() {
|
|
52
|
+
super({
|
|
53
|
+
widgetId: exports.OUTLINE_WIDGET_FACTORY_ID,
|
|
54
|
+
widgetName: outline_view_widget_1.OutlineViewWidget.LABEL,
|
|
55
|
+
defaultWidgetOptions: {
|
|
56
|
+
area: 'right',
|
|
57
|
+
rank: 500
|
|
58
|
+
},
|
|
59
|
+
toggleCommandId: 'outlineView:toggle',
|
|
60
|
+
toggleKeybinding: os_1.OS.type() !== os_1.OS.Type.Linux
|
|
61
|
+
? 'ctrlcmd+shift+i'
|
|
62
|
+
: undefined
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
async initializeLayout(app) {
|
|
66
|
+
await this.openView();
|
|
67
|
+
}
|
|
68
|
+
registerCommands(commands) {
|
|
69
|
+
super.registerCommands(commands);
|
|
70
|
+
commands.registerCommand(OutlineViewCommands.COLLAPSE_ALL, {
|
|
71
|
+
isEnabled: widget => this.withWidget(widget, () => true),
|
|
72
|
+
isVisible: widget => this.withWidget(widget, () => true),
|
|
73
|
+
execute: () => this.collapseAllItems()
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
registerToolbarItems(toolbar) {
|
|
77
|
+
toolbar.registerItem({
|
|
78
|
+
id: OutlineViewCommands.COLLAPSE_ALL.id,
|
|
79
|
+
command: OutlineViewCommands.COLLAPSE_ALL.id,
|
|
80
|
+
tooltip: nls_1.nls.localizeByDefault('Collapse All'),
|
|
81
|
+
priority: 0
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Collapse all nodes in the outline view tree.
|
|
86
|
+
*/
|
|
87
|
+
async collapseAllItems() {
|
|
88
|
+
const { model } = await this.widget;
|
|
89
|
+
const root = model.root;
|
|
90
|
+
if (tree_1.CompositeTreeNode.is(root)) {
|
|
91
|
+
model.collapseAll(root);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Determine if the current widget is the `outline-view`.
|
|
96
|
+
*/
|
|
97
|
+
withWidget(widget = this.tryGetWidget(), cb) {
|
|
98
|
+
if (widget instanceof outline_view_widget_1.OutlineViewWidget && widget.id === exports.OUTLINE_WIDGET_FACTORY_ID) {
|
|
99
|
+
return cb(widget);
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
OutlineViewContribution = __decorate([
|
|
105
|
+
(0, inversify_1.injectable)(),
|
|
106
|
+
__metadata("design:paramtypes", [])
|
|
107
|
+
], OutlineViewContribution);
|
|
108
|
+
exports.OutlineViewContribution = OutlineViewContribution;
|
|
109
109
|
//# sourceMappingURL=outline-view-contribution.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
2
|
-
import '../../src/browser/styles/index.css';
|
|
3
|
-
declare const _default: ContainerModule;
|
|
4
|
-
export default _default;
|
|
1
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
2
|
+
import '../../src/browser/styles/index.css';
|
|
3
|
+
declare const _default: ContainerModule;
|
|
4
|
+
export default _default;
|
|
5
5
|
//# sourceMappingURL=outline-view-frontend-module.d.ts.map
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017 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 WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
-
const outline_view_service_1 = require("./outline-view-service");
|
|
20
|
-
const outline_view_contribution_1 = require("./outline-view-contribution");
|
|
21
|
-
const widget_manager_1 = require("@theia/core/lib/browser/widget-manager");
|
|
22
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
23
|
-
const tab_bar_toolbar_1 = require("@theia/core/lib/browser/shell/tab-bar-toolbar");
|
|
24
|
-
const outline_view_widget_1 = require("./outline-view-widget");
|
|
25
|
-
require("../../src/browser/styles/index.css");
|
|
26
|
-
const contribution_provider_1 = require("@theia/core/lib/common/contribution-provider");
|
|
27
|
-
const outline_decorator_service_1 = require("./outline-decorator-service");
|
|
28
|
-
const outline_view_tree_model_1 = require("./outline-view-tree-model");
|
|
29
|
-
const outline_breadcrumbs_contribution_1 = require("./outline-breadcrumbs-contribution");
|
|
30
|
-
exports.default = new inversify_1.ContainerModule(bind => {
|
|
31
|
-
bind(outline_view_widget_1.OutlineViewWidgetFactory).toFactory(ctx => () => createOutlineViewWidget(ctx.container));
|
|
32
|
-
bind(outline_breadcrumbs_contribution_1.BreadcrumbPopupOutlineViewFactory).toFactory(({ container }) => () => {
|
|
33
|
-
const child = createOutlineViewWidgetContainer(container);
|
|
34
|
-
child.rebind(outline_view_widget_1.OutlineViewWidget).to(outline_breadcrumbs_contribution_1.BreadcrumbPopupOutlineView);
|
|
35
|
-
child.rebind(browser_1.TreeProps).toConstantValue(Object.assign(Object.assign({}, browser_1.defaultTreeProps), { expandOnlyOnExpansionToggleClick: true, search: false, virtualized: false }));
|
|
36
|
-
return child.get(outline_view_widget_1.OutlineViewWidget);
|
|
37
|
-
});
|
|
38
|
-
bind(outline_view_service_1.OutlineViewService).toSelf().inSingletonScope();
|
|
39
|
-
bind(widget_manager_1.WidgetFactory).toService(outline_view_service_1.OutlineViewService);
|
|
40
|
-
(0, browser_1.bindViewContribution)(bind, outline_view_contribution_1.OutlineViewContribution);
|
|
41
|
-
bind(browser_1.FrontendApplicationContribution).toService(outline_view_contribution_1.OutlineViewContribution);
|
|
42
|
-
bind(tab_bar_toolbar_1.TabBarToolbarContribution).toService(outline_view_contribution_1.OutlineViewContribution);
|
|
43
|
-
bind(outline_breadcrumbs_contribution_1.OutlineBreadcrumbsContribution).toSelf().inSingletonScope();
|
|
44
|
-
bind(browser_1.BreadcrumbsContribution).toService(outline_breadcrumbs_contribution_1.OutlineBreadcrumbsContribution);
|
|
45
|
-
});
|
|
46
|
-
function createOutlineViewWidgetContainer(parent) {
|
|
47
|
-
const child = (0, browser_1.createTreeContainer)(parent, {
|
|
48
|
-
props: { expandOnlyOnExpansionToggleClick: true, search: true },
|
|
49
|
-
widget: outline_view_widget_1.OutlineViewWidget,
|
|
50
|
-
model: outline_view_tree_model_1.OutlineViewTreeModel,
|
|
51
|
-
decoratorService: outline_decorator_service_1.OutlineDecoratorService,
|
|
52
|
-
});
|
|
53
|
-
(0, contribution_provider_1.bindContributionProvider)(child, outline_decorator_service_1.OutlineTreeDecorator);
|
|
54
|
-
return child;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Create an `OutlineViewWidget`.
|
|
58
|
-
* - The creation of the `OutlineViewWidget` includes:
|
|
59
|
-
* - The creation of the tree widget itself with it's own customized props.
|
|
60
|
-
* - The binding of necessary components into the container.
|
|
61
|
-
* @param parent the Inversify container.
|
|
62
|
-
*
|
|
63
|
-
* @returns the `OutlineViewWidget`.
|
|
64
|
-
*/
|
|
65
|
-
function createOutlineViewWidget(parent) {
|
|
66
|
-
const child = createOutlineViewWidgetContainer(parent);
|
|
67
|
-
return child.get(outline_view_widget_1.OutlineViewWidget);
|
|
68
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2017 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 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
+
const outline_view_service_1 = require("./outline-view-service");
|
|
20
|
+
const outline_view_contribution_1 = require("./outline-view-contribution");
|
|
21
|
+
const widget_manager_1 = require("@theia/core/lib/browser/widget-manager");
|
|
22
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
23
|
+
const tab_bar_toolbar_1 = require("@theia/core/lib/browser/shell/tab-bar-toolbar");
|
|
24
|
+
const outline_view_widget_1 = require("./outline-view-widget");
|
|
25
|
+
require("../../src/browser/styles/index.css");
|
|
26
|
+
const contribution_provider_1 = require("@theia/core/lib/common/contribution-provider");
|
|
27
|
+
const outline_decorator_service_1 = require("./outline-decorator-service");
|
|
28
|
+
const outline_view_tree_model_1 = require("./outline-view-tree-model");
|
|
29
|
+
const outline_breadcrumbs_contribution_1 = require("./outline-breadcrumbs-contribution");
|
|
30
|
+
exports.default = new inversify_1.ContainerModule(bind => {
|
|
31
|
+
bind(outline_view_widget_1.OutlineViewWidgetFactory).toFactory(ctx => () => createOutlineViewWidget(ctx.container));
|
|
32
|
+
bind(outline_breadcrumbs_contribution_1.BreadcrumbPopupOutlineViewFactory).toFactory(({ container }) => () => {
|
|
33
|
+
const child = createOutlineViewWidgetContainer(container);
|
|
34
|
+
child.rebind(outline_view_widget_1.OutlineViewWidget).to(outline_breadcrumbs_contribution_1.BreadcrumbPopupOutlineView);
|
|
35
|
+
child.rebind(browser_1.TreeProps).toConstantValue(Object.assign(Object.assign({}, browser_1.defaultTreeProps), { expandOnlyOnExpansionToggleClick: true, search: false, virtualized: false }));
|
|
36
|
+
return child.get(outline_view_widget_1.OutlineViewWidget);
|
|
37
|
+
});
|
|
38
|
+
bind(outline_view_service_1.OutlineViewService).toSelf().inSingletonScope();
|
|
39
|
+
bind(widget_manager_1.WidgetFactory).toService(outline_view_service_1.OutlineViewService);
|
|
40
|
+
(0, browser_1.bindViewContribution)(bind, outline_view_contribution_1.OutlineViewContribution);
|
|
41
|
+
bind(browser_1.FrontendApplicationContribution).toService(outline_view_contribution_1.OutlineViewContribution);
|
|
42
|
+
bind(tab_bar_toolbar_1.TabBarToolbarContribution).toService(outline_view_contribution_1.OutlineViewContribution);
|
|
43
|
+
bind(outline_breadcrumbs_contribution_1.OutlineBreadcrumbsContribution).toSelf().inSingletonScope();
|
|
44
|
+
bind(browser_1.BreadcrumbsContribution).toService(outline_breadcrumbs_contribution_1.OutlineBreadcrumbsContribution);
|
|
45
|
+
});
|
|
46
|
+
function createOutlineViewWidgetContainer(parent) {
|
|
47
|
+
const child = (0, browser_1.createTreeContainer)(parent, {
|
|
48
|
+
props: { expandOnlyOnExpansionToggleClick: true, search: true },
|
|
49
|
+
widget: outline_view_widget_1.OutlineViewWidget,
|
|
50
|
+
model: outline_view_tree_model_1.OutlineViewTreeModel,
|
|
51
|
+
decoratorService: outline_decorator_service_1.OutlineDecoratorService,
|
|
52
|
+
});
|
|
53
|
+
(0, contribution_provider_1.bindContributionProvider)(child, outline_decorator_service_1.OutlineTreeDecorator);
|
|
54
|
+
return child;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Create an `OutlineViewWidget`.
|
|
58
|
+
* - The creation of the `OutlineViewWidget` includes:
|
|
59
|
+
* - The creation of the tree widget itself with it's own customized props.
|
|
60
|
+
* - The binding of necessary components into the container.
|
|
61
|
+
* @param parent the Inversify container.
|
|
62
|
+
*
|
|
63
|
+
* @returns the `OutlineViewWidget`.
|
|
64
|
+
*/
|
|
65
|
+
function createOutlineViewWidget(parent) {
|
|
66
|
+
const child = createOutlineViewWidgetContainer(parent);
|
|
67
|
+
return child.get(outline_view_widget_1.OutlineViewWidget);
|
|
68
|
+
}
|
|
69
69
|
//# sourceMappingURL=outline-view-frontend-module.js.map
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { Event, Emitter } from '@theia/core';
|
|
2
|
-
import { WidgetFactory } from '@theia/core/lib/browser';
|
|
3
|
-
import { OutlineViewWidget, OutlineViewWidgetFactory, OutlineSymbolInformationNode } from './outline-view-widget';
|
|
4
|
-
import { Widget } from '@theia/core/shared/@phosphor/widgets';
|
|
5
|
-
export declare class OutlineViewService implements WidgetFactory {
|
|
6
|
-
protected factory: OutlineViewWidgetFactory;
|
|
7
|
-
id: string;
|
|
8
|
-
protected widget?: OutlineViewWidget;
|
|
9
|
-
protected readonly onDidChangeOutlineEmitter: Emitter<OutlineSymbolInformationNode[]>;
|
|
10
|
-
protected readonly onDidChangeOpenStateEmitter: Emitter<boolean>;
|
|
11
|
-
protected readonly onDidSelectEmitter: Emitter<OutlineSymbolInformationNode>;
|
|
12
|
-
protected readonly onDidOpenEmitter: Emitter<OutlineSymbolInformationNode>;
|
|
13
|
-
constructor(factory: OutlineViewWidgetFactory);
|
|
14
|
-
get onDidSelect(): Event<OutlineSymbolInformationNode>;
|
|
15
|
-
get onDidOpen(): Event<OutlineSymbolInformationNode>;
|
|
16
|
-
get onDidChangeOutline(): Event<OutlineSymbolInformationNode[]>;
|
|
17
|
-
get onDidChangeOpenState(): Event<boolean>;
|
|
18
|
-
get open(): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Publish the collection of outline view symbols.
|
|
21
|
-
* - Publishing includes setting the `OutlineViewWidget` tree with symbol information.
|
|
22
|
-
* @param roots the list of outline symbol information nodes.
|
|
23
|
-
*/
|
|
24
|
-
publish(roots: OutlineSymbolInformationNode[]): void;
|
|
25
|
-
createWidget(): Promise<Widget>;
|
|
26
|
-
}
|
|
1
|
+
import { Event, Emitter } from '@theia/core';
|
|
2
|
+
import { WidgetFactory } from '@theia/core/lib/browser';
|
|
3
|
+
import { OutlineViewWidget, OutlineViewWidgetFactory, OutlineSymbolInformationNode } from './outline-view-widget';
|
|
4
|
+
import { Widget } from '@theia/core/shared/@phosphor/widgets';
|
|
5
|
+
export declare class OutlineViewService implements WidgetFactory {
|
|
6
|
+
protected factory: OutlineViewWidgetFactory;
|
|
7
|
+
id: string;
|
|
8
|
+
protected widget?: OutlineViewWidget;
|
|
9
|
+
protected readonly onDidChangeOutlineEmitter: Emitter<OutlineSymbolInformationNode[]>;
|
|
10
|
+
protected readonly onDidChangeOpenStateEmitter: Emitter<boolean>;
|
|
11
|
+
protected readonly onDidSelectEmitter: Emitter<OutlineSymbolInformationNode>;
|
|
12
|
+
protected readonly onDidOpenEmitter: Emitter<OutlineSymbolInformationNode>;
|
|
13
|
+
constructor(factory: OutlineViewWidgetFactory);
|
|
14
|
+
get onDidSelect(): Event<OutlineSymbolInformationNode>;
|
|
15
|
+
get onDidOpen(): Event<OutlineSymbolInformationNode>;
|
|
16
|
+
get onDidChangeOutline(): Event<OutlineSymbolInformationNode[]>;
|
|
17
|
+
get onDidChangeOpenState(): Event<boolean>;
|
|
18
|
+
get open(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Publish the collection of outline view symbols.
|
|
21
|
+
* - Publishing includes setting the `OutlineViewWidget` tree with symbol information.
|
|
22
|
+
* @param roots the list of outline symbol information nodes.
|
|
23
|
+
*/
|
|
24
|
+
publish(roots: OutlineSymbolInformationNode[]): void;
|
|
25
|
+
createWidget(): Promise<Widget>;
|
|
26
|
+
}
|
|
27
27
|
//# sourceMappingURL=outline-view-service.d.ts.map
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017 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 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
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.OutlineViewService = void 0;
|
|
31
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
32
|
-
const core_1 = require("@theia/core");
|
|
33
|
-
const outline_view_widget_1 = require("./outline-view-widget");
|
|
34
|
-
let OutlineViewService = class OutlineViewService {
|
|
35
|
-
constructor(factory) {
|
|
36
|
-
this.factory = factory;
|
|
37
|
-
this.id = 'outline-view';
|
|
38
|
-
this.onDidChangeOutlineEmitter = new core_1.Emitter();
|
|
39
|
-
this.onDidChangeOpenStateEmitter = new core_1.Emitter();
|
|
40
|
-
this.onDidSelectEmitter = new core_1.Emitter();
|
|
41
|
-
this.onDidOpenEmitter = new core_1.Emitter();
|
|
42
|
-
}
|
|
43
|
-
get onDidSelect() {
|
|
44
|
-
return this.onDidSelectEmitter.event;
|
|
45
|
-
}
|
|
46
|
-
get onDidOpen() {
|
|
47
|
-
return this.onDidOpenEmitter.event;
|
|
48
|
-
}
|
|
49
|
-
get onDidChangeOutline() {
|
|
50
|
-
return this.onDidChangeOutlineEmitter.event;
|
|
51
|
-
}
|
|
52
|
-
get onDidChangeOpenState() {
|
|
53
|
-
return this.onDidChangeOpenStateEmitter.event;
|
|
54
|
-
}
|
|
55
|
-
get open() {
|
|
56
|
-
return this.widget !== undefined && this.widget.isVisible;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Publish the collection of outline view symbols.
|
|
60
|
-
* - Publishing includes setting the `OutlineViewWidget` tree with symbol information.
|
|
61
|
-
* @param roots the list of outline symbol information nodes.
|
|
62
|
-
*/
|
|
63
|
-
publish(roots) {
|
|
64
|
-
if (this.widget) {
|
|
65
|
-
this.widget.setOutlineTree(roots);
|
|
66
|
-
}
|
|
67
|
-
// onDidChangeOutline needs to be fired even when the outline view widget is closed
|
|
68
|
-
// in order to update breadcrumbs.
|
|
69
|
-
this.onDidChangeOutlineEmitter.fire(roots);
|
|
70
|
-
}
|
|
71
|
-
createWidget() {
|
|
72
|
-
this.widget = this.factory();
|
|
73
|
-
const disposables = new core_1.DisposableCollection();
|
|
74
|
-
disposables.push(this.widget.onDidChangeOpenStateEmitter.event(open => this.onDidChangeOpenStateEmitter.fire(open)));
|
|
75
|
-
disposables.push(this.widget.model.onOpenNode(node => this.onDidOpenEmitter.fire(node)));
|
|
76
|
-
disposables.push(this.widget.model.onSelectionChanged(selection => this.onDidSelectEmitter.fire(selection[0])));
|
|
77
|
-
this.widget.disposed.connect(() => {
|
|
78
|
-
this.widget = undefined;
|
|
79
|
-
disposables.dispose();
|
|
80
|
-
});
|
|
81
|
-
return Promise.resolve(this.widget);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
OutlineViewService = __decorate([
|
|
85
|
-
(0, inversify_1.injectable)(),
|
|
86
|
-
__param(0, (0, inversify_1.inject)(outline_view_widget_1.OutlineViewWidgetFactory)),
|
|
87
|
-
__metadata("design:paramtypes", [Function])
|
|
88
|
-
], OutlineViewService);
|
|
89
|
-
exports.OutlineViewService = OutlineViewService;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2017 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 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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.OutlineViewService = void 0;
|
|
31
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
32
|
+
const core_1 = require("@theia/core");
|
|
33
|
+
const outline_view_widget_1 = require("./outline-view-widget");
|
|
34
|
+
let OutlineViewService = class OutlineViewService {
|
|
35
|
+
constructor(factory) {
|
|
36
|
+
this.factory = factory;
|
|
37
|
+
this.id = 'outline-view';
|
|
38
|
+
this.onDidChangeOutlineEmitter = new core_1.Emitter();
|
|
39
|
+
this.onDidChangeOpenStateEmitter = new core_1.Emitter();
|
|
40
|
+
this.onDidSelectEmitter = new core_1.Emitter();
|
|
41
|
+
this.onDidOpenEmitter = new core_1.Emitter();
|
|
42
|
+
}
|
|
43
|
+
get onDidSelect() {
|
|
44
|
+
return this.onDidSelectEmitter.event;
|
|
45
|
+
}
|
|
46
|
+
get onDidOpen() {
|
|
47
|
+
return this.onDidOpenEmitter.event;
|
|
48
|
+
}
|
|
49
|
+
get onDidChangeOutline() {
|
|
50
|
+
return this.onDidChangeOutlineEmitter.event;
|
|
51
|
+
}
|
|
52
|
+
get onDidChangeOpenState() {
|
|
53
|
+
return this.onDidChangeOpenStateEmitter.event;
|
|
54
|
+
}
|
|
55
|
+
get open() {
|
|
56
|
+
return this.widget !== undefined && this.widget.isVisible;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Publish the collection of outline view symbols.
|
|
60
|
+
* - Publishing includes setting the `OutlineViewWidget` tree with symbol information.
|
|
61
|
+
* @param roots the list of outline symbol information nodes.
|
|
62
|
+
*/
|
|
63
|
+
publish(roots) {
|
|
64
|
+
if (this.widget) {
|
|
65
|
+
this.widget.setOutlineTree(roots);
|
|
66
|
+
}
|
|
67
|
+
// onDidChangeOutline needs to be fired even when the outline view widget is closed
|
|
68
|
+
// in order to update breadcrumbs.
|
|
69
|
+
this.onDidChangeOutlineEmitter.fire(roots);
|
|
70
|
+
}
|
|
71
|
+
createWidget() {
|
|
72
|
+
this.widget = this.factory();
|
|
73
|
+
const disposables = new core_1.DisposableCollection();
|
|
74
|
+
disposables.push(this.widget.onDidChangeOpenStateEmitter.event(open => this.onDidChangeOpenStateEmitter.fire(open)));
|
|
75
|
+
disposables.push(this.widget.model.onOpenNode(node => this.onDidOpenEmitter.fire(node)));
|
|
76
|
+
disposables.push(this.widget.model.onSelectionChanged(selection => this.onDidSelectEmitter.fire(selection[0])));
|
|
77
|
+
this.widget.disposed.connect(() => {
|
|
78
|
+
this.widget = undefined;
|
|
79
|
+
disposables.dispose();
|
|
80
|
+
});
|
|
81
|
+
return Promise.resolve(this.widget);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
OutlineViewService = __decorate([
|
|
85
|
+
(0, inversify_1.injectable)(),
|
|
86
|
+
__param(0, (0, inversify_1.inject)(outline_view_widget_1.OutlineViewWidgetFactory)),
|
|
87
|
+
__metadata("design:paramtypes", [Function])
|
|
88
|
+
], OutlineViewService);
|
|
89
|
+
exports.OutlineViewService = OutlineViewService;
|
|
90
90
|
//# sourceMappingURL=outline-view-service.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { CompositeTreeNode, TreeModelImpl, ExpandableTreeNode, TreeNode } from '@theia/core/lib/browser';
|
|
2
|
-
export declare class OutlineViewTreeModel extends TreeModelImpl {
|
|
3
|
-
/**
|
|
4
|
-
* Handle the expansion of the tree node.
|
|
5
|
-
* - The method is a no-op in order to preserve focus on the editor
|
|
6
|
-
* after attempting to perform a `collapse-all`.
|
|
7
|
-
* @param node the expandable tree node.
|
|
8
|
-
*/
|
|
9
|
-
protected handleExpansion(node: Readonly<ExpandableTreeNode>): void;
|
|
10
|
-
collapseAll(raw?: Readonly<CompositeTreeNode>): Promise<boolean>;
|
|
11
|
-
/**
|
|
12
|
-
* The default behavior of `openNode` calls `doOpenNode` which by default
|
|
13
|
-
* toggles the expansion of the node. Overriding to prevent expansion, but
|
|
14
|
-
* allow for the `onOpenNode` event to still fire on a double-click event.
|
|
15
|
-
*/
|
|
16
|
-
openNode(raw?: TreeNode | undefined): void;
|
|
17
|
-
}
|
|
1
|
+
import { CompositeTreeNode, TreeModelImpl, ExpandableTreeNode, TreeNode } from '@theia/core/lib/browser';
|
|
2
|
+
export declare class OutlineViewTreeModel extends TreeModelImpl {
|
|
3
|
+
/**
|
|
4
|
+
* Handle the expansion of the tree node.
|
|
5
|
+
* - The method is a no-op in order to preserve focus on the editor
|
|
6
|
+
* after attempting to perform a `collapse-all`.
|
|
7
|
+
* @param node the expandable tree node.
|
|
8
|
+
*/
|
|
9
|
+
protected handleExpansion(node: Readonly<ExpandableTreeNode>): void;
|
|
10
|
+
collapseAll(raw?: Readonly<CompositeTreeNode>): Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* The default behavior of `openNode` calls `doOpenNode` which by default
|
|
13
|
+
* toggles the expansion of the node. Overriding to prevent expansion, but
|
|
14
|
+
* allow for the `onOpenNode` event to still fire on a double-click event.
|
|
15
|
+
*/
|
|
16
|
+
openNode(raw?: TreeNode | undefined): void;
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=outline-view-tree-model.d.ts.map
|