提交 2fa60b86 编写于 作者: R rebornix

remove unused edit types.

上级 54a2a821
......@@ -18,70 +18,6 @@ export interface ITextCellEditingDelegate {
updateCellMetadata?(index: number, newMetadata: NotebookCellMetadata): void;
}
export class InsertCellEdit implements IResourceUndoRedoElement {
type: UndoRedoElementType.Resource = UndoRedoElementType.Resource;
label: string = 'Insert Cell';
constructor(
public resource: URI,
private insertIndex: number,
private cell: NotebookCellTextModel,
private editingDelegate: ITextCellEditingDelegate,
private beforedSelections: number[] | undefined,
private endSelections: number[] | undefined
) {
}
undo(): void {
if (!this.editingDelegate.deleteCell) {
throw new Error('Notebook Delete Cell not implemented for Undo/Redo');
}
this.editingDelegate.deleteCell(this.insertIndex, this.beforedSelections);
}
redo(): void {
if (!this.editingDelegate.insertCell) {
throw new Error('Notebook Insert Cell not implemented for Undo/Redo');
}
this.editingDelegate.insertCell(this.insertIndex, this.cell, this.endSelections);
}
}
export class DeleteCellEdit implements IResourceUndoRedoElement {
type: UndoRedoElementType.Resource = UndoRedoElementType.Resource;
label: string = 'Delete Cell';
constructor(
public resource: URI,
private insertIndex: number,
private _cell: NotebookCellTextModel,
private editingDelegate: ITextCellEditingDelegate,
private beforedSelections: number[] | undefined,
private endSelections: number[] | undefined
) {
// save inmem text to `ICell`
// no needed any more as the text buffer is transfered to `raw_cell`
// this._rawCell.source = [cell.getText()];
}
undo(): void {
if (!this.editingDelegate.insertCell) {
throw new Error('Notebook Insert Cell not implemented for Undo/Redo');
}
this.editingDelegate.insertCell(this.insertIndex, this._cell, this.beforedSelections);
}
redo(): void {
if (!this.editingDelegate.deleteCell) {
throw new Error('Notebook Delete Cell not implemented for Undo/Redo');
}
this.editingDelegate.deleteCell(this.insertIndex, this.endSelections);
}
}
export class MoveCellEdit implements IResourceUndoRedoElement {
type: UndoRedoElementType.Resource = UndoRedoElementType.Resource;
label: string = 'Move Cell';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册