def on_delete ( self ):
        """ Handles the user requesting to delete the currently selected items
            of the table.
        """
        # Get the selected row indices:
        indices = self.selected_indices[:]
        values  = self.selected_values[:]
        indices.reverse()

        # Make sure that we don't delete any rows while an editor is open in it
        self.grid.stop_editing_indices(indices)

        # Delete the selected rows:
        for i in indices:
            index, object = self.model.delete_filtered_item_at( i )
            self._add_undo( ListUndoItem( object  = self.object,
                                          name    = self.name,
                                          index   = index,
                                          removed = [ object ] ) )

        # Compute the new selection and set it:
        items = self.model.get_filtered_items()
        n     = len( items ) - 1
        indices.reverse()
        for i in range( len( indices ) - 1, -1, -1 ):
            if indices[i] > n:
                indices[i] = n
                if indices[i] < 0:
                    del indices[i]
                    del values[i]

        n = len( indices )
        if n > 0:
            if self.in_row_mode:
                self.set_selection(
                    list( set( [ items[i] for i in indices ] ) ) )
            else:
                self.set_extended_selection(
                    list( set( [ ( items[ indices[i] ], values[i][1] )
                                 for i in range( n ) ] ) ) )
        else:
            self._update_toolbar( False )

    #---------------------------------------------------------------------------
    #  Handles the user requesting to set the user preference items for the
    #  table:
    #---------------------------------------------------------------------------
dataset/ETHPy150Open enthought/traitsui/traitsui/wx/table_editor.py/TableEditor.on_delete/original