mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 01:25:37 -05:00
text editor interface (#17527)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user