mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 03:58:33 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
60
src/vs/platform/contextview/browser/contextView.ts
Normal file
60
src/vs/platform/contextview/browser/contextView.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IAction, IActionRunner, Action } 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 { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export const IContextViewService = createDecorator<IContextViewService>('contextViewService');
|
||||
|
||||
export interface IContextViewService {
|
||||
_serviceBrand: any;
|
||||
showContextView(delegate: IContextViewDelegate): void;
|
||||
hideContextView(data?: any): void;
|
||||
layout(): void;
|
||||
}
|
||||
|
||||
export interface IContextViewDelegate {
|
||||
getAnchor(): HTMLElement | { x: number; y: number; };
|
||||
render(container: HTMLElement): IDisposable;
|
||||
canRelayout?: boolean; // Default: true
|
||||
onDOMEvent?(e: Event, activeElement: HTMLElement): void;
|
||||
onHide?(data?: any): void;
|
||||
}
|
||||
|
||||
export const IContextMenuService = createDecorator<IContextMenuService>('contextMenuService');
|
||||
|
||||
export interface IContextMenuService {
|
||||
_serviceBrand: any;
|
||||
showContextMenu(delegate: IContextMenuDelegate): void;
|
||||
}
|
||||
|
||||
export interface IEvent {
|
||||
shiftKey?: boolean;
|
||||
ctrlKey?: boolean;
|
||||
altKey?: boolean;
|
||||
metaKey?: boolean;
|
||||
}
|
||||
|
||||
export interface IContextMenuDelegate {
|
||||
getAnchor(): HTMLElement | { x: number; y: number; };
|
||||
getActions(): TPromise<(IAction | ContextSubMenu)[]>;
|
||||
getActionItem?(action: IAction): IActionItem;
|
||||
getActionsContext?(event?: IEvent): any;
|
||||
getKeyBinding?(action: IAction): ResolvedKeybinding;
|
||||
getMenuClassName?(): string;
|
||||
onHide?(didCancel: boolean): void;
|
||||
actionRunner?: IActionRunner;
|
||||
}
|
||||
|
||||
export class ContextSubMenu extends Action {
|
||||
constructor(label: string, public entries: (ContextSubMenu | IAction)[]) {
|
||||
super('contextsubmenu', label, '', true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user