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:
@@ -0,0 +1,31 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
import { ActivitybarPart } from 'vs/workbench/browser/parts/activitybar/activitybarPart';
|
||||
import { PanelPart } from 'vs/workbench/browser/parts/panel/panelPart';
|
||||
import { IActivityService, IBadge } from 'vs/workbench/services/activity/common/activity';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export class ActivityService implements IActivityService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
constructor(
|
||||
private activitybarPart: ActivitybarPart,
|
||||
private panelPart: PanelPart,
|
||||
@IPanelService private panelService: IPanelService
|
||||
) { }
|
||||
|
||||
public showActivity(compositeOrActionId: string, badge: IBadge, clazz?: string): IDisposable {
|
||||
if (this.panelService.getPanels().filter(p => p.id === compositeOrActionId).length) {
|
||||
return this.panelPart.showActivity(compositeOrActionId, badge, clazz);
|
||||
}
|
||||
|
||||
return this.activitybarPart.showActivity(compositeOrActionId, badge, clazz);
|
||||
}
|
||||
}
|
||||
@@ -58,38 +58,13 @@ export class IconBadge extends BaseBadge {
|
||||
export class ProgressBadge extends BaseBadge {
|
||||
}
|
||||
|
||||
export const IActivityBarService = createDecorator<IActivityBarService>('activityBarService');
|
||||
export const IActivityService = createDecorator<IActivityService>('activityService');
|
||||
|
||||
export interface IActivityBarService {
|
||||
export interface IActivityService {
|
||||
_serviceBrand: any;
|
||||
|
||||
/**
|
||||
* Show activity in the activitybar for the given global activity.
|
||||
* Show activity in the panel for the given panel or in the activitybar for the given viewlet or global action.
|
||||
*/
|
||||
showGlobalActivity(globalActivityId: string, badge: IBadge): IDisposable;
|
||||
|
||||
/**
|
||||
* Show activity in the activitybar for the given viewlet.
|
||||
*/
|
||||
showActivity(viewletId: string, badge: IBadge, clazz?: string): IDisposable;
|
||||
|
||||
/**
|
||||
* Unpins a viewlet from the activitybar.
|
||||
*/
|
||||
unpin(viewletId: string): void;
|
||||
|
||||
/**
|
||||
* Pin a viewlet inside the activity bar.
|
||||
*/
|
||||
pin(viewletId: string): void;
|
||||
|
||||
/**
|
||||
* Find out if a viewlet is pinned in the activity bar.
|
||||
*/
|
||||
isPinned(viewletId: string): boolean;
|
||||
|
||||
/**
|
||||
* Reorder viewlet ordering by moving a viewlet to the location of another viewlet.
|
||||
*/
|
||||
move(viewletId: string, toViewletId: string): void;
|
||||
showActivity(compositeOrActionId: string, badge: IBadge, clazz?: string): IDisposable;
|
||||
}
|
||||
Reference in New Issue
Block a user