SelectionHandler Class

A class that handles selection changes and helps to change internal the selection state.

Implements

Methods

Name Description
constructor(manager: SelectionManager, name: string, imodel: IModelConnection, rulesetId?: string, onSelect?: SelectionChangesListener): SelectionHandler Constructor.  
addToSelection(keys: Keys, level: number = 0): void Add to selection.  
clearSelection(level: number = 0): void Clear selection.  
dispose(): void Destructor.  
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 SelectionManager Selection manager used by this handler to manage selection  
name string Name that's used as SelectionChangeEventArgs.source when making selection changes  
onSelect undefined | SelectionChangesListener Callback function called when selection changes  
rulesetId undefined | string ID of presentation ruleset used by the component using this handler.  

Defined in

Last Updated: 13 June, 2024