-
Notifications
You must be signed in to change notification settings - Fork 27.9k
/
contextViewService.ts
49 lines (39 loc) · 1.55 KB
/
contextViewService.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IContextViewService, IContextViewDelegate } from './contextView';
import { ContextView } from 'vs/base/browser/ui/contextview/contextview';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ILogService } from 'vs/platform/log/common/log';
export class ContextViewService implements IContextViewService {
public _serviceBrand: any;
private contextView: ContextView;
constructor(
container: HTMLElement,
@ITelemetryService telemetryService: ITelemetryService,
@ILogService private logService: ILogService
) {
this.contextView = new ContextView(container);
}
public dispose(): void {
this.contextView.dispose();
}
// ContextView
public setContainer(container: HTMLElement): void {
this.logService.trace('ContextViewService#setContainer');
this.contextView.setContainer(container);
}
public showContextView(delegate: IContextViewDelegate): void {
this.logService.trace('ContextViewService#showContextView');
this.contextView.show(delegate);
}
public layout(): void {
this.contextView.layout();
}
public hideContextView(data?: any): void {
this.logService.trace('ContextViewService#hideContextView');
this.contextView.hide(data);
}
}