mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 17:20:28 -04: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:
@@ -131,7 +131,7 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
public onClick(tree: _.ITree, element: any, event: mouse.IMouseEvent): boolean {
|
||||
var isMac = platform.isMacintosh;
|
||||
const isMac = platform.isMacintosh;
|
||||
|
||||
// A Ctrl click on the Mac is a context menu event
|
||||
if (isMac && event.ctrlKey) {
|
||||
@@ -152,13 +152,13 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
protected onLeftClick(tree: _.ITree, element: any, eventish: ICancelableEvent, origin: string = 'mouse'): boolean {
|
||||
var payload = { origin: origin, originalEvent: eventish };
|
||||
const payload = { origin: origin, originalEvent: eventish };
|
||||
|
||||
if (tree.getInput() === element) {
|
||||
tree.clearFocus(payload);
|
||||
tree.clearSelection(payload);
|
||||
} else {
|
||||
var isMouseDown = eventish && (<mouse.IMouseEvent>eventish).browserEvent && (<mouse.IMouseEvent>eventish).browserEvent.type === 'mousedown';
|
||||
const isMouseDown = eventish && (<mouse.IMouseEvent>eventish).browserEvent && (<mouse.IMouseEvent>eventish).browserEvent.type === 'mousedown';
|
||||
if (!isMouseDown) {
|
||||
eventish.preventDefault(); // we cannot preventDefault onMouseDown because this would break DND otherwise
|
||||
}
|
||||
@@ -193,7 +193,7 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
public onTap(tree: _.ITree, element: any, event: touch.GestureEvent): boolean {
|
||||
var target = <HTMLElement>event.initialTarget;
|
||||
const target = <HTMLElement>event.initialTarget;
|
||||
|
||||
if (target && target.tagName && target.tagName.toLowerCase() === 'input') {
|
||||
return false; // Ignore event if target is a form input field (avoids browser specific issues)
|
||||
@@ -211,7 +211,7 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
private onKey(bindings: KeybindingDispatcher, tree: _.ITree, event: IKeyboardEvent): boolean {
|
||||
var handler = bindings.dispatch(event.toKeybinding());
|
||||
const handler = bindings.dispatch(event.toKeybinding());
|
||||
if (handler) {
|
||||
if (handler(tree, event)) {
|
||||
event.preventDefault();
|
||||
@@ -223,7 +223,7 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
protected onUp(tree: _.ITree, event: IKeyboardEvent): boolean {
|
||||
var payload = { origin: 'keyboard', originalEvent: event };
|
||||
const payload = { origin: 'keyboard', originalEvent: event };
|
||||
|
||||
if (tree.getHighlight()) {
|
||||
tree.clearHighlight(payload);
|
||||
@@ -235,7 +235,7 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
protected onPageUp(tree: _.ITree, event: IKeyboardEvent): boolean {
|
||||
var payload = { origin: 'keyboard', originalEvent: event };
|
||||
const payload = { origin: 'keyboard', originalEvent: event };
|
||||
|
||||
if (tree.getHighlight()) {
|
||||
tree.clearHighlight(payload);
|
||||
@@ -247,7 +247,7 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
protected onDown(tree: _.ITree, event: IKeyboardEvent): boolean {
|
||||
var payload = { origin: 'keyboard', originalEvent: event };
|
||||
const payload = { origin: 'keyboard', originalEvent: event };
|
||||
|
||||
if (tree.getHighlight()) {
|
||||
tree.clearHighlight(payload);
|
||||
@@ -259,7 +259,7 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
protected onPageDown(tree: _.ITree, event: IKeyboardEvent): boolean {
|
||||
var payload = { origin: 'keyboard', originalEvent: event };
|
||||
const payload = { origin: 'keyboard', originalEvent: event };
|
||||
|
||||
if (tree.getHighlight()) {
|
||||
tree.clearHighlight(payload);
|
||||
@@ -271,7 +271,7 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
protected onHome(tree: _.ITree, event: IKeyboardEvent): boolean {
|
||||
var payload = { origin: 'keyboard', originalEvent: event };
|
||||
const payload = { origin: 'keyboard', originalEvent: event };
|
||||
|
||||
if (tree.getHighlight()) {
|
||||
tree.clearHighlight(payload);
|
||||
@@ -283,7 +283,7 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
protected onEnd(tree: _.ITree, event: IKeyboardEvent): boolean {
|
||||
var payload = { origin: 'keyboard', originalEvent: event };
|
||||
const payload = { origin: 'keyboard', originalEvent: event };
|
||||
|
||||
if (tree.getHighlight()) {
|
||||
tree.clearHighlight(payload);
|
||||
@@ -295,12 +295,12 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
protected onLeft(tree: _.ITree, event: IKeyboardEvent): boolean {
|
||||
var payload = { origin: 'keyboard', originalEvent: event };
|
||||
const payload = { origin: 'keyboard', originalEvent: event };
|
||||
|
||||
if (tree.getHighlight()) {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
var focus = tree.getFocus();
|
||||
const focus = tree.getFocus();
|
||||
tree.collapse(focus).then(didCollapse => {
|
||||
if (focus && !didCollapse) {
|
||||
tree.focusParent(payload);
|
||||
@@ -313,12 +313,12 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
protected onRight(tree: _.ITree, event: IKeyboardEvent): boolean {
|
||||
var payload = { origin: 'keyboard', originalEvent: event };
|
||||
const payload = { origin: 'keyboard', originalEvent: event };
|
||||
|
||||
if (tree.getHighlight()) {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
var focus = tree.getFocus();
|
||||
const focus = tree.getFocus();
|
||||
tree.expand(focus).then(didExpand => {
|
||||
if (focus && !didExpand) {
|
||||
tree.focusFirstChild(payload);
|
||||
@@ -331,12 +331,12 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
protected onEnter(tree: _.ITree, event: IKeyboardEvent): boolean {
|
||||
var payload = { origin: 'keyboard', originalEvent: event };
|
||||
const payload = { origin: 'keyboard', originalEvent: event };
|
||||
|
||||
if (tree.getHighlight()) {
|
||||
return false;
|
||||
}
|
||||
var focus = tree.getFocus();
|
||||
const focus = tree.getFocus();
|
||||
if (focus) {
|
||||
tree.setSelection([focus], payload);
|
||||
}
|
||||
@@ -347,7 +347,7 @@ export class DefaultController implements _.IController {
|
||||
if (tree.getHighlight()) {
|
||||
return false;
|
||||
}
|
||||
var focus = tree.getFocus();
|
||||
const focus = tree.getFocus();
|
||||
if (focus) {
|
||||
tree.toggleExpansion(focus);
|
||||
}
|
||||
@@ -355,7 +355,7 @@ export class DefaultController implements _.IController {
|
||||
}
|
||||
|
||||
protected onEscape(tree: _.ITree, event: IKeyboardEvent): boolean {
|
||||
var payload = { origin: 'keyboard', originalEvent: event };
|
||||
const payload = { origin: 'keyboard', originalEvent: event };
|
||||
|
||||
if (tree.getHighlight()) {
|
||||
tree.clearHighlight(payload);
|
||||
|
||||
@@ -52,12 +52,12 @@ export class TreeContext implements _.ITreeContext {
|
||||
|
||||
const defaultStyles: _.ITreeStyles = {
|
||||
listFocusBackground: Color.fromHex('#073655'),
|
||||
listActiveSelectionBackground: Color.fromHex('#3062D6'),
|
||||
listActiveSelectionBackground: Color.fromHex('#0E639C'),
|
||||
listActiveSelectionForeground: Color.fromHex('#FFFFFF'),
|
||||
listFocusAndSelectionBackground: Color.fromHex('#094771'),
|
||||
listFocusAndSelectionForeground: Color.fromHex('#FFFFFF'),
|
||||
listInactiveSelectionBackground: Color.fromHex('#C8C8C8'),
|
||||
listHoverBackground: Color.fromHex('#DCDCDC'),
|
||||
listInactiveSelectionBackground: Color.fromHex('#3F3F46'),
|
||||
listHoverBackground: Color.fromHex('#2A2D2E'),
|
||||
listDropBackground: Color.fromHex('#383B3D')
|
||||
};
|
||||
|
||||
|
||||
@@ -556,7 +556,7 @@ export class Item extends Events.EventEmitter {
|
||||
}
|
||||
|
||||
private mapEachChild<T>(fn: (child: Item) => T): T[] {
|
||||
var result = [];
|
||||
var result: T[] = [];
|
||||
this.forEachChild((child) => {
|
||||
result.push(fn(child));
|
||||
});
|
||||
|
||||
@@ -1550,7 +1550,6 @@ export class TreeView extends HeightMap {
|
||||
// {{SQL CARBON EDIT}}
|
||||
this.context.dnd.dropAbort(this.context.tree, this.currentDragAndDropData);
|
||||
}
|
||||
|
||||
this.cancelDragAndDropScrollInterval();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { EventEmitter } from 'vs/base/common/eventEmitter';
|
||||
import { IIterator, ArrayIterator } from 'vs/base/common/iterator';
|
||||
import { INextIterator, ArrayIterator } from 'vs/base/common/iterator';
|
||||
import { Item } from './treeModel';
|
||||
|
||||
export interface IViewItem {
|
||||
@@ -30,7 +30,7 @@ export class HeightMap extends EventEmitter {
|
||||
return !last ? 0 : last.top + last.height;
|
||||
}
|
||||
|
||||
public onInsertItems(iterator: IIterator<Item>, afterItemId: string = null): number {
|
||||
public onInsertItems(iterator: INextIterator<Item>, afterItemId: string = null): number {
|
||||
var item: Item;
|
||||
var viewItem: IViewItem;
|
||||
var i: number, j: number;
|
||||
@@ -90,7 +90,7 @@ export class HeightMap extends EventEmitter {
|
||||
}
|
||||
|
||||
// Contiguous items
|
||||
public onRemoveItems(iterator: IIterator<string>): void {
|
||||
public onRemoveItems(iterator: INextIterator<string>): void {
|
||||
var itemId: string;
|
||||
var viewItem: IViewItem;
|
||||
var startIndex: number = null;
|
||||
@@ -139,7 +139,7 @@ export class HeightMap extends EventEmitter {
|
||||
}
|
||||
|
||||
// Ordered, but not necessarily contiguous items
|
||||
public onRefreshItems(iterator: IIterator<Item>): void {
|
||||
public onRefreshItems(iterator: INextIterator<Item>): void {
|
||||
var item: Item;
|
||||
var viewItem: IViewItem;
|
||||
var newHeight: number;
|
||||
@@ -240,4 +240,4 @@ export class HeightMap extends EventEmitter {
|
||||
this.heightMap = null;
|
||||
this.indexes = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
import assert = require('assert');
|
||||
import lifecycle = require('vs/base/common/lifecycle');
|
||||
import ee = require('vs/base/common/eventEmitter');
|
||||
import _ = require('vs/base/parts/tree/browser/tree');
|
||||
import WinJS = require('vs/base/common/winjs.base');
|
||||
import Events = require('vs/base/common/eventEmitter');
|
||||
@@ -75,7 +74,7 @@ class EventCounter {
|
||||
this._count = 0;
|
||||
}
|
||||
|
||||
public listen(emitter: ee.IEventEmitter, event: string, fn: (e) => void = null): () => void {
|
||||
public listen(emitter: Events.IEventEmitter, event: string, fn: (e) => void = null): () => void {
|
||||
let r = emitter.addListener(event, (e) => {
|
||||
this._count++;
|
||||
if (fn) {
|
||||
|
||||
Reference in New Issue
Block a user