context: qx.Proto.destroyContent = function() {  if(this.hasContent()) {     var manager = this.getTree() ? this.getTree().getManager() : null;       var leadItem;    var anchorItem;    if(manager) {      leadItem = manager.getLeadItem();      anchorItem = manager.getAnchorItem();    }    // set the container objects display property    // to true so getChildren will retreive all    // children objects    this._containerObject.setDisplay(true);    var items = this._containerObject.getChildren();    var item;       for(var i=items.length-1;i>=0;--i) {      item = items[i];      // this.getItems seems to also contain "this".      // In order to avoid endless loops by calling      // recursively destroyContent we have to avoid      // destroying ourselves      if(item != this) {        if(manager) {          // set the leadItem to null if the current          // destroyed item is the leadItem          if(leadItem == item) {            manager.setLeadItem(null);          }          // set the anchorItem to null if the current          // destroyed item is the anchorItem          if(anchorItem == item) {            manager.setAnchorItem(null);          }           // if the current destroyed item is          // selected, deselect the item. If we are          // in single selection mode we have to          // call deselectAll because setItemSelected          // refuses to deselect in this case          if(manager.getItemSelected(item)) {            if(manager.getMultiSelection()) {              manager.setItemSelected(item,false);            }            else {              manager.deselectAll();            }          }           // if the item has the method destroyContent defined          // then it is a TreeFolder (and it's subclasses)          // which potentially have content which also          // has to be destroyed          if (item.destroyContent) {            item.destroyContent();          }        }           // first disconnect the item so rendering        // of the tree lines can be done correctly        item.removeFromTreeQueue();        item.disconnect();           // remove the item from the containerObject        this._containerObject.remove(item);        item.dispose();        delete items[i];      }    }  }}
meta: 1005	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1005/ad343543c36c591a38431574849066625b000531/TreeFolder.js/buggy/qooxdoo/frontend/framework/source/class/qx/ui/tree/TreeFolder.js