delete the widget content instance when a WidgetContentModel is deleted
962606
def _delete_widget_content(sender, instance, **kwargs):
    
    if not issubclass(sender, WidgetContentModel):
        return

    # delete WidgetContent Entry
    wcs = WidgetContent.objects.filter(
        content_pk=instance.pk,
        content_model=('%s' % instance.__class__).replace("<class '", '').replace("'>", ''))
    for wc in wcs:
        logger.debug('delete wc %r'%wc)
        wc.delete()
577412
protected void removeDecorationWidget(Widget widget, int width) {

        if ((widget != null) && m_decorationWidgets.remove(widget)) {
            m_decorationWidth -= width;
            initContent();
        }
    }
874194
def delete_event(self, widget, event, data=None):
        
        if not self.close_win:
            if self.thread.isAlive():
                dlg = self.gui_helper.create_message_dialog("Do you want to cancel project creation?",
                                                            buttons=Gtk.ButtonsType.YES_NO)
                response = dlg.run()
                if response == Gtk.ResponseType.YES:
                    if self.thread.isAlive():
                        self.info_label.set_label('<span color="#FFA500">Cancelling...</span>')
                        self.dev_assistant_runner.stop()
                        self.project_canceled = True
                    else:
                        self.info_label.set_label('<span color="#008000">Done</span>')
                    self.allow_close_window()
                dlg.destroy()
                return True
        else:
            return False
856687
function() {
			BaseEditor.prototype.destroy.call(this);
			this._textViewFactory = this._undoStackFactory = this._textDNDFactory = 
			this._annotationFactory = this._foldingRulerFactory = this._lineNumberRulerFactory = 
			this._contentAssistFactory = this._keyBindingFactory = this._hoverFactory = this._zoomRulerFactory = null;
		}
1027936
@Override
	public void setWidget( Widget w )
	{
		// Validate
		if( w == widget )
			return;

		// Detach new child.
		if( w != null )
			w.removeFromParent();

		// Remove old child.
		if( widget != null )
			remove( widget );

		// Logical attach.
		widget = w;

		if( w != null )
		{
			// Physical attach.
			DOM.appendChild( containerElement, widget.getElement() );

			adopt( w );
		}
	}
1339512
def destroy(self):
        
        widget = self.widget
        if widget is not None:
            parent = self.parent_widget()
            if parent is not None:
                parent.removeView(widget)
            del self.widget
        super(AndroidToolkitObject, self).destroy()
194733
def remove_widget(self):
        

        LOGGER.debug("> Removing '{0}' Component Widget.".format(self.__class__.__name__))

        self.__preferences_manager.findChild(QGridLayout, "Others_Preferences_gridLayout").removeWidget(self)
        self.TCP_Client_Ui_groupBox.setParent(None)

        return True
736340
function () {
            if (!this._pageConfigHelper) {
                return;
            }
            var lazyPlaceholders = this._pageConfigHelper.getLazyPlaceholdersIds();
            this._lazyContent = false;
            this.$raiseEvent({
                name : "contentChange",
                contentPaths : lazyPlaceholders
            });

            this._pageConfigHelper.$dispose();
        }
400165
def closePanel(self):
        
        # make sure we can close all the widgets in the view first
        for i in range(self.count()):
            if not self.widget(i).canClose():
                return False

        container = self.parentWidget()
        viewWidget = self.viewWidget()

        # close all the child views
        for i in xrange(self.count() - 1, -1, -1):
            self.widget(i).close()

        self.tabBar().clear()

        if isinstance(container, XSplitter):
            parent_container = container.parentWidget()
            
            if container.count() == 2:
                if isinstance(parent_container, XSplitter):
                    sizes = parent_container.sizes()
                    widget = container.widget(int(not container.indexOf(self)))
                    index = parent_container.indexOf(container)
                    parent_container.insertWidget(index, widget)
                    
                    container.setParent(None)
                    container.close()
                    container.deleteLater()
                    
                    parent_container.setSizes(sizes)
                
                elif parent_container.parentWidget() == viewWidget:
                    widget = container.widget(int(not container.indexOf(self)))
                    widget.setParent(viewWidget)
                    
                    if projexui.QT_WRAPPER == 'PySide':
                        _ = viewWidget.takeWidget()
                    else:
                        old_widget = viewWidget.widget()
                        old_widget.setParent(None)
                        old_widget.close()
                        old_widget.deleteLater()
                        QtGui.QApplication.instance().processEvents()
                    
                    viewWidget.setWidget(widget)
            else:
                container.setParent(None)
                container.close()
                container.deleteLater()
        else:
            self.setFocus()

        self._hintLabel.setText(self.hint())
        self._hintLabel.show()

        return True
