Inherits from
- HasTraits: enthought.traits.has_traits.HasTraits
Method summary
- category(self, widget, parent, node)
- compare(self, widget, parent, node_a, node_b)
- is_sorter_trait(self, node, trait_name)
- sort(self, widget, parent, nodes)
Methods
- category(self, widget, parent, node)
Returns the category (an integer) for an node.
'parent' is the parent node. 'nodes' is the node to return the category for.
Categories are used to sort nodes into bins. The bins are arranged in ascending numeric order. The nodes within a bin are arranged as dictated by the sorter's 'compare' method.
By default all nodes are given the same category (0).
- compare(self, widget, parent, node_a, node_b)
Returns the result of comparing two nodes.
'widget' is the widget that we are sorting nodes for. 'parent' is the parent node. 'node_a' is the the first node to compare. 'node_b' is the the second node to compare.
- is_sorter_trait(self, node, trait_name)
Is the sorter affected by changes to a node's trait?
'node' is the node. 'trait_name' is the name of the trait.
Returns True if the sorter would be affected by changes to the trait named 'trait_name' on the specified node.
By default we return False.
- sort(self, widget, parent, nodes)
Sorts a list of nodes IN PLACE.
'widget' is the widget that we are sorting nodes for. 'parent' is the parent node. 'nodes' is the list of nodes to sort.
Returns the list that was sorted IN PLACE (for convenience).