Add text editor component for model view (#2058)

* add text editor component for model view

* add comments
This commit is contained in:
Abbie Petchtes
2018-07-26 15:52:33 -07:00
committed by GitHub
parent 461a158ac3
commit ba011853a0
8 changed files with 349 additions and 10 deletions

View File

@@ -101,6 +101,13 @@ class ModelBuilderImpl implements sqlops.ModelBuilder {
return builder;
}
editor(): sqlops.ComponentBuilder<sqlops.EditorComponent> {
let id = this.getNextComponentId();
let builder: ComponentBuilderImpl<sqlops.EditorComponent> = this.getComponentBuilder(new EditorWrapper(this._proxy, this._handle, id), id);
this._componentBuilders.set(id, builder);
return builder;
}
button(): sqlops.ComponentBuilder<sqlops.ButtonComponent> {
let id = this.getNextComponentId();
let builder: ComponentBuilderImpl<sqlops.ButtonComponent> = this.getComponentBuilder(new ButtonWrapper(this._proxy, this._handle, id), id);
@@ -740,6 +747,28 @@ class WebViewWrapper extends ComponentWrapper implements sqlops.WebViewComponent
}
}
class EditorWrapper extends ComponentWrapper implements sqlops.EditorComponent {
constructor(proxy: MainThreadModelViewShape, handle: number, id: string) {
super(proxy, handle, ModelComponentTypes.Editor, id);
this.properties = {};
}
public get content(): string {
return this.properties['content'];
}
public set content(v: string) {
this.setProperty('content', v);
}
public get languageMode(): string {
return this.properties['languageMode'];
}
public set languageMode(v: string) {
this.setProperty('languageMode', v);
}
}
class RadioButtonWrapper extends ComponentWrapper implements sqlops.RadioButtonComponent {
constructor(proxy: MainThreadModelViewShape, handle: number, id: string) {