mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 17:22:20 -05:00
added Declarative table to model view controls (#1593)
* added Declarative table to model view controls
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user