@theia/outline-view 1.47.1 → 1.48.1

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.
Files changed (29) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/index.d.ts +2 -2
  3. package/lib/browser/index.js +20 -20
  4. package/lib/browser/outline-breadcrumbs-contribution.d.ts +57 -57
  5. package/lib/browser/outline-breadcrumbs-contribution.js +214 -214
  6. package/lib/browser/outline-decorator-service.d.ts +13 -13
  7. package/lib/browser/outline-decorator-service.js +42 -42
  8. package/lib/browser/outline-view-contribution.d.ts +36 -36
  9. package/lib/browser/outline-view-contribution.js +125 -125
  10. package/lib/browser/outline-view-frontend-module.d.ts +4 -4
  11. package/lib/browser/outline-view-frontend-module.js +68 -68
  12. package/lib/browser/outline-view-service.d.ts +26 -26
  13. package/lib/browser/outline-view-service.js +78 -78
  14. package/lib/browser/outline-view-tree-model.d.ts +19 -19
  15. package/lib/browser/outline-view-tree-model.js +76 -76
  16. package/lib/browser/outline-view-widget.d.ts +76 -76
  17. package/lib/browser/outline-view-widget.js +184 -184
  18. package/lib/package.spec.js +25 -25
  19. package/package.json +4 -4
  20. package/src/browser/index.ts +18 -18
  21. package/src/browser/outline-breadcrumbs-contribution.tsx +229 -229
  22. package/src/browser/outline-decorator-service.ts +36 -36
  23. package/src/browser/outline-view-contribution.ts +132 -132
  24. package/src/browser/outline-view-frontend-module.ts +84 -84
  25. package/src/browser/outline-view-service.ts +82 -82
  26. package/src/browser/outline-view-tree-model.ts +77 -77
  27. package/src/browser/outline-view-widget.tsx +212 -212
  28. package/src/browser/styles/index.css +24 -24
  29. package/src/package.spec.ts +28 -28
