mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Refresh master with initial release/0.24 snapshot (#332)
* Initial port of release/0.24 source code * Fix additional headers * Fix a typo in launch.json
This commit is contained in:
43
src/vs/workbench/common/activity.ts
Normal file
43
src/vs/workbench/common/activity.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export interface IActivity {
|
||||
id: string;
|
||||
name: string;
|
||||
keybindingId?: string;
|
||||
cssClass: string;
|
||||
}
|
||||
|
||||
export interface IGlobalActivity extends IActivity {
|
||||
getActions(): IAction[];
|
||||
}
|
||||
|
||||
export const GlobalActivityExtensions = 'workbench.contributions.globalActivities';
|
||||
|
||||
export interface IGlobalActivityRegistry {
|
||||
registerActivity(descriptor: IConstructorSignature0<IGlobalActivity>): void;
|
||||
getActivities(): IConstructorSignature0<IGlobalActivity>[];
|
||||
}
|
||||
|
||||
export class GlobalActivityRegistry implements IGlobalActivityRegistry {
|
||||
|
||||
private activityDescriptors = new Set<IConstructorSignature0<IGlobalActivity>>();
|
||||
|
||||
registerActivity(descriptor: IConstructorSignature0<IGlobalActivity>): void {
|
||||
this.activityDescriptors.add(descriptor);
|
||||
}
|
||||
|
||||
getActivities(): IConstructorSignature0<IGlobalActivity>[] {
|
||||
const result: IConstructorSignature0<IGlobalActivity>[] = [];
|
||||
this.activityDescriptors.forEach(d => result.push(d));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Registry.add(GlobalActivityExtensions, new GlobalActivityRegistry());
|
||||
Reference in New Issue
Block a user