text editor interface (#17527)

This commit is contained in:
Alan Ren
2021-10-28 13:23:33 -07:00
committed by GitHub
parent 447b969b5c
commit 12261aa7a2
4 changed files with 61 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ import { SaveTableChangesAction } from 'sql/workbench/contrib/tableDesigner/brow
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { DesignerPaneSeparator } from 'sql/platform/theme/common/colorRegistry';
import { TableDesignerTextEditor } from 'sql/workbench/contrib/tableDesigner/browser/tableDesignerTextEditor';
export class TableDesignerEditor extends EditorPane {
public static readonly ID: string = 'workbench.editor.tableDesigner';
@@ -59,7 +60,9 @@ export class TableDesignerEditor extends EditorPane {
this._saveChangesAction = this._instantiationService.createInstance(SaveTableChangesAction);
this._saveChangesAction.enabled = false;
actionbar.push(this._saveChangesAction, { icon: true, label: false });
this._designer = new Designer(designerContainer, this._contextViewService);
this._designer = new Designer(designerContainer, (editorContainer) => {
return this._instantiationService.createInstance(TableDesignerTextEditor, editorContainer);
}, this._contextViewService);
this._register(attachDesignerStyler(this._designer, this.themeService));
this._register(registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
const border = theme.getColor(DesignerPaneSeparator);

View File

@@ -0,0 +1,35 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { DesignerTextEditor } from 'sql/base/browser/ui/designer/interfaces';
import { Event, Emitter } from 'vs/base/common/event';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
// TODO: Implement the text editor
export class TableDesignerTextEditor implements DesignerTextEditor {
private _content: string;
private _readonly: boolean;
private _contentChangeEventEmitter: Emitter<string> = new Emitter<string>();
readonly onDidContentChange: Event<string> = this._contentChangeEventEmitter.event;
constructor(container: HTMLElement, @IInstantiationService instantiationService: IInstantiationService) {
}
get content(): string {
return this._content;
}
set content(val: string) {
this._content = val;
}
get readonly(): boolean {
return this._readonly;
}
set readonly(val: boolean) {
this._readonly = val;
}
}