mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
remove getActions*2 from view pane container
This commit is contained in:
parent
9dd25c4d19
commit
82f3379ac6
|
@ -15,7 +15,7 @@ import { Composite } from 'vs/workbench/browser/composite';
|
|||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { ViewPaneContainer } from './parts/views/viewPaneContainer';
|
||||
import { IPaneComposite } from 'vs/workbench/common/panecomposite';
|
||||
import { IAction, IActionViewItem, Separator } from 'vs/base/common/actions';
|
||||
import { IAction, IActionViewItem } from 'vs/base/common/actions';
|
||||
|
||||
export class PaneComposite extends Composite implements IPaneComposite {
|
||||
|
||||
|
@ -64,37 +64,15 @@ export class PaneComposite extends Composite implements IPaneComposite {
|
|||
}
|
||||
|
||||
getContextMenuActions(): ReadonlyArray<IAction> {
|
||||
const result = [];
|
||||
result.push(...this.viewPaneContainer.getContextMenuActions2());
|
||||
|
||||
const otherActions = this.viewPaneContainer.getContextMenuActions();
|
||||
|
||||
if (otherActions.length) {
|
||||
result.push(new Separator());
|
||||
result.push(...otherActions);
|
||||
}
|
||||
|
||||
return result;
|
||||
return this.viewPaneContainer.getContextMenuActions();
|
||||
}
|
||||
|
||||
getActions(): ReadonlyArray<IAction> {
|
||||
const result = [];
|
||||
result.push(...this.viewPaneContainer.getActions2());
|
||||
result.push(...this.viewPaneContainer.getActions());
|
||||
return result;
|
||||
return this.viewPaneContainer.getActions();
|
||||
}
|
||||
|
||||
getSecondaryActions(): ReadonlyArray<IAction> {
|
||||
const menuActions = this.viewPaneContainer.getSecondaryActions2();
|
||||
const viewPaneContainerActions = this.viewPaneContainer.getSecondaryActions();
|
||||
if (menuActions.length && viewPaneContainerActions.length) {
|
||||
return [
|
||||
...menuActions,
|
||||
new Separator(),
|
||||
...viewPaneContainerActions
|
||||
];
|
||||
}
|
||||
return menuActions.length ? menuActions : viewPaneContainerActions;
|
||||
return this.viewPaneContainer.getSecondaryActions();
|
||||
}
|
||||
|
||||
getActionViewItem(action: IAction): IActionViewItem | undefined {
|
||||
|
|
|
@ -564,19 +564,15 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
|
|||
let anchor: { x: number, y: number; } = { x: event.posx, y: event.posy };
|
||||
this.contextMenuService.showContextMenu({
|
||||
getAnchor: () => anchor,
|
||||
getActions: () => [...this.getContextMenuActions2()]
|
||||
getActions: () => [...this.getContextMenuActions()]
|
||||
});
|
||||
}
|
||||
|
||||
getContextMenuActions2(): ReadonlyArray<IAction> {
|
||||
getContextMenuActions(): ReadonlyArray<IAction> {
|
||||
return this.menuActions.getContextMenuActions();
|
||||
}
|
||||
|
||||
getContextMenuActions(viewDescriptor?: IViewDescriptor): IAction[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
getActions2(): IAction[] {
|
||||
getActions(): IAction[] {
|
||||
const result = [];
|
||||
result.push(...this.menuActions.getPrimaryActions());
|
||||
if (this.isViewMergedWithContainer()) {
|
||||
|
@ -585,11 +581,7 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
|
|||
return result;
|
||||
}
|
||||
|
||||
getActions(): IAction[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
getSecondaryActions2(): IAction[] {
|
||||
getSecondaryActions(): IAction[] {
|
||||
const viewPaneActions = this.isViewMergedWithContainer() ? this.paneItems[0].pane.getSecondaryActions() : [];
|
||||
let menuActions = this.menuActions.getSecondaryActions();
|
||||
|
||||
|
@ -619,10 +611,6 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
|
|||
return menuActions.length ? menuActions : viewPaneActions;
|
||||
}
|
||||
|
||||
getSecondaryActions(): IAction[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
getActionsContext(): unknown {
|
||||
return undefined;
|
||||
}
|
||||
|
|
|
@ -814,8 +814,6 @@ export interface IViewPaneContainer {
|
|||
setVisible(visible: boolean): void;
|
||||
isVisible(): boolean;
|
||||
focus(): void;
|
||||
getActions(): IAction[];
|
||||
getSecondaryActions(): IAction[];
|
||||
getActionViewItem(action: IAction): IActionViewItem | undefined;
|
||||
getActionsContext(): unknown;
|
||||
getView(viewId: string): IView | undefined;
|
||||
|
|
Loading…
Reference in a new issue