mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 01:25:36 -05:00
More builder removal (#4810)
* remove more builder references * formatting
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
|
||||
import 'vs/css!./media/connectionViewlet';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { Builder } from 'sql/base/browser/builder';
|
||||
import { Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
@@ -76,41 +75,31 @@ export class ConnectionViewlet extends Viewlet implements IConnectionsViewlet {
|
||||
});
|
||||
}
|
||||
|
||||
public create(parent: HTMLElement): Promise<void> {
|
||||
return new Promise<void>((resolve) => {
|
||||
super.create(parent);
|
||||
this._root = parent;
|
||||
let parentBuilder = new Builder(parent);
|
||||
parentBuilder.div({ class: 'server-explorer-viewlet' }, (viewletContainer) => {
|
||||
viewletContainer.div({ class: 'search-box' }, (searchBoxContainer) => {
|
||||
let searchServerString = localize('Search server names', 'Search server names');
|
||||
this._searchBox = new InputBox(
|
||||
searchBoxContainer.getHTMLElement(),
|
||||
null,
|
||||
{
|
||||
placeholder: searchServerString,
|
||||
actions: [this._clearSearchAction],
|
||||
ariaLabel: searchServerString
|
||||
}
|
||||
);
|
||||
public create(parent: HTMLElement): void {
|
||||
super.create(parent);
|
||||
this._root = parent;
|
||||
const viewletContainer = DOM.append(parent, DOM.$('div.server-explorer-viewlet'));
|
||||
const searchBoxContainer = DOM.append(viewletContainer, DOM.$('div.search-box'));
|
||||
this._searchBox = new InputBox(
|
||||
searchBoxContainer,
|
||||
null,
|
||||
{
|
||||
placeholder: localize('Search server names', 'Search server names'),
|
||||
actions: [this._clearSearchAction],
|
||||
ariaLabel: localize('Search server names', 'Search server names')
|
||||
}
|
||||
);
|
||||
|
||||
this._searchBox.onDidChange(() => {
|
||||
this.search(this._searchBox.value);
|
||||
});
|
||||
this._searchBox.onDidChange(() => {
|
||||
this.search(this._searchBox.value);
|
||||
});
|
||||
|
||||
// Theme styler
|
||||
this._toDisposeViewlet.push(attachInputBoxStyler(this._searchBox, this._themeService));
|
||||
// Theme styler
|
||||
this._toDisposeViewlet.push(attachInputBoxStyler(this._searchBox, this._themeService));
|
||||
|
||||
});
|
||||
viewletContainer.div({ Class: 'object-explorer-view' }, (viewContainer) => {
|
||||
this._serverTreeView.renderBody(viewContainer.getHTMLElement()).then(() => {
|
||||
resolve(null);
|
||||
}, error => {
|
||||
warn('render registered servers: ' + error);
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
});
|
||||
const viewContainer = DOM.append(viewletContainer, DOM.$('div.object-explorer-view'));
|
||||
this._serverTreeView.renderBody(viewContainer).then(undefined, error => {
|
||||
warn('render registered servers: ' + error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -18,12 +18,13 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { Builder } from 'sql/base/browser/builder';
|
||||
import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { ServerTreeView } from 'sql/parts/objectExplorer/viewlet/serverTreeView';
|
||||
import { ClearSearchAction, ActiveConnectionsFilterAction,
|
||||
AddServerAction, AddServerGroupAction } from 'sql/parts/objectExplorer/viewlet/connectionTreeAction';
|
||||
import {
|
||||
ClearSearchAction, ActiveConnectionsFilterAction,
|
||||
AddServerAction, AddServerGroupAction
|
||||
} from 'sql/parts/objectExplorer/viewlet/connectionTreeAction';
|
||||
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';
|
||||
import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
|
||||
@@ -75,36 +76,28 @@ export class ConnectionViewletPanel extends ViewletPanel {
|
||||
}
|
||||
|
||||
renderBody(container: HTMLElement): void {
|
||||
let parentBuilder = new Builder(container);
|
||||
parentBuilder.div({ class: 'server-explorer-viewlet' }, (viewletContainer) => {
|
||||
viewletContainer.div({ class: 'search-box' }, (searchBoxContainer) => {
|
||||
let searchServerString = localize('Search server names', 'Search server names');
|
||||
this._searchBox = new InputBox(
|
||||
searchBoxContainer.getHTMLElement(),
|
||||
null,
|
||||
{
|
||||
placeholder: searchServerString,
|
||||
actions: [this._clearSearchAction],
|
||||
ariaLabel: searchServerString
|
||||
}
|
||||
);
|
||||
const viewletContainer = DOM.append(container, DOM.$('div.server-explorer-viewlet'));
|
||||
const searchBoxContainer = DOM.append(viewletContainer, DOM.$('div.search-box'));
|
||||
this._searchBox = new InputBox(
|
||||
searchBoxContainer,
|
||||
null,
|
||||
{
|
||||
placeholder: localize('Search server names', 'Search server names'),
|
||||
actions: [this._clearSearchAction],
|
||||
ariaLabel: localize('Search server names', 'Search server names')
|
||||
}
|
||||
);
|
||||
|
||||
this._searchBox.onDidChange(() => {
|
||||
this.search(this._searchBox.value);
|
||||
});
|
||||
this._searchBox.onDidChange(() => {
|
||||
this.search(this._searchBox.value);
|
||||
});
|
||||
|
||||
// Theme styler
|
||||
this._toDisposeViewlet.push(attachInputBoxStyler(this._searchBox, this.themeService));
|
||||
// Theme styler
|
||||
this._toDisposeViewlet.push(attachInputBoxStyler(this._searchBox, this.themeService));
|
||||
|
||||
});
|
||||
viewletContainer.div({ Class: 'object-explorer-view' }, (viewContainer) => {
|
||||
this._serverTreeView.renderBody(viewContainer.getHTMLElement()).then(() => {
|
||||
Promise.resolve(null);
|
||||
}, error => {
|
||||
console.warn('render registered servers: ' + error);
|
||||
Promise.resolve(null);
|
||||
});
|
||||
});
|
||||
const viewContainer = DOM.append(viewletContainer, DOM.$('div.object-explorer-view'));
|
||||
this._serverTreeView.renderBody(viewContainer).then(undefined, error => {
|
||||
console.warn('render registered servers: ' + error);
|
||||
});
|
||||
this._root = container;
|
||||
}
|
||||
|
||||
@@ -10,17 +10,17 @@ import { Button } from 'sql/base/browser/ui/button/button';
|
||||
import { Modal } from 'sql/workbench/browser/modal/modal';
|
||||
import * as TelemetryKeys from 'sql/common/telemetryKeys';
|
||||
import { attachButtonStyler, attachModalDialogStyler } from 'sql/platform/theme/common/styler';
|
||||
import { Builder } from 'sql/base/browser/builder';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
|
||||
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
|
||||
export class WebViewDialog extends Modal {
|
||||
|
||||
@@ -85,29 +85,27 @@ export class WebViewDialog extends Modal {
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement) {
|
||||
new Builder(container).div({ 'class': 'webview-dialog' }, (bodyBuilder) => {
|
||||
this._body = bodyBuilder.getHTMLElement();
|
||||
this._body = DOM.append(container, DOM.$('div.webview-dialog'));
|
||||
|
||||
this._webview = this._instantiationService.createInstance(WebviewElement,
|
||||
this.layoutService.getContainer(Parts.EDITOR_PART),
|
||||
{},
|
||||
{
|
||||
allowScripts: true
|
||||
});
|
||||
this._webview = this._instantiationService.createInstance(WebviewElement,
|
||||
this.layoutService.getContainer(Parts.EDITOR_PART),
|
||||
{},
|
||||
{
|
||||
allowScripts: true
|
||||
});
|
||||
|
||||
this._webview.mountTo(this._body);
|
||||
this._webview.mountTo(this._body);
|
||||
|
||||
this._webview.style(this._themeService.getTheme());
|
||||
this._webview.style(this._themeService.getTheme());
|
||||
|
||||
this._webview.onMessage(message => {
|
||||
this._onMessage.fire(message);
|
||||
}, null, this.contentDisposables);
|
||||
this._webview.onMessage(message => {
|
||||
this._onMessage.fire(message);
|
||||
}, null, this.contentDisposables);
|
||||
|
||||
this._themeService.onThemeChange(theme => this._webview.style(theme), null, this.contentDisposables);
|
||||
this._themeService.onThemeChange(theme => this._webview.style(theme), null, this.contentDisposables);
|
||||
|
||||
this.contentDisposables.push(this._webview);
|
||||
this.contentDisposables.push(toDisposable(() => this._webview = null));
|
||||
});
|
||||
this.contentDisposables.push(this._webview);
|
||||
this.contentDisposables.push(toDisposable(() => this._webview = null));
|
||||
}
|
||||
|
||||
get onMessage(): Event<any> {
|
||||
|
||||
@@ -11,7 +11,6 @@ import { Modal } from 'sql/workbench/browser/modal/modal';
|
||||
import * as TelemetryKeys from 'sql/common/telemetryKeys';
|
||||
import { attachButtonStyler, attachModalDialogStyler } from 'sql/platform/theme/common/styler';
|
||||
|
||||
import { Builder } from 'sql/base/browser/builder';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
@@ -22,6 +21,7 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
|
||||
import { localize } from 'vs/nls';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
|
||||
const maxActions = 1;
|
||||
|
||||
@@ -54,9 +54,7 @@ export class ErrorMessageDialog extends Modal {
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement) {
|
||||
new Builder(container).div({ 'class': 'error-dialog' }, (bodyBuilder) => {
|
||||
this._body = bodyBuilder.getHTMLElement();
|
||||
});
|
||||
this._body = DOM.append(container, DOM.$('div.error-dialog'));
|
||||
}
|
||||
|
||||
public render() {
|
||||
@@ -99,10 +97,8 @@ export class ErrorMessageDialog extends Modal {
|
||||
}
|
||||
|
||||
private updateDialogBody(): void {
|
||||
let builder = new Builder(this._body).empty();
|
||||
builder.div({ class: 'error-message' }, (errorContainer) => {
|
||||
errorContainer.getHTMLElement().innerText = this._message;
|
||||
});
|
||||
DOM.clearNode(this._body);
|
||||
DOM.append(this._body, DOM.$('div.error-message')).innerText = this._message;
|
||||
}
|
||||
|
||||
private updateIconTitle(): void {
|
||||
|
||||
Reference in New Issue
Block a user