mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 08:45:56 +01:00
8d72e849d3
* debt - avoid usages of electron remote module * debt - comment out remote & sendSync from electron.d.ts
36 lines
1.4 KiB
TypeScript
36 lines
1.4 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
'use strict';
|
|
|
|
import { IAction, IActionRunner } from 'vs/base/common/actions';
|
|
import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
|
import { TPromise } from 'vs/base/common/winjs.base';
|
|
import { ResolvedKeybinding } from 'vs/base/common/keyCodes';
|
|
import { SubmenuAction } from 'vs/base/browser/ui/menu/menu';
|
|
|
|
export interface IContextMenuEvent {
|
|
shiftKey?: boolean;
|
|
ctrlKey?: boolean;
|
|
altKey?: boolean;
|
|
metaKey?: boolean;
|
|
}
|
|
|
|
export class ContextSubMenu extends SubmenuAction {
|
|
constructor(label: string, public entries: (ContextSubMenu | IAction)[]) {
|
|
super(label, entries, 'contextsubmenu');
|
|
}
|
|
}
|
|
|
|
export interface IContextMenuDelegate {
|
|
getAnchor(): HTMLElement | { x: number; y: number; };
|
|
getActions(): TPromise<(IAction | ContextSubMenu)[]>;
|
|
getActionItem?(action: IAction): IActionItem;
|
|
getActionsContext?(event?: IContextMenuEvent): any;
|
|
getKeyBinding?(action: IAction): ResolvedKeybinding;
|
|
getMenuClassName?(): string;
|
|
onHide?(didCancel: boolean): void;
|
|
actionRunner?: IActionRunner;
|
|
autoSelectFirstItem?: boolean;
|
|
} |