mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
3190: Code and Text cells from tool bar (#3191)
* 3190: Code and Text cells from tool bar * 3190: Adding images under media folder and to css
This commit is contained in:
@@ -12,20 +12,24 @@ import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview
|
||||
|
||||
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
||||
import { INotebookModel } from 'sql/parts/notebook/models/modelInterfaces';
|
||||
import { CellTypes, CellType } from 'sql/parts/notebook/models/contracts';
|
||||
import { NotebookComponent } from 'sql/parts/notebook/notebook.component';
|
||||
|
||||
const msgLoading = localize('loading', 'Loading kernels...');
|
||||
|
||||
//Action to add a cell to notebook based on cell type(code/markdown).
|
||||
export class AddCellAction extends Action {
|
||||
public static ID = 'notebook.addCell';
|
||||
public static LABEL = 'Cell';
|
||||
public cellType: CellType;
|
||||
|
||||
constructor(
|
||||
id: string, label: string, cssClass: string
|
||||
) {
|
||||
super(AddCellAction.ID, AddCellAction.LABEL, 'newStepIcon');
|
||||
super(id, label, cssClass);
|
||||
}
|
||||
|
||||
public run(context: any): TPromise<boolean> {
|
||||
public run(context: NotebookComponent): TPromise<boolean> {
|
||||
return new TPromise<boolean>((resolve, reject) => {
|
||||
try {
|
||||
context.addCell(this.cellType);
|
||||
resolve(true);
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
|
||||
Reference in New Issue
Block a user