Rename registeredServers to objectExplorer (#1093)

This commit is contained in:
Karl Burtram
2018-04-06 13:33:49 -07:00
committed by GitHub
parent 071b510fba
commit 3990719054
60 changed files with 95 additions and 95 deletions

View File

@@ -0,0 +1,86 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!sql/media/actionBarLabel';
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { localize } from 'vs/nls';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor, ToggleViewletAction } from 'vs/workbench/browser/viewlet';
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { Registry } from 'vs/platform/registry/common/platform';
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
import { VIEWLET_ID } from 'sql/parts/connection/common/connectionManagement';
import { ConnectionViewlet } from 'sql/parts/objectExplorer/viewlet/connectionViewlet';
// Viewlet Action
export class OpenConnectionsViewletAction extends ToggleViewletAction {
public static ID = VIEWLET_ID;
public static LABEL = 'Show Servers';
constructor(
id: string,
label: string,
@IViewletService viewletService: IViewletService,
@IWorkbenchEditorService editorService: IWorkbenchEditorService
) {
super(id, label, VIEWLET_ID, viewletService, editorService);
}
}
// Viewlet
const viewletDescriptor = new ViewletDescriptor(
ConnectionViewlet,
VIEWLET_ID,
'Servers',
'connectionViewlet',
-100
);
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets).registerViewlet(viewletDescriptor);
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets).setDefaultViewletId(VIEWLET_ID);
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
registry.registerWorkbenchAction(
new SyncActionDescriptor(
OpenConnectionsViewletAction,
OpenConnectionsViewletAction.ID,
OpenConnectionsViewletAction.LABEL,
{ primary: KeyMod.CtrlCmd | KeyCode.Shift | KeyCode.KEY_C }),
'View: Show Servers',
localize('registeredServers.view', "View")
);
let configurationRegistry = <IConfigurationRegistry>Registry.as(Extensions.Configuration);
configurationRegistry.registerConfiguration({
'id': 'databaseConnections',
'title': localize('databaseConnections', 'Database Connections'),
'type': 'object',
'properties': {
'datasource.connections': {
'description': localize('datasource.connections', 'data source connections'),
'type': 'array'
},
'datasource.connectionGroups': {
'description': localize('datasource.connectionGroups', 'data source groups'),
'type': 'array'
}
}
});
configurationRegistry.registerConfiguration({
'id': 'startupConfig',
'title': localize('startupConfig', 'Startup Configuration'),
'type': 'object',
'properties': {
'startup.alwaysShowServersView': {
'type': 'boolean',
'description': localize('startup.alwaysShowServersView', 'True for the Servers view to be shown on launch of SQL Operations Studio default; false if the last opened view should be shown'),
'default': true
}
}
});