apptools.selection.i_selection_provider module¶
- class apptools.selection.i_selection_provider.ISelectionProvider(adaptee, default=<class 'traits.adaptation.adaptation_error.AdaptationError'>)[source]¶
Bases:
InterfaceSource of selections.
- get_selection()[source]¶
Return the current selection.
- Returns
- selection – ISelection
Object representing the current selection.
- provider_id = Str()¶
Unique ID identifying the provider.
- selection = Event¶
Event triggered when the selection changes. The content of the event is an
ISelectioninstance.
- set_selection(items, ignore_missing=False)[source]¶
Set the current selection to the given items.
If
ignore_missingisTrue, items that are not available in the selection provider are silently ignored. If it isFalse(default), anValueErrorshould be raised.- Parameters
list (items --) – List of items to be selected.
bool (ignore_missing --) – If
False(default), the provider raises an exception if any of the items initemsis not available to be selected. Otherwise, missing elements are silently ignored, and the rest is selected.