dialog assisted notebooks (#6564)

This commit is contained in:
Alan Ren
2019-08-05 16:01:34 -07:00
committed by GitHub
parent 2431bb8e37
commit 2bb8806da6
13 changed files with 1074 additions and 225 deletions

View File

@@ -0,0 +1,33 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
export abstract class DialogBase {
protected _toDispose: vscode.Disposable[] = [];
protected _dialogObject: azdata.window.Dialog;
constructor(protected extensionContext: vscode.ExtensionContext, dialogTitle: string, dialogName: string, isWide: boolean = false) {
this._dialogObject = azdata.window.createModelViewDialog(dialogTitle, dialogName, isWide);
this._dialogObject.cancelButton.onClick(() => this.onCancel());
}
protected abstract initializeDialog(): void;
public open(): void {
this.initializeDialog();
azdata.window.openDialog(this._dialogObject);
}
protected onCancel(): void {
this.dispose();
}
protected dispose(): void {
this._toDispose.forEach(disposable => disposable.dispose());
}
}