Delete both the selected widget and whatever it represents.
333546
def delete_selection(self):
        """"""
        selection = self.selection
        if selection is None:
            return
        if isinstance(selection, ArrowWidget):
            self.mainscreen.boardview.board.rm_arrow(
                selection.origin.name,
                selection.destination.name
            )
            selection.portal.delete()
        elif isinstance(selection, Spot):
            self.mainscreen.boardview.board.rm_spot(selection.name)
            selection.proxy.delete()
        else:
            assert isinstance(selection, Pawn)
            self.mainscreen.boardview.board.rm_pawn(selection.name)
            selection.proxy.delete()
        self.selection = None
1011314
def clear(self):
        """"""
        # Adapted from http://stackoverflow.com/a/13103617/1198772
        for i in reversed(list(range(self.extra_keywords_layout.count()))):
            self.extra_keywords_layout.itemAt(i).widget().setParent(None)
        self.widgets_dict = OrderedDict()
211079
private void unSelectAll()
    {
        final int n = selected.size();
        for (int i = 0; i < n; i++)
        {
            selected.get(i).onSelection(false);
        }
        selected.clear();
    }
841679
function() {
            this.element.off( "." + this.widgetName );
            if ( this._mouseMoveDelegate ) {
                this.document
                    .off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
                    .off( "mouseup." + this.widgetName, this._mouseUpDelegate );
            }
        }
522081
def empty(self):
        """"""
        self._selected_item = None
        self._selected_key = None
        super(ListView, self).empty()
72724
void cancelEdit() {

        m_handler.enableToolbarButtons();
        m_handler.activateSelection();
        m_handler.m_controller.setContentEditing(false);
        m_handler.m_controller.reInitInlineEditing();
        m_replaceElement = null;
        m_dependingElementId = null;
        m_currentElementId = null;
        m_editorOpened = false;
    }
56669
def uninit_ui(self):
        
        self.lay.removeWidget(self.tool_pb)
        self.tooltip.deleteLater()
        self.tool_pb.deleteLater()
559056
public void deselectItem() {

        getElement().removeClassName(I_CmsLayoutBundle.INSTANCE.contextmenuCss().selected());
        m_parentMenu.setSelectedItem(null);
    }
717303
def on_remove(self, widget, data=None):
        """"""

        path_list = None
        if self.view is not None:
            model, path_list = self.tree_view.get_selection().get_selected_rows()
        old_path = self.get_path()
        models = [self.list_store[path][self.MODEL_STORAGE_ID] for path in path_list] if path_list else []
        if models:
            try:
                self.remove_core_elements(models)
            except AttributeError as e:
                self._logger.warning("The respective core element of {1}.list_store couldn't be removed. -> {0}"
                                  "".format(e, self.__class__.__name__))
            if len(self.list_store) > 0:
                self.tree_view.set_cursor(min(old_path[0], len(self.list_store) - 1))
            return True
        else:
            self._logger.warning("Please select an element to be removed.")
1037922
def destroy(self):
        
        widget = self.widget
        if widget is not None:
            del self.widget
        super(UiKitToolkitObject, self).destroy()
1289597
def remove_widget(self, widget):
        

        self._grid_widgets = dict((key, val)
                                  for (key, val) in self._grid_widgets.items()
                                  if val[-1] != widget)

        self._need_solver_recreate = True
654947
public void remove( Widget w )
	{
		int index = indexOf( w );
		if( index == -1 )
		{
			throw new NoSuchElementException();
		}

		remove( index );
	}
325
private void resetOptionbar() {

        if (m_elementOptionBar != null) {
            if (getWidgetIndex(m_elementOptionBar) >= 0) {
                m_elementOptionBar.removeFromParent();
            }
            updateOptionBarPosition();
            insert(m_elementOptionBar, 0);
        }
    }
894439
function () {
            removeButtonEventHandlers.call(this);

            this._aButtons = null;

            var aForms = this.element.getElementsByTagName("form"),
                oForm;

            if (aForms.length > 0) {
                oForm = aForms[0];

                if (oForm) {
                    Event.purgeElement(oForm);
                    if (oForm.parentNode) {
                        oForm.parentNode.removeChild(oForm);
                    }
                    this.form = null;
                }
            }
            Dialog.superclass.destroy.call(this);
        }
22898
def clearLayout(layout):
    """"""
    while layout.count():
        child = layout.takeAt(0)
        child.widget().deleteLater()
1070450
def close(self):
        """"""
        if self.comm is not None:
            Widget.widgets.pop(self.model_id, None)
            self.comm.close()
            self.comm = None
            self._ipython_display_ = None
1237616
function removeSelectedOptions( combo )
	{
		combo = getSelect( combo );

		// Save the selected index
		var iSelectedIndex = getSelectedIndex( combo );

		// Remove all selected options.
		for ( var i = combo.getChildren().count() - 1 ; i >= 0 ; i-- )
		{
			if ( combo.getChild( i ).$.selected )
				combo.getChild( i ).remove();
		}

		// Reset the selection based on the original selected index.
		setSelectedIndex( combo, iSelectedIndex );
	}