-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathmethod-modeling-panel.ts
More file actions
49 lines (44 loc) · 1.5 KB
/
method-modeling-panel.ts
File metadata and controls
49 lines (44 loc) · 1.5 KB
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
import { window } from "vscode";
import { App } from "../../common/app";
import { DisposableObject } from "../../common/disposable-object";
import { MethodModelingViewProvider } from "./method-modeling-view-provider";
import { Method } from "../method";
import { ModelingStore } from "../modeling-store";
import { ModelEditorViewTracker } from "../model-editor-view-tracker";
import { ModelConfigListener } from "../../config";
import { DatabaseItem } from "../../databases/local-databases";
import { ModelingEvents } from "../modeling-events";
export class MethodModelingPanel extends DisposableObject {
private readonly provider: MethodModelingViewProvider;
constructor(
app: App,
modelingStore: ModelingStore,
modelingEvents: ModelingEvents,
editorViewTracker: ModelEditorViewTracker,
) {
super();
// This is here instead of in MethodModelingViewProvider because we need to
// dispose this when the extension gets disposed, not when the webview gets
// disposed.
const modelConfig = this.push(new ModelConfigListener());
this.provider = new MethodModelingViewProvider(
app,
modelingStore,
modelingEvents,
editorViewTracker,
modelConfig,
);
this.push(
window.registerWebviewViewProvider(
MethodModelingViewProvider.viewType,
this.provider,
),
);
}
public async setMethod(
databaseItem: DatabaseItem,
method: Method,
): Promise<void> {
await this.provider.setMethod(databaseItem, method);
}
}