Options
All
  • Public
  • Public/Protected
  • All
Menu

A cell list object that supports undo/redo.

Hierarchy

  • CellList

Implements

Index

Constructors

constructor

Properties

Private _cellMap

_cellMap: IObservableMap<ICellModel> = null

Private _cellOrder

_cellOrder: IObservableUndoableList<string> = null

Private _changed

_changed: Signal<this, IChangedArgs<ICellModel>> = new Signal<this, IObservableList.IChangedArgs<ICellModel>>(this)

Private _factory

_factory: IContentFactory = null

Private _isDisposed

_isDisposed: boolean = false

type

type: "List"

Accessors

canRedo

  • get canRedo(): boolean

canUndo

  • get canUndo(): boolean

changed

isDisposed

  • get isDisposed(): boolean

isEmpty

  • get isEmpty(): boolean
  • Test whether the list is empty.

    Returns boolean

    true if the cell list is empty, false otherwise.

    Notes

    This is a read-only property.

    Complexity

    Constant.

    Iterator Validity

    No changes.

length

  • get length(): number
  • Get the length of the cell list.

    Returns number

    The number of cells in the cell list.

    Notes

    This is a read-only property.

    Complexity

    Constant.

    Iterator Validity

    No changes.

Methods

Private _onOrderChanged

beginCompoundOperation

  • beginCompoundOperation(isUndoAble?: boolean): void

clear

  • clear(): void

clearUndo

  • clearUndo(): void

dispose

  • dispose(): void

endCompoundOperation

  • endCompoundOperation(): void

get

  • Get the cell at the specified index.

    Parameters

    • index: number

      The positive integer index of interest.

    Returns ICellModel

    The cell at the specified index.

    Complexity

    Constant.

    Iterator Validity

    No changes.

    Undefined Behavior

    An index which is non-integral or out of range.

insert

  • Insert a cell into the cell list at a specific index.

    Parameters

    • index: number

      The index at which to insert the cell.

    • cell: ICellModel

      The cell to set at the specified index.

    Returns void

    The new length of the cell list.

    Complexity

    Linear.

    Iterator Validity

    No changes.

    Notes

    The index will be clamped to the bounds of the cell list.

    Undefined Behavior

    An index which is non-integral.

    Notes

    This should be considered to transfer ownership of the cell to the CellList. As such, cell.dispose() should not be called by other actors.

insertAll

  • insertAll(index: number, cells: IterableOrArrayLike<ICellModel>): number
  • Insert a set of items into the cell list at the specified index.

    Parameters

    • index: number

      The index at which to insert the cells.

    • cells: IterableOrArrayLike<ICellModel>

      The cells to insert at the specified index.

    Returns number

    The new length of the cell list.

    Complexity.

    Linear.

    Iterator Validity

    No changes.

    Notes

    The index will be clamped to the bounds of the cell list.

    Undefined Behavior.

    An index which is non-integral.

    Notes

    This should be considered to transfer ownership of the cells to the CellList. As such, cell.dispose() should not be called by other actors.

iter

move

  • move(fromIndex: number, toIndex: number): void
  • Move a cell from one index to another.

    parm

    fromIndex - The index of the element to move.

    Parameters

    • fromIndex: number
    • toIndex: number

      The index to move the element to.

      Complexity

      Constant.

      Iterator Validity

      Iterators pointing at the lesser of the fromIndex and the toIndex and beyond are invalidated.

      Undefined Behavior

      A fromIndex or a toIndex which is non-integral.

    Returns void

push

  • Add a cell to the back of the cell list.

    Parameters

    • cell: ICellModel

      The cell to add to the back of the cell list.

    Returns number

    The new length of the cell list.

    Complexity

    Constant.

    Iterator Validity

    No changes.

    Notes

    This should be considered to transfer ownership of the cell to the CellList. As such, cell.dispose() should not be called by other actors.

pushAll

  • pushAll(cells: IterableOrArrayLike<ICellModel>): number
  • Push a set of cells to the back of the cell list.

    Parameters

    • cells: IterableOrArrayLike<ICellModel>

      An iterable or array-like set of cells to add.

    Returns number

    The new length of the cell list.

    Complexity

    Linear.

    Iterator Validity

    No changes.

    Notes

    This should be considered to transfer ownership of the cells to the CellList. As such, cell.dispose() should not be called by other actors.

redo

  • redo(): void

remove

  • Remove and return the cell at a specific index.

    Parameters

    • index: number

      The index of the cell of interest.

    Returns ICellModel

    The cell at the specified index, or undefined if the index is out of range.

    Complexity

    Constant.

    Iterator Validity

    Iterators pointing at the removed cell and beyond are invalidated.

    Undefined Behavior

    An index which is non-integral.

removeRange

  • removeRange(startIndex: number, endIndex: number): number
  • Remove a range of items from the cell list.

    Parameters

    • startIndex: number

      The start index of the range to remove (inclusive).

    • endIndex: number

      The end index of the range to remove (exclusive).

    Returns number

    The new length of the cell list.

    Complexity

    Linear.

    Iterator Validity

    Iterators pointing to the first removed cell and beyond are invalid.

    Undefined Behavior

    A startIndex or endIndex which is non-integral.

removeValue

  • Remove the first occurrence of a cell from the cell list.

    Parameters

    Returns number

    The index of the removed cell, or -1 if the cell is not contained in the cell list.

    Complexity

    Linear.

    Iterator Validity

    Iterators pointing at the removed cell and beyond are invalidated.

set

  • Set the cell at the specified index.

    Parameters

    • index: number

      The positive integer index of interest.

    • cell: ICellModel

      The cell to set at the specified index.

      Complexity

      Constant.

      Iterator Validity

      No changes.

      Undefined Behavior

      An index which is non-integral or out of range.

      Notes

      This should be considered to transfer ownership of the cell to the CellList. As such, cell.dispose() should not be called by other actors.

    Returns void

undo

  • undo(): void

Generated using TypeDoc