added Declarative table to model view controls (#1593)

* added Declarative table to model view controls
This commit is contained in:
Leila Lali
2018-06-11 12:40:17 -07:00
committed by GitHub
parent 3be0c5130a
commit 4609694141
12 changed files with 380 additions and 1 deletions

View File

@@ -130,6 +130,13 @@ class ModelBuilderImpl implements sqlops.ModelBuilder {
return builder;
}
declarativeTable(): sqlops.ComponentBuilder<sqlops.DeclarativeTableComponent> {
let id = this.getNextComponentId();
let builder: ComponentBuilderImpl<sqlops.DeclarativeTableComponent> = this.getComponentBuilder(new DeclarativeTableWrapper(this._proxy, this._handle, id), id);
this._componentBuilders.set(id, builder);
return builder;
}
dashboardWidget(widgetId: string): sqlops.ComponentBuilder<sqlops.DashboardWidgetComponent> {
let id = this.getNextComponentId();
let builder = this.getComponentBuilder<sqlops.DashboardWidgetComponent>(new ComponentWrapper(this._proxy, this._handle, ModelComponentTypes.DashboardWidget, id), id);
@@ -755,6 +762,35 @@ class DropDownWrapper extends ComponentWrapper implements sqlops.DropDownCompone
}
}
class DeclarativeTableWrapper extends ComponentWrapper implements sqlops.DeclarativeTableComponent {
constructor(proxy: MainThreadModelViewShape, handle: number, id: string) {
super(proxy, handle, ModelComponentTypes.DeclarativeTable, id);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<any>());
}
public get data(): any[][] {
return this.properties['data'];
}
public set data(v: any[][]) {
this.setProperty('data', v);
}
public get columns(): sqlops.DeclarativeTableColumn[] {
return this.properties['columns'];
}
public set columns(v: sqlops.DeclarativeTableColumn[]) {
this.setProperty('columns', v);
}
public get onDataChanged(): vscode.Event<any> {
let emitter = this._emitterMap.get(ComponentEventType.onDidChange);
return emitter && emitter.event;
}
}
class ListBoxWrapper extends ComponentWrapper implements sqlops.ListBoxComponent {
constructor(proxy: MainThreadModelViewShape, handle: number, id: string) {