An object that represents the selected items within a [[Spreadsheet]]

SpreadsheetSelection

new SpreadsheetSelection(a: Spreadsheet, b: SpreadsheetPane, c: boolean): SpreadsheetSelection

Returns SpreadsheetSelection

Inherited from: PropertyChangeNotifierExtended

propertyChanged: object
$t: Type
cellRangesAddress: string

Returns the cell that represents the active cell.

get activeCell(): SpreadsheetCell

Returns SpreadsheetCell

Returns the index of the selection group that contains the active cell.

get activeCellRangeIndex(): number

Returns number

Returns a read-only collection of the ranges of cells that are selected.

get cellRanges(): IList$1<SpreadsheetCellRange>

Returns IList$1<SpreadsheetCellRange>

Adds a new cell range for the specified cell and makes it the active cell.

addActiveCellRange(range: SpreadsheetCellRange, activeCell: SpreadsheetCell, extendRangeForMergedCells: boolean): boolean

Parameters

  • range: SpreadsheetCellRange

    The new range to add

  • activeCell: SpreadsheetCell

    The new active cell for which a new selection will be added. This must be a cell within 'range'.

  • extendRangeForMergedCells: boolean

    True to adjust the 'range' such that it contains any intersecting merged cells; otherwise false to use the range as it is.

Returns boolean

Adds a new range to the end of the [[cellRanges]]

addCellRange(range: SpreadsheetCellRange, extendRangeForMergedCells: boolean): void

Parameters

  • range: SpreadsheetCellRange

    The range to be added

  • extendRangeForMergedCells: boolean

    True to adjust the 'range' such that it contains any intersecting merged cells; otherwise false to use the range as it is.

Returns void

Inherited from: PropertyChangeNotifierExtended

addListener(a: ITypedPropertyChangeListener$2<any, string>, b: boolean): void

Parameters

  • a: ITypedPropertyChangeListener$2<any, string>
  • b: boolean

Returns void

Resets the [[cellRanges]] to a single range containing only the [[activeCell]]

clearCellRanges(): boolean

Returns boolean

Inherited from: PropertyChangeNotifierExtended

d(a: any, b: string, c: any): void

Parameters

  • a: any
  • b: string
  • c: any

Returns void

Inherited from: PropertyChangeNotifierExtended

onPropertyValueChanged(a: any, b: string, c: any): void

Parameters

  • a: any
  • b: string
  • c: any

Returns void

Inherited from: PropertyChangeNotifierExtended

removeListener(a: ITypedPropertyChangeListener$2<any, string>): void

Parameters

  • a: ITypedPropertyChangeListener$2<any, string>

Returns void

Replaces the range containing the [[activeCell]] with the specified range and using the specified cell as the new [[activeCell]].

replaceActiveCellRange(range: SpreadsheetCellRange, activeCell: SpreadsheetCell, extendRangeForMergedCells: boolean): boolean

Parameters

  • range: SpreadsheetCellRange

    The new range that will replace the range at index [[activeCellRangeIndex]].

  • activeCell: SpreadsheetCell

    The new active cell from within that range.

  • extendRangeForMergedCells: boolean

    True to adjust the 'range' such that it contains any intersecting merged cells; otherwise false to use the range as it is.

Returns boolean

Clears the current selection and uses the specified information to reinitialize the selection.

resetSelection(ranges: SpreadsheetCellRange[], activeCell: SpreadsheetCell, newActiveRangeIndex: number, extendRangeForMergedCells: boolean): boolean

Parameters

  • ranges: SpreadsheetCellRange[]

    The new selection ranges. There must be 1 or more ranges.

  • activeCell: SpreadsheetCell

    The cell to use for the [[activeCell]]. This must be within the specified 'ranges'.

  • newActiveRangeIndex: number

    The index of the range that contains the active cell.

  • extendRangeForMergedCells: boolean

    True to adjust the 'ranges' such that it contains any intersecting merged cells; otherwise false to use the range as it is.

Returns boolean

Changes the [[activeCell]] and [[activeCellRangeIndex]] to the specified values.

setActiveCell(cell: SpreadsheetCell, rangeIndex: number): boolean

Parameters

  • cell: SpreadsheetCell

    The selected cell to change to the active cell

  • rangeIndex: number

    Optionally the index of the range in the [[cellRanges]] that contains the specified cell.

Returns boolean

Deselect the cells in the specified range.

unselectRange(range: SpreadsheetCellRange): void

Parameters

Returns void