mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 09:35:37 -05:00
* remove builder; more null checks * null checks * formatting * wip * fix dropdown themeing * formatting * formatting * fix tests * update what files are checked * add code to help refresh bad nodes
30 lines
951 B
TypeScript
30 lines
951 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { Action } from 'vs/base/common/actions';
|
|
import * as nls from 'vs/nls';
|
|
|
|
export class CloseTabAction extends Action {
|
|
private static readonly ID = 'closeTab';
|
|
private static readonly LABEL = nls.localize('closeTab', "Close");
|
|
private static readonly ICON = 'close';
|
|
|
|
constructor(
|
|
private closeFn: () => void,
|
|
private context: any // this
|
|
) {
|
|
super(CloseTabAction.ID, CloseTabAction.LABEL, CloseTabAction.ICON);
|
|
}
|
|
|
|
run(): Promise<boolean> {
|
|
try {
|
|
this.closeFn.apply(this.context);
|
|
return Promise.resolve(true);
|
|
} catch (e) {
|
|
return Promise.resolve(false);
|
|
}
|
|
}
|
|
}
|