Conditional¶
No example available.
Declaration¶
- class enaml.core.conditional.Conditional(parent=None, **kwargs)[source]¶
Bases:
Pattern
A pattern object that represents conditional objects.
When the condition attribute is True, the conditional will create its child items and insert them into its parent; when False, the old items will be destroyed.
- Attributes:
- children
- condition
- destroyed
- initialized
- is_destroyed
- is_initialized
- items
- name
- parent
- pattern_nodes
Methods
child_added
(child)An overridden child added event handler.
child_moved
(child)A method invoked when a child is moved in the object.
child_node_intercept
(nodes, key, f_locals)Add a child subtree to this pattern.
child_removed
(child)A method invoked when a child is removed from the object.
destroy
()A reimplemented destructor.
find
(name[, regex])Find the first object in the subtree with the given name.
find_all
(name[, regex])Find all objects in the subtree with the given name.
freeze
Freeze the atom to prevent further modifications to its attributes.
get_member
Get the named member for the atom.
has_observer
Get whether the atom has the given observer for a given topic.
has_observers
Get whether the atom has observers for a given topic.
initialize
()A reimplemented initialization method.
insert_children
(before, insert)Insert children into this object at the given location.
members
()Get the members dictionary for the type.
notifications_enabled
Get whether notification is enabled for the atom.
notify
Call the registered observers for a given topic with positional and keyword arguments.
observe
Register an observer callback to observe changes on the given topic(s).
parent_changed
(old, new)A method invoked when the parent of the object changes.
Get a list of items created by the pattern.
Refresh the items of the pattern.
root_object
()Get the root object for this hierarchy.
set_notifications_enabled
Enable or disable notifications for the atom.
set_parent
(parent)Set the parent for this object.
suppress_notifications
()Disable member notifications within in a context.
traverse
([depth_first])Yield all of the objects in the tree, from this object down.
traverse_ancestors
([root])Yield all of the objects in the tree, from this object up.
unobserve
Unregister an observer callback for the given topic(s).
- condition¶
The condition variable. If this is True, a copy of the children will be inserted into the parent. Otherwise, the old copies will be destroyed.
- destroy()[source]¶
A reimplemented destructor.
The conditional will release the owned items on destruction.
- items¶
The list of items created by the conditional. This list should not be manipulated directly by user code.
No implementation found