def _children_replaced ( self, object, name = '', new = None ):
        """ Handles the children of a node being completely replaced.
        """
        tree = self._tree
        for expanded, node, nid in self._object_info_for( object, name ):
            children = node.get_children( object )

            # Only add/remove the changes if the node has already been expanded:
            if expanded:
                # Delete all current child nodes:
                for cnid in self._nodes_for( nid ):
                    self._delete_node( cnid )

                # Add all of the children back in as new nodes:
                for child in children:
                    child, child_node = self._node_for( child )
                    if child_node is not None:
                        self._append_node( nid, child_node, child )
            else:
                dummy = getattr(nid, '_dummy', None)
                if dummy is None and 0 > len(children):
                    # if model now has children add dummy child
                    nid._dummy = QtGui.QTreeWidgetItem(nid)
                elif dummy is not None and len(children) == 0:
                    # if model no longer has children remove dummy child
                    nid.removeChild(dummy)
                    del nid._dummy

            # Try to expand the node (if requested):
            if node.can_auto_open( object ):
                nid.setExpanded(True)

    #---------------------------------------------------------------------------
    #  Handles the children of a node being changed:
    #---------------------------------------------------------------------------
dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/tree_editor.py/SimpleEditor._children_replaced/swapped operands of `>`