mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
refacotring (#295213)
This commit is contained in:
committed by
GitHub
parent
0366405821
commit
3a64178360
@@ -114,6 +114,7 @@ export class AuxiliaryBarPart extends AbstractPaneCompositePart {
|
||||
ViewContainerLocation.AuxiliaryBar,
|
||||
Extensions.Auxiliary,
|
||||
MenuId.AuxiliaryBarTitle,
|
||||
undefined,
|
||||
notificationService,
|
||||
storageService,
|
||||
contextMenuService,
|
||||
|
||||
@@ -145,6 +145,7 @@ export abstract class AbstractPaneCompositePart extends CompositePart<PaneCompos
|
||||
protected readonly location: ViewContainerLocation,
|
||||
readonly registryId: string,
|
||||
private readonly globalActionsMenuId: MenuId,
|
||||
private readonly globalLeftActionsMenuId: MenuId | undefined,
|
||||
@INotificationService notificationService: INotificationService,
|
||||
@IStorageService storageService: IStorageService,
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@@ -342,13 +343,11 @@ export abstract class AbstractPaneCompositePart extends CompositePart<PaneCompos
|
||||
this.onTitleAreaContextMenu(new StandardMouseEvent(getWindow(titleArea), e));
|
||||
}));
|
||||
|
||||
// Global Left Actions Toolbar (optional, subclasses provide a menu ID)
|
||||
const globalLeftActionsMenuId = this.getGlobalLeftActionsMenuId();
|
||||
if (globalLeftActionsMenuId) {
|
||||
if (this.globalLeftActionsMenuId) {
|
||||
const globalLeftTitleActionsContainer = titleArea.appendChild($('.global-actions-left'));
|
||||
this.globalLeftToolBar = this._register(this.instantiationService.createInstance(MenuWorkbenchToolBar,
|
||||
globalLeftTitleActionsContainer,
|
||||
globalLeftActionsMenuId,
|
||||
this.globalLeftActionsMenuId,
|
||||
{
|
||||
actionViewItemProvider: (action, options) => this.actionViewItemProvider(action, options),
|
||||
orientation: ActionsOrientation.HORIZONTAL,
|
||||
@@ -708,14 +707,6 @@ export abstract class AbstractPaneCompositePart extends CompositePart<PaneCompos
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override in subclasses to provide a menu ID for a global toolbar on the left side
|
||||
* of the composite bar / title area. Returns `undefined` by default (no left toolbar).
|
||||
*/
|
||||
protected getGlobalLeftActionsMenuId(): MenuId | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
protected abstract shouldShowCompositeBar(): boolean;
|
||||
protected abstract getCompositeBarOptions(): IPaneCompositeBarOptions;
|
||||
protected abstract getCompositeBarPosition(): CompositeBarPosition;
|
||||
|
||||
@@ -96,6 +96,7 @@ export class PanelPart extends AbstractPaneCompositePart {
|
||||
ViewContainerLocation.Panel,
|
||||
Extensions.Panels,
|
||||
MenuId.PanelTitle,
|
||||
undefined,
|
||||
notificationService,
|
||||
storageService,
|
||||
contextMenuService,
|
||||
|
||||
@@ -97,6 +97,7 @@ export class SidebarPart extends AbstractPaneCompositePart {
|
||||
ViewContainerLocation.Sidebar,
|
||||
Extensions.Viewlets,
|
||||
MenuId.SidebarTitle,
|
||||
undefined,
|
||||
notificationService,
|
||||
storageService,
|
||||
contextMenuService,
|
||||
|
||||
Reference in New Issue
Block a user