SelectionHandler Class
Deprecated in 5.0 - will not be removed until after 2026-06-13. Use SelectionStorage from @itwin/unified-selection package instead.
A class that handles selection changes and helps to change internal the selection state.
Implements
- Disposable
Methods
| Name | Description | |
|---|---|---|
| constructor(props: SelectionHandlerProps): SelectionHandler | Constructor. | |
| [dispose](): void | Destructor. | |
| addToSelection(keys: Keys, level: number = 0): void | Add to selection. | |
| clearSelection(level: number = 0): void | Clear selection. | |
| dispose(): void | Deprecated | |
| getSelection(level?: number): Readonly<KeySet> | Get selection for the imodel managed by this handler. | |
| getSelectionLevels(): number[] | Get selection levels for the imodel managed by this handler | |
| onSelectionChanged(evt: SelectionChangeEventArgs, provider: ISelectionProvider): void Protected | Called when the selection changes. | |
| removeFromSelection(keys: Keys, level: number = 0): void | Remove from selection. | |
| replaceSelection(keys: Keys, level: number = 0): void | Change selection. | |
| shouldHandle(evt: SelectionChangeEventArgs): boolean Protected | Called to check whether the event should be handled by this handler |
Properties
| Name | Type | Description | |
|---|---|---|---|
| imodel | IModelConnection | iModel whose selection is being handled | |
| manager Readonly | SelectionManager | Selection manager used by this handler to manage selection | |
| name | string | Name that's used as SelectionChangeEventArgs.source when making selection changes |
|
| onSelect | SelectionChangesListener | undefined | Callback function called when selection changes | |
| rulesetId | string | undefined | Id of a ruleset selection changes will be associated with. |
Defined in
Last Updated: 28 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.