mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-17 03:21:40 -04:00
* pass install paths to notebooks * onComplete * discover and publish actual installation Path * pass the path to notebook * minor fixes needed post merge of code from remote * fix some errors * remove unused variable
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as azdata from 'azdata';
|
|
import * as vscode from 'vscode';
|
|
|
|
export abstract class DialogBase {
|
|
protected _toDispose: vscode.Disposable[] = [];
|
|
protected _dialogObject: azdata.window.Dialog;
|
|
|
|
constructor(dialogTitle: string, dialogName: string, isWide: boolean = false) {
|
|
this._dialogObject = azdata.window.createModelViewDialog(dialogTitle, dialogName, isWide);
|
|
this._toDispose.push(this._dialogObject.cancelButton.onClick(() => this.onCancelButtonClicked()));
|
|
this._toDispose.push(this._dialogObject.okButton.onClick(() => this.onOkButtonClicked()));
|
|
}
|
|
|
|
protected abstract initialize(): void;
|
|
|
|
public open(): void {
|
|
this.initialize();
|
|
azdata.window.openDialog(this._dialogObject);
|
|
}
|
|
|
|
private onCancelButtonClicked(): void {
|
|
this.dispose();
|
|
}
|
|
|
|
private onOkButtonClicked(): void {
|
|
this.onComplete();
|
|
this.dispose();
|
|
}
|
|
|
|
protected onComplete(): void {
|
|
}
|
|
|
|
protected dispose(): void {
|
|
this._toDispose.forEach(disposable => disposable.dispose());
|
|
}
|
|
}
|