/* Copyright (c) 2004-2006, The Dojo Foundation All Rights Reserved. Licensed under the Academic Free License version 2.1 or above OR the modified BSD license. For more information on Dojo licensing, see: http://dojotoolkit.org/community/licensing.shtml */ dojo.require("dojo.lang.declare"); dojo.provide("dojo.widget.TreeWithNode"); dojo.declare("dojo.widget.TreeWithNode",null,function(){ },{loadStates:{UNCHECKED:"UNCHECKED",LOADING:"LOADING",LOADED:"LOADED"},state:"UNCHECKED",objectId:"",isContainer:true,lockLevel:0,lock:function(){ this.lockLevel++; },unlock:function(){ if(!this.lockLevel){ dojo.raise(this.widgetType+" unlock: not locked"); } this.lockLevel--; },expandLevel:0,loadLevel:0,hasLock:function(){ return this.lockLevel>0; },isLocked:function(){ var _1=this; while(true){ if(_1.lockLevel){ return true; } if(!_1.parent||_1.isTree){ break; } _1=_1.parent; } return false; },flushLock:function(){ this.lockLevel=0; },actionIsDisabled:function(_2){ var _3=false; if(dojo.lang.inArray(this.actionsDisabled,_2)){ _3=true; } if(this.isTreeNode){ if(!this.tree.allowAddChildToLeaf&&_2==this.actions.ADDCHILD&&!this.isFolder){ _3=true; } } return _3; },actionIsDisabledNow:function(_4){ return this.actionIsDisabled(_4)||this.isLocked(); },setChildren:function(_5){ if(this.isTreeNode&&!this.isFolder){ this.setFolder(); }else{ if(this.isTreeNode){ this.state=this.loadStates.LOADED; } } var _6=this.children.length>0; if(_6&&_5){ this.destroyChildren(); } if(_5){ this.children=_5; } var _7=this.children.length>0; if(this.isTreeNode&&_7!=_6){ this.viewSetHasChildren(); } for(var i=0;i