apptools.selection.i_selection_provider module¶
-
class
apptools.selection.i_selection_provider.
ISelectionProvider
(adaptee, default=<class 'traits.adaptation.adaptation_error.AdaptationError'>)[source]¶ Bases:
traits.has_traits.Interface
Source 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
ISelection
instance.
-
set_selection
(items, ignore_missing=False)[source]¶ Set the current selection to the given items.
If
ignore_missing
isTrue
, items that are not available in the selection provider are silently ignored. If it isFalse
(default), anValueError
should 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 initems
is not available to be selected. Otherwise, missing elements are silently ignored, and the rest is selected.
-