mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 02:48:30 -05:00
Adding keyboard shortcuts for column resizing in slickgrid (#21100)
* Adding column resize keyboard shortcuts in slickgrid * Switching to standard keyboard evt * Adding comment for the functionality * Cleaning up code and adding more comments * Using quick input to get column resize width * Adding check for negative sizes * Fixing some stuff
This commit is contained in:
@@ -33,6 +33,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IEditorProgressService } from 'vs/platform/progress/common/progress';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
const ShowActionsText: string = nls.localize('dashboard.explorer.actions', "Show Actions");
|
||||
@@ -65,7 +66,8 @@ export class ExplorerTable extends Disposable {
|
||||
private readonly progressService: IEditorProgressService,
|
||||
private readonly logService: ILogService,
|
||||
private readonly dashboardService: IDashboardService,
|
||||
readonly accessibilityService: IAccessibilityService) {
|
||||
readonly accessibilityService: IAccessibilityService,
|
||||
readonly quickInputService: IQuickInputService) {
|
||||
super();
|
||||
this._explorerView = new ExplorerView(this.context);
|
||||
const connectionInfo = this.bootStrapService.connectionManagementService.connectionInfo;
|
||||
@@ -74,7 +76,7 @@ export class ExplorerTable extends Disposable {
|
||||
this._view = new TableDataView<Slick.SlickData>(undefined, undefined, undefined, (data: Slick.SlickData[]): Slick.SlickData[] => {
|
||||
return explorerFilter.filter(this._filterStr, data);
|
||||
});
|
||||
this._table = new Table<Slick.SlickData>(parentElement, accessibilityService, { dataProvider: this._view }, { forceFitColumns: true });
|
||||
this._table = new Table<Slick.SlickData>(parentElement, accessibilityService, quickInputService, { dataProvider: this._view }, { forceFitColumns: true });
|
||||
this._table.setSelectionModel(new RowSelectionModel());
|
||||
this._actionsColumn = new ButtonColumn<Slick.SlickData>({
|
||||
id: 'actions',
|
||||
|
||||
@@ -32,6 +32,7 @@ import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/work
|
||||
import { getFlavor } from 'sql/workbench/contrib/dashboard/browser/dashboardRegistry';
|
||||
import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardService';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
|
||||
@Component({
|
||||
selector: 'explorer-widget',
|
||||
@@ -62,6 +63,7 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
|
||||
@Inject(ICapabilitiesService) private readonly capabilitiesService: ICapabilitiesService,
|
||||
@Inject(IDashboardService) private readonly dashboardService: IDashboardService,
|
||||
@Inject(IAccessibilityService) private readonly accessibilityService: IAccessibilityService,
|
||||
@Inject(IQuickInputService) private readonly quickInputService: IQuickInputService,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef
|
||||
) {
|
||||
super(changeRef);
|
||||
@@ -95,7 +97,8 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
|
||||
this.progressService,
|
||||
this.logService,
|
||||
this.dashboardService,
|
||||
this.accessibilityService);
|
||||
this.accessibilityService,
|
||||
this.quickInputService);
|
||||
this._register(this._input);
|
||||
this._register(attachInputBoxStyler(this._input, this.themeService));
|
||||
this._register(this._table);
|
||||
|
||||
@@ -15,6 +15,7 @@ import { attachTableStyler } from 'sql/platform/theme/common/styler';
|
||||
import { CellSelectionModel } from 'sql/base/browser/ui/table/plugins/cellSelectionModel.plugin';
|
||||
import { IInsightsView, IInsightData } from 'sql/platform/dashboard/browser/insightRegistry';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
|
||||
@Component({
|
||||
template: ''
|
||||
@@ -27,7 +28,8 @@ export default class TableInsight extends Disposable implements IInsightsView, O
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ElementRef)) private _elementRef: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
@Inject(IAccessibilityService) private accessibilityService: IAccessibilityService
|
||||
@Inject(IAccessibilityService) private accessibilityService: IAccessibilityService,
|
||||
@Inject(IQuickInputService) private quickInputService: IQuickInputService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -63,7 +65,7 @@ export default class TableInsight extends Disposable implements IInsightsView, O
|
||||
|
||||
private createTable() {
|
||||
if (!this.table) {
|
||||
this.table = new Table(this._elementRef.nativeElement, this.accessibilityService, { dataProvider: this.dataView, columns: this.columns }, { showRowNumber: true });
|
||||
this.table = new Table(this._elementRef.nativeElement, this.accessibilityService, this.quickInputService, { dataProvider: this.dataView, columns: this.columns }, { showRowNumber: true });
|
||||
this.table.setSelectionModel(new CellSelectionModel());
|
||||
this._register(attachTableStyler(this.table, this.themeService));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user