1306921
public static void hideAndAfter(Element e, Widget widget) {
    assert e != null && widget != null;
    if ($(e).widget() != null && $(e).widget().isAttached()) {
      replaceWidget($(e).widget(), widget, false);
    } else {
      detachWidget(widget);
      hideAndAfter(e, widget.getElement());
      attachWidget(widget, getFirstParentWidget(widget));
    }
  }
383657
protected void masonryRemove(Widget target) {
        this.target = target;
        if (target != sizerDiv) {
            super.remove(target);
            reload();
        }
    }
1293725
function handleWidgetVisibilityChange( newVisible, previousVisible ) {
               widgetIsVisible = newVisible;
               if( newVisible && previousVisible === false && showContent && options.animationsEnabled ) {
                  startWatchingForContentResizing();
               }
               else {
                  stopWatchingForContentResizing();
               }
            }
300145
function() {
		if( this.isInitialised === false ) {
			return;
		}
		this._onUnload();
		$( window ).off( 'resize', this._resizeFunction );
		$( window ).off( 'unload beforeunload', this._unloadFunction );
		this.root.callDownwards( '_$destroy', [], true );
		this.root.contentItems = [];
		this.tabDropPlaceholder.remove();
		this.dropTargetIndicator.destroy();
		this.transitionIndicator.destroy();
		this.eventHub.destroy();

		this._dragSources.forEach( function( dragSource ) {
			dragSource._dragListener.destroy();
			dragSource._element = null;
			dragSource._itemConfig = null;
			dragSource._dragListener = null;
		} );
		this._dragSources = [];
	}
600442
public void setContentCentered(boolean contentCentered) {
        boolean oldVal = this.contentCentered;
        this.contentCentered = contentCentered;
        if (oldVal != this.contentCentered && content != null && content.isAttached()) {
            if (this.contentCentered) {
                centerContent();
                initWindowResize();
            } else {
                clearCenterContent();
            }
        }
    }
713822
function destroyEditOverlay() {
  if (overlay) {
    overlay.parentNode.removeChild(overlay);
    overlay = null;
  }

  document.removeEventListener('click', handleDocumentClick);
  document.removeEventListener('keyup', handleDocumentKeyup);
  document.removeEventListener('mousedown', handleDocumentMousedown);
  document.removeEventListener('mousemove', handleDocumentMousemove);
  document.removeEventListener('mouseup', handleDocumentMouseup);
  enableUserSelect();
}
500698
public void deleteInactiveContent() throws PatchingException {
        List<File> dirs = getInactiveHistory();
        if (!dirs.isEmpty()) {
            for (File dir : dirs) {
                deleteDir(dir, ALL);
            }
        }
        dirs = getInactiveOverlays();
        if (!dirs.isEmpty()) {
            for (File dir : dirs) {
                deleteDir(dir, ALL);
            }
        }
    }
1298638
public void destroy() {

        m_attributeName = null;
        m_attributeType = null;
        m_attributeValueViews.clear();
        m_attributeValueViews = null;
        m_dndHandler = null;
        m_entity = null;
        m_entityType = null;
        m_entityBackEnd = null;
        m_widgetService = null;
    }