@@ -1,126 +1,126 @@
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-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.OutlineViewContribution = exports.OutlineViewCommands = exports.OUTLINE_WIDGET_FACTORY_ID = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const view_contribution_1 = require("@theia/core/lib/browser/shell/view-contribution");
22
- const widgets_1 = require("@theia/core/lib/browser/widgets");
23
- const outline_view_widget_1 = require("./outline-view-widget");
24
- const tree_1 = require("@theia/core/lib/browser/tree");
25
- const os_1 = require("@theia/core/lib/common/os");
26
- const nls_1 = require("@theia/core/lib/common/nls");
27
- exports.OUTLINE_WIDGET_FACTORY_ID = 'outline-view';
28
- /**
29
- * Collection of `outline-view` commands.
30
- */
31
- var OutlineViewCommands;
32
- (function (OutlineViewCommands) {
33
- /**
34
- * Command which collapses all nodes from the `outline-view` tree.
35
- */
36
- OutlineViewCommands.COLLAPSE_ALL = {
37
- id: 'outlineView.collapse.all',
38
- iconClass: (0, widgets_1.codicon)('collapse-all')
39
- };
40
- /**
41
- * Command which expands all nodes from the `outline-view` tree.
42
- */
43
- OutlineViewCommands.EXPAND_ALL = {
44
- id: 'outlineView.expand.all',
45
- iconClass: (0, widgets_1.codicon)('expand-all')
46
- };
47
- })(OutlineViewCommands = exports.OutlineViewCommands || (exports.OutlineViewCommands = {}));
48
- let OutlineViewContribution = class OutlineViewContribution extends view_contribution_1.AbstractViewContribution {
49
- constructor() {
50
- super({
51
- widgetId: exports.OUTLINE_WIDGET_FACTORY_ID,
52
- widgetName: outline_view_widget_1.OutlineViewWidget.LABEL,
53
- defaultWidgetOptions: {
54
- area: 'right',
55
- rank: 500
56
- },
57
- toggleCommandId: 'outlineView:toggle',
58
- toggleKeybinding: os_1.OS.type() !== os_1.OS.Type.Linux
59
- ? 'ctrlcmd+shift+i'
60
- : undefined
61
- });
62
- }
63
- async initializeLayout(app) {
64
- await this.openView();
65
- }
66
- registerCommands(commands) {
67
- super.registerCommands(commands);
68
- commands.registerCommand(OutlineViewCommands.COLLAPSE_ALL, {
69
- isEnabled: w => this.withWidget(w, () => true),
70
- isVisible: w => this.withWidget(w, widget => !widget.model.areNodesCollapsed()),
71
- execute: () => this.collapseAllItems()
72
- });
73
- commands.registerCommand(OutlineViewCommands.EXPAND_ALL, {
74
- isEnabled: w => this.withWidget(w, () => true),
75
- isVisible: w => this.withWidget(w, widget => widget.model.areNodesCollapsed()),
76
- execute: () => this.expandAllItems()
77
- });
78
- }
79
- async registerToolbarItems(toolbar) {
80
- const widget = await this.widget;
81
- const onDidChange = widget.onDidUpdate;
82
- toolbar.registerItem({
83
- id: OutlineViewCommands.COLLAPSE_ALL.id,
84
- command: OutlineViewCommands.COLLAPSE_ALL.id,
85
- tooltip: nls_1.nls.localizeByDefault('Collapse All'),
86
- priority: 0,
87
- onDidChange
88
- });
89
- toolbar.registerItem({
90
- id: OutlineViewCommands.EXPAND_ALL.id,
91
- command: OutlineViewCommands.EXPAND_ALL.id,
92
- tooltip: nls_1.nls.localizeByDefault('Expand All'),
93
- priority: 0,
94
- onDidChange
95
- });
96
- }
97
- /**
98
- * Collapse all nodes in the outline view tree.
99
- */
100
- async collapseAllItems() {
101
- const { model } = await this.widget;
102
- const root = model.root;
103
- if (tree_1.CompositeTreeNode.is(root)) {
104
- model.collapseAll(root);
105
- }
106
- }
107
- async expandAllItems() {
108
- const { model } = await this.widget;
109
- model.expandAll(model.root);
110
- }
111
- /**
112
- * Determine if the current widget is the `outline-view`.
113
- */
114
- withWidget(widget = this.tryGetWidget(), cb) {
115
- if (widget instanceof outline_view_widget_1.OutlineViewWidget && widget.id === exports.OUTLINE_WIDGET_FACTORY_ID) {
116
- return cb(widget);
117
- }
118
- return false;
119
- }
120
- };
121
- OutlineViewContribution = (0, tslib_1.__decorate)([
122
- (0, inversify_1.injectable)(),
123
- (0, tslib_1.__metadata)("design:paramtypes", [])
124
- ], OutlineViewContribution);
125
- 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-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.OutlineViewContribution = exports.OutlineViewCommands = exports.OUTLINE_WIDGET_FACTORY_ID = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const view_contribution_1 = require("@theia/core/lib/browser/shell/view-contribution");
22
+ const widgets_1 = require("@theia/core/lib/browser/widgets");
23
+ const outline_view_widget_1 = require("./outline-view-widget");
24
+ const tree_1 = require("@theia/core/lib/browser/tree");
25
+ const os_1 = require("@theia/core/lib/common/os");
26
+ const nls_1 = require("@theia/core/lib/common/nls");
27
+ exports.OUTLINE_WIDGET_FACTORY_ID = 'outline-view';
28
+ /**
29
+ * Collection of `outline-view` commands.
30
+ */
31
+ var OutlineViewCommands;
32
+ (function (OutlineViewCommands) {
33
+ /**
34
+ * Command which collapses all nodes from the `outline-view` tree.
35
+ */
36
+ OutlineViewCommands.COLLAPSE_ALL = {
37
+ id: 'outlineView.collapse.all',
38
+ iconClass: (0, widgets_1.codicon)('collapse-all')
39
+ };
40
+ /**
41
+ * Command which expands all nodes from the `outline-view` tree.
42
+ */
43
+ OutlineViewCommands.EXPAND_ALL = {
44
+ id: 'outlineView.expand.all',
45
+ iconClass: (0, widgets_1.codicon)('expand-all')
46
+ };
47
+ })(OutlineViewCommands = exports.OutlineViewCommands || (exports.OutlineViewCommands = {}));
48
+ let OutlineViewContribution = class OutlineViewContribution extends view_contribution_1.AbstractViewContribution {
49
+ constructor() {
50
+ super({
51
+ widgetId: exports.OUTLINE_WIDGET_FACTORY_ID,
52
+ widgetName: outline_view_widget_1.OutlineViewWidget.LABEL,
53
+ defaultWidgetOptions: {
54
+ area: 'right',
55
+ rank: 500
56
+ },
57
+ toggleCommandId: 'outlineView:toggle',
58
+ toggleKeybinding: os_1.OS.type() !== os_1.OS.Type.Linux
59
+ ? 'ctrlcmd+shift+i'
60
+ : undefined
61
+ });
62
+ }
63
+ async initializeLayout(app) {
64
+ await this.openView();
65
+ }
66
+ registerCommands(commands) {
67
+ super.registerCommands(commands);
68
+ commands.registerCommand(OutlineViewCommands.COLLAPSE_ALL, {
69
+ isEnabled: w => this.withWidget(w, () => true),
70
+ isVisible: w => this.withWidget(w, widget => !widget.model.areNodesCollapsed()),
71
+ execute: () => this.collapseAllItems()
72
+ });
73
+ commands.registerCommand(OutlineViewCommands.EXPAND_ALL, {
74
+ isEnabled: w => this.withWidget(w, () => true),
75
+ isVisible: w => this.withWidget(w, widget => widget.model.areNodesCollapsed()),
76
+ execute: () => this.expandAllItems()
77
+ });
78
+ }
79
+ async registerToolbarItems(toolbar) {
80
+ const widget = await this.widget;
81
+ const onDidChange = widget.onDidUpdate;
82
+ toolbar.registerItem({
83
+ id: OutlineViewCommands.COLLAPSE_ALL.id,
84
+ command: OutlineViewCommands.COLLAPSE_ALL.id,
85
+ tooltip: nls_1.nls.localizeByDefault('Collapse All'),
86
+ priority: 0,
87
+ onDidChange
88
+ });
89
+ toolbar.registerItem({
90
+ id: OutlineViewCommands.EXPAND_ALL.id,
91
+ command: OutlineViewCommands.EXPAND_ALL.id,
92
+ tooltip: nls_1.nls.localizeByDefault('Expand All'),
93
+ priority: 0,
94
+ onDidChange
95
+ });
96
+ }
97
+ /**
98
+ * Collapse all nodes in the outline view tree.
99
+ */
100
+ async collapseAllItems() {
101
+ const { model } = await this.widget;
102
+ const root = model.root;
103
+ if (tree_1.CompositeTreeNode.is(root)) {
104
+ model.collapseAll(root);
105
+ }
106
+ }
107
+ async expandAllItems() {
108
+ const { model } = await this.widget;
109
+ model.expandAll(model.root);
110
+ }
111
+ /**
112
+ * Determine if the current widget is the `outline-view`.
113
+ */
114
+ withWidget(widget = this.tryGetWidget(), cb) {
115
+ if (widget instanceof outline_view_widget_1.OutlineViewWidget && widget.id === exports.OUTLINE_WIDGET_FACTORY_ID) {
116
+ return cb(widget);
117
+ }
118
+ return false;
119
+ }
120
+ };
121
+ OutlineViewContribution = (0, tslib_1.__decorate)([
122
+ (0, inversify_1.injectable)(),
123
+ (0, tslib_1.__metadata)("design:paramtypes", [])
124
+ ], OutlineViewContribution);
125
+ exports.OutlineViewContribution = OutlineViewContribution;
126
126
  //# 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-only 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({ ...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-only 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({ ...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,79 +1,79 @@
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-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.OutlineViewService = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const core_1 = require("@theia/core");
22
- const outline_view_widget_1 = require("./outline-view-widget");
23
- let OutlineViewService = class OutlineViewService {
24
- constructor(factory) {
25
- this.factory = factory;
26
- this.id = 'outline-view';
27
- this.onDidChangeOutlineEmitter = new core_1.Emitter();
28
- this.onDidChangeOpenStateEmitter = new core_1.Emitter();
29
- this.onDidSelectEmitter = new core_1.Emitter();
30
- this.onDidOpenEmitter = new core_1.Emitter();
31
- }
32
- get onDidSelect() {
33
- return this.onDidSelectEmitter.event;
34
- }
35
- get onDidOpen() {
36
- return this.onDidOpenEmitter.event;
37
- }
38
- get onDidChangeOutline() {
39
- return this.onDidChangeOutlineEmitter.event;
40
- }
41
- get onDidChangeOpenState() {
42
- return this.onDidChangeOpenStateEmitter.event;
43
- }
44
- get open() {
45
- return this.widget !== undefined && this.widget.isVisible;
46
- }
47
- /**
48
- * Publish the collection of outline view symbols.
49
- * - Publishing includes setting the `OutlineViewWidget` tree with symbol information.
50
- * @param roots the list of outline symbol information nodes.
51
- */
52
- publish(roots) {
53
- if (this.widget) {
54
- this.widget.setOutlineTree(roots);
55
- }
56
- // onDidChangeOutline needs to be fired even when the outline view widget is closed
57
- // in order to update breadcrumbs.
58
- this.onDidChangeOutlineEmitter.fire(roots);
59
- }
60
- createWidget() {
61
- this.widget = this.factory();
62
- const disposables = new core_1.DisposableCollection();
63
- disposables.push(this.widget.onDidChangeOpenStateEmitter.event(open => this.onDidChangeOpenStateEmitter.fire(open)));
64
- disposables.push(this.widget.model.onOpenNode(node => this.onDidOpenEmitter.fire(node)));
65
- disposables.push(this.widget.model.onSelectionChanged(selection => this.onDidSelectEmitter.fire(selection[0])));
66
- this.widget.disposed.connect(() => {
67
- this.widget = undefined;
68
- disposables.dispose();
69
- });
70
- return Promise.resolve(this.widget);
71
- }
72
- };
73
- OutlineViewService = (0, tslib_1.__decorate)([
74
- (0, inversify_1.injectable)(),
75
- (0, tslib_1.__param)(0, (0, inversify_1.inject)(outline_view_widget_1.OutlineViewWidgetFactory)),
76
- (0, tslib_1.__metadata)("design:paramtypes", [Function])
77
- ], OutlineViewService);
78
- 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-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.OutlineViewService = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const core_1 = require("@theia/core");
22
+ const outline_view_widget_1 = require("./outline-view-widget");
23
+ let OutlineViewService = class OutlineViewService {
24
+ constructor(factory) {
25
+ this.factory = factory;
26
+ this.id = 'outline-view';
27
+ this.onDidChangeOutlineEmitter = new core_1.Emitter();
28
+ this.onDidChangeOpenStateEmitter = new core_1.Emitter();
29
+ this.onDidSelectEmitter = new core_1.Emitter();
30
+ this.onDidOpenEmitter = new core_1.Emitter();
31
+ }
32
+ get onDidSelect() {
33
+ return this.onDidSelectEmitter.event;
34
+ }
35
+ get onDidOpen() {
36
+ return this.onDidOpenEmitter.event;
37
+ }
38
+ get onDidChangeOutline() {
39
+ return this.onDidChangeOutlineEmitter.event;
40
+ }
41
+ get onDidChangeOpenState() {
42
+ return this.onDidChangeOpenStateEmitter.event;
43
+ }
44
+ get open() {
45
+ return this.widget !== undefined && this.widget.isVisible;
46
+ }
47
+ /**
48
+ * Publish the collection of outline view symbols.
49
+ * - Publishing includes setting the `OutlineViewWidget` tree with symbol information.
50
+ * @param roots the list of outline symbol information nodes.
51
+ */
52
+ publish(roots) {
53
+ if (this.widget) {
54
+ this.widget.setOutlineTree(roots);
55
+ }
56
+ // onDidChangeOutline needs to be fired even when the outline view widget is closed
57
+ // in order to update breadcrumbs.
58
+ this.onDidChangeOutlineEmitter.fire(roots);
59
+ }
60
+ createWidget() {
61
+ this.widget = this.factory();
62
+ const disposables = new core_1.DisposableCollection();
63
+ disposables.push(this.widget.onDidChangeOpenStateEmitter.event(open => this.onDidChangeOpenStateEmitter.fire(open)));
64
+ disposables.push(this.widget.model.onOpenNode(node => this.onDidOpenEmitter.fire(node)));
65
+ disposables.push(this.widget.model.onSelectionChanged(selection => this.onDidSelectEmitter.fire(selection[0])));
66
+ this.widget.disposed.connect(() => {
67
+ this.widget = undefined;
68
+ disposables.dispose();
69
+ });
70
+ return Promise.resolve(this.widget);
71
+ }
72
+ };
73
+ OutlineViewService = (0, tslib_1.__decorate)([
74
+ (0, inversify_1.injectable)(),
75
+ (0, tslib_1.__param)(0, (0, inversify_1.inject)(outline_view_widget_1.OutlineViewWidgetFactory)),
76
+ (0, tslib_1.__metadata)("design:paramtypes", [Function])
77
+ ], OutlineViewService);
78
+ exports.OutlineViewService = OutlineViewService;
79
79
  //# sourceMappingURL=outline-view-service.js.map