mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from master
This commit is contained in:
@@ -59,7 +59,7 @@ export class OEAction extends ExecuteCommandAction {
|
||||
super(id, label, commandService);
|
||||
}
|
||||
|
||||
public async run(actionContext: any): TPromise<boolean> {
|
||||
public async run(actionContext: any): Promise<boolean> {
|
||||
this._treeSelectionHandler = this._instantiationService.createInstance(TreeSelectionHandler);
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ export class OEScriptSelectAction extends ScriptSelectAction {
|
||||
super(id, label, _queryEditorService, _connectionManagementService, _scriptingService);
|
||||
}
|
||||
|
||||
public async run(actionContext: any): TPromise<boolean> {
|
||||
public async run(actionContext: any): Promise<boolean> {
|
||||
this._treeSelectionHandler = this._instantiationService.createInstance(TreeSelectionHandler);
|
||||
if (actionContext instanceof ObjectExplorerActionsContext) {
|
||||
//set objectExplorerTreeNode for context menu clicks
|
||||
@@ -213,7 +213,7 @@ export class OEEditDataAction extends EditDataAction {
|
||||
super(id, label, _queryEditorService, _connectionManagementService, _scriptingService);
|
||||
}
|
||||
|
||||
public async run(actionContext: any): TPromise<boolean> {
|
||||
public async run(actionContext: any): Promise<boolean> {
|
||||
this._treeSelectionHandler = this._instantiationService.createInstance(TreeSelectionHandler);
|
||||
if (actionContext instanceof ObjectExplorerActionsContext) {
|
||||
//set objectExplorerTreeNode for context menu clicks
|
||||
@@ -247,7 +247,7 @@ export class OEScriptCreateAction extends ScriptCreateAction {
|
||||
super(id, label, _queryEditorService, _connectionManagementService, _scriptingService, _errorMessageService);
|
||||
}
|
||||
|
||||
public async run(actionContext: any): TPromise<boolean> {
|
||||
public async run(actionContext: any): Promise<boolean> {
|
||||
this._treeSelectionHandler = this._instantiationService.createInstance(TreeSelectionHandler);
|
||||
if (actionContext instanceof ObjectExplorerActionsContext) {
|
||||
//set objectExplorerTreeNode for context menu clicks
|
||||
@@ -283,7 +283,7 @@ export class OEScriptExecuteAction extends ScriptExecuteAction {
|
||||
super(id, label, _queryEditorService, _connectionManagementService, _scriptingService, _errorMessageService);
|
||||
}
|
||||
|
||||
public async run(actionContext: any): TPromise<boolean> {
|
||||
public async run(actionContext: any): Promise<boolean> {
|
||||
this._treeSelectionHandler = this._instantiationService.createInstance(TreeSelectionHandler);
|
||||
if (actionContext instanceof ObjectExplorerActionsContext) {
|
||||
//set objectExplorerTreeNode for context menu clicks
|
||||
@@ -319,7 +319,7 @@ export class OEScriptAlterAction extends ScriptAlterAction {
|
||||
super(id, label, _queryEditorService, _connectionManagementService, _scriptingService, _errorMessageService);
|
||||
}
|
||||
|
||||
public async run(actionContext: any): TPromise<boolean> {
|
||||
public async run(actionContext: any): Promise<boolean> {
|
||||
this._treeSelectionHandler = this._instantiationService.createInstance(TreeSelectionHandler);
|
||||
if (actionContext instanceof ObjectExplorerActionsContext) {
|
||||
//set objectExplorerTreeNode for context menu clicks
|
||||
@@ -355,7 +355,7 @@ export class OEScriptDeleteAction extends ScriptDeleteAction {
|
||||
super(id, label, _queryEditorService, _connectionManagementService, _scriptingService, _errorMessageService);
|
||||
}
|
||||
|
||||
public async run(actionContext: any): TPromise<boolean> {
|
||||
public async run(actionContext: any): Promise<boolean> {
|
||||
this._treeSelectionHandler = this._instantiationService.createInstance(TreeSelectionHandler);
|
||||
if (actionContext instanceof ObjectExplorerActionsContext) {
|
||||
//set objectExplorerTreeNode for context menu clicks
|
||||
|
||||
@@ -59,29 +59,29 @@ export class ServerTreeActionProvider extends ContributableActionProvider {
|
||||
/**
|
||||
* Return actions given an element in the tree
|
||||
*/
|
||||
public getActions(tree: ITree, element: any): TPromise<IAction[]> {
|
||||
public getActions(tree: ITree, element: any): IAction[] {
|
||||
if (element instanceof ConnectionProfile) {
|
||||
return TPromise.as(this.getConnectionActions(tree, element));
|
||||
return this.getConnectionActions(tree, element);
|
||||
}
|
||||
if (element instanceof ConnectionProfileGroup) {
|
||||
return TPromise.as(this.getConnectionProfileGroupActions(tree, element));
|
||||
return this.getConnectionProfileGroupActions(tree, element);
|
||||
}
|
||||
if (element instanceof TreeNode) {
|
||||
return TPromise.as(this.getObjectExplorerNodeActions({
|
||||
return this.getObjectExplorerNodeActions({
|
||||
tree: tree,
|
||||
profile: element.getConnectionProfile(),
|
||||
treeNode: element
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
return TPromise.as([]);
|
||||
return [];
|
||||
}
|
||||
|
||||
public hasSecondaryActions(tree: ITree, element: any): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
public getSecondaryActions(tree: ITree, element: any): TPromise<IAction[]> {
|
||||
public getSecondaryActions(tree: ITree, element: any): IAction[] {
|
||||
return super.getSecondaryActions(tree, element);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import 'vs/css!./media/serverTreeActions';
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import * as builder from 'vs/base/browser/builder';
|
||||
import * as builder from 'sql/base/browser/builder';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
@@ -100,7 +100,7 @@ export class ServerTreeView {
|
||||
if (!this._connectionManagementService.hasRegisteredServers()) {
|
||||
this._activeConnectionsFilterAction.enabled = false;
|
||||
this._buttonSection = $('div.button-section').appendTo(container);
|
||||
var connectButton = new Button(this._buttonSection);
|
||||
var connectButton = new Button(this._buttonSection.getHTMLElement());
|
||||
connectButton.label = localize('serverTree.addConnection', 'Add Connection');
|
||||
this._toDispose.push(attachButtonStyler(connectButton, this._themeService));
|
||||
this._toDispose.push(connectButton.onDidClick(() => {
|
||||
@@ -221,7 +221,7 @@ export class ServerTreeView {
|
||||
this._treeSelectionHandler.onTreeActionStateChange(false);
|
||||
});
|
||||
});
|
||||
}).done(null, errors.onUnexpectedError);
|
||||
}).then(null, errors.onUnexpectedError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ export class ServerTreeView {
|
||||
} else {
|
||||
treeInput = filteredResults[0];
|
||||
}
|
||||
this._tree.setInput(treeInput).done(() => {
|
||||
this._tree.setInput(treeInput).then(() => {
|
||||
if (this.messages.isHidden()) {
|
||||
self._tree.getFocus();
|
||||
self._tree.expandAll(ConnectionProfileGroup.getSubgroups(treeInput));
|
||||
@@ -346,7 +346,7 @@ export class ServerTreeView {
|
||||
// Add all connections to tree root and set tree input
|
||||
let treeInput = new ConnectionProfileGroup('searchroot', undefined, 'searchroot', undefined, undefined);
|
||||
treeInput.addConnections(filteredResults);
|
||||
this._tree.setInput(treeInput).done(() => {
|
||||
this._tree.setInput(treeInput).then(() => {
|
||||
if (this.messages.isHidden()) {
|
||||
self._tree.getFocus();
|
||||
self._tree.expandAll(ConnectionProfileGroup.getSubgroups(treeInput));
|
||||
|
||||
@@ -16,7 +16,7 @@ export class TreeSelectionHandler {
|
||||
progressRunner: IProgressRunner;
|
||||
|
||||
private _clicks: number = 0;
|
||||
private _doubleClickTimeoutId: number = -1;
|
||||
private _doubleClickTimeoutTimer: NodeJS.Timer = undefined;
|
||||
|
||||
constructor( @IProgressService private _progressService: IProgressService) {
|
||||
|
||||
@@ -47,8 +47,8 @@ export class TreeSelectionHandler {
|
||||
}
|
||||
|
||||
// clear pending click timeouts to avoid sending multiple events on double-click
|
||||
if (this._doubleClickTimeoutId !== -1) {
|
||||
clearTimeout(this._doubleClickTimeoutId);
|
||||
if (this._doubleClickTimeoutTimer) {
|
||||
clearTimeout(this._doubleClickTimeoutTimer);
|
||||
}
|
||||
|
||||
let isKeyboard = event && event.payload && event.payload.origin === 'keyboard';
|
||||
@@ -56,14 +56,14 @@ export class TreeSelectionHandler {
|
||||
// grab the current selection for use later
|
||||
let selection = tree.getSelection();
|
||||
|
||||
this._doubleClickTimeoutId = setTimeout(() => {
|
||||
this._doubleClickTimeoutTimer = setTimeout(() => {
|
||||
// don't send tree update events while dragging
|
||||
if (!TreeUpdateUtils.isInDragAndDrop) {
|
||||
let isDoubleClick = this._clicks > 1;
|
||||
this.handleTreeItemSelected(connectionManagementService, objectExplorerService, isDoubleClick, isKeyboard, selection, tree, connectionCompleteCallback);
|
||||
}
|
||||
this._clicks = 0;
|
||||
this._doubleClickTimeoutId = -1;
|
||||
this._doubleClickTimeoutTimer = undefined;
|
||||
}, 300);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export class TreeUpdateUtils {
|
||||
treeInput = TreeUpdateUtils.getTreeInput(connectionManagementService, providers);
|
||||
}
|
||||
|
||||
tree.setInput(treeInput).done(() => {
|
||||
tree.setInput(treeInput).then(() => {
|
||||
// Make sure to expand all folders that where expanded in the previous session
|
||||
if (targetsToExpand) {
|
||||
tree.expandAll(targetsToExpand);
|
||||
|
||||
Reference in New Issue
Block a user