An object that represents the selected items within a [[Spreadsheet]]
Constructors
Section titled "Constructors"SpreadsheetSelection
new SpreadsheetSelection(a: Spreadsheet, b: SpreadsheetPane, c: boolean): SpreadsheetSelection Returns SpreadsheetSelection
Properties
Section titled "Properties"propertyChanged
Section titled "propertyChanged"Inherited from: PropertyChangeNotifierExtended
propertyChanged: object $t: Type cellRangesAddress
Section titled "cellRangesAddress"cellRangesAddress: string Accessors
Section titled "Accessors"activeCell
Section titled "activeCell"Returns the cell that represents the active cell.
get activeCell(): SpreadsheetCell Returns SpreadsheetCell
activeCellRangeIndex
Section titled "activeCellRangeIndex"Returns the index of the selection group that contains the active cell.
get activeCellRangeIndex(): number Returns number
cellRanges
Section titled "cellRanges"Returns a read-only collection of the ranges of cells that are selected.
get cellRanges(): IList$1<SpreadsheetCellRange> Returns IList$1<SpreadsheetCellRange>
Methods
Section titled "Methods"addActiveCellRange
Section titled "addActiveCellRange"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:
SpreadsheetCellRangeThe new range to add
- activeCell:
SpreadsheetCellThe new active cell for which a new selection will be added. This must be a cell within 'range'.
- extendRangeForMergedCells:
booleanTrue to adjust the 'range' such that it contains any intersecting merged cells; otherwise false to use the range as it is.
Returns boolean
addCellRange
Section titled "addCellRange"Adds a new range to the end of the [[cellRanges]]
addCellRange(range: SpreadsheetCellRange, extendRangeForMergedCells: boolean): void Parameters
- range:
SpreadsheetCellRangeThe range to be added
- extendRangeForMergedCells:
booleanTrue to adjust the 'range' such that it contains any intersecting merged cells; otherwise false to use the range as it is.
Returns void
addListener
Section titled "addListener"Inherited from: PropertyChangeNotifierExtended
addListener(a: ITypedPropertyChangeListener$2<any, string>, b: boolean): void Parameters
- a:
ITypedPropertyChangeListener$2<any, string> - b:
boolean
Returns void
clearCellRanges
Section titled "clearCellRanges"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
onPropertyValueChanged
Section titled "onPropertyValueChanged"Inherited from: PropertyChangeNotifierExtended
onPropertyValueChanged(a: any, b: string, c: any): void Parameters
- a:
any - b:
string - c:
any
Returns void
removeListener
Section titled "removeListener"Inherited from: PropertyChangeNotifierExtended
removeListener(a: ITypedPropertyChangeListener$2<any, string>): void Parameters
- a:
ITypedPropertyChangeListener$2<any, string>
Returns void
replaceActiveCellRange
Section titled "replaceActiveCellRange"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:
SpreadsheetCellRangeThe new range that will replace the range at index [[activeCellRangeIndex]].
- activeCell:
SpreadsheetCellThe new active cell from within that range.
- extendRangeForMergedCells:
booleanTrue to adjust the 'range' such that it contains any intersecting merged cells; otherwise false to use the range as it is.
Returns boolean
resetSelection
Section titled "resetSelection"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:
SpreadsheetCellThe cell to use for the [[activeCell]]. This must be within the specified 'ranges'.
- newActiveRangeIndex:
numberThe index of the range that contains the active cell.
- extendRangeForMergedCells:
booleanTrue to adjust the 'ranges' such that it contains any intersecting merged cells; otherwise false to use the range as it is.
Returns boolean
setActiveCell
Section titled "setActiveCell"Changes the [[activeCell]] and [[activeCellRangeIndex]] to the specified values.
setActiveCell(cell: SpreadsheetCell, rangeIndex: number): boolean Parameters
- cell:
SpreadsheetCellThe selected cell to change to the active cell
- rangeIndex:
numberOptionally the index of the range in the [[cellRanges]] that contains the specified cell.
Returns boolean
unselectRange
Section titled "unselectRange"Deselect the cells in the specified range.
unselectRange(range: SpreadsheetCellRange): void Parameters
- range:
SpreadsheetCellRangeThe range whose cells should be removed from the selection.