/*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
dojo._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dijit.Tree"],["require","dojo.fx"],["require","dojo.DeferredList"],["require","dijit._Widget"],["require","dijit._Templated"],["require","dijit._Container"],["require","dijit._Contained"],["require","dijit._CssStateMixin"],["require","dojo.cookie"],["require","dijit.tree.TreeStoreModel"],["require","dijit.tree.ForestStoreModel"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dijit.Tree"]){_4._hasResource["dijit.Tree"]=true;_4.provide("dijit.Tree");_4.require("dojo.fx");_4.require("dojo.DeferredList");_4.require("dijit._Widget");_4.require("dijit._Templated");_4.require("dijit._Container");_4.require("dijit._Contained");_4.require("dijit._CssStateMixin");_4.require("dojo.cookie");_4.declare("dijit._TreeNode",[_5._Widget,_5._Templated,_5._Container,_5._Contained,_5._CssStateMixin],{item:null,isTreeNode:true,label:"",isExpandable:null,isExpanded:false,state:"UNCHECKED",templateString:_4.cache("dijit","templates/TreeNode.html","
\n\t\t\t\n\t\t \n\t
\n
\n"),baseClass:"dijitTreeNode",cssStateNodes:{rowNode:"dijitTreeRow",labelNode:"dijitTreeLabel"},attributeMap:_4.delegate(_5._Widget.prototype.attributeMap,{label:{node:"labelNode",type:"innerText"},tooltip:{node:"rowNode",type:"attribute",attribute:"title"}}),postCreate:function(){this.inherited(arguments);this._setExpando();this._updateItemClasses(this.item);if(this.isExpandable){_5.setWaiState(this.labelNode,"expanded",this.isExpanded);}},_setIndentAttr:function(_7){this.indent=_7;var _8=(Math.max(_7,0)*this.tree._nodePixelIndent)+"px";_4.style(this.domNode,"backgroundPosition",_8+" 0px");_4.style(this.rowNode,this.isLeftToRight()?"paddingLeft":"paddingRight",_8);_4.forEach(this.getChildren(),function(_9){_9.set("indent",_7+1);});},markProcessing:function(){this.state="LOADING";this._setExpando(true);},unmarkProcessing:function(){this._setExpando(false);},_updateItemClasses:function(_a){var _b=this.tree,_c=_b.model;if(_b._v10Compat&&_a===_c.root){_a=null;}this._applyClassAndStyle(_a,"icon","Icon");this._applyClassAndStyle(_a,"label","Label");this._applyClassAndStyle(_a,"row","Row");},_applyClassAndStyle:function(_d,_e,_f){var _10="_"+_e+"Class";var _11=_e+"Node";if(this[_10]){_4.removeClass(this[_11],this[_10]);}this[_10]=this.tree["get"+_f+"Class"](_d,this.isExpanded);if(this[_10]){_4.addClass(this[_11],this[_10]);}_4.style(this[_11],this.tree["get"+_f+"Style"](_d,this.isExpanded)||{});},_updateLayout:function(){var _12=this.getParent();if(!_12||_12.rowNode.style.display=="none"){_4.addClass(this.domNode,"dijitTreeIsRoot");}else{_4.toggleClass(this.domNode,"dijitTreeIsLast",!this.getNextSibling());}},_setExpando:function(_13){var _14=["dijitTreeExpandoLoading","dijitTreeExpandoOpened","dijitTreeExpandoClosed","dijitTreeExpandoLeaf"],_15=["*","-","+","*"],idx=_13?0:(this.isExpandable?(this.isExpanded?1:2):3);_4.removeClass(this.expandoNode,_14);_4.addClass(this.expandoNode,_14[idx]);this.expandoNodeText.innerHTML=_15[idx];},expand:function(){if(this._expandDeferred){return this._expandDeferred;}this._wipeOut&&this._wipeOut.stop();this.isExpanded=true;_5.setWaiState(this.labelNode,"expanded","true");_5.setWaiRole(this.containerNode,"group");_4.addClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);if(this==this.tree.rootNode){_5.setWaiState(this.tree.domNode,"expanded","true");}var def,_16=_4.fx.wipeIn({node:this.containerNode,duration:_5.defaultDuration,onEnd:function(){def.callback(true);}});def=(this._expandDeferred=new _4.Deferred(function(){_16.stop();}));_16.play();return def;},collapse:function(){if(!this.isExpanded){return;}if(this._expandDeferred){this._expandDeferred.cancel();delete this._expandDeferred;}this.isExpanded=false;_5.setWaiState(this.labelNode,"expanded","false");if(this==this.tree.rootNode){_5.setWaiState(this.tree.domNode,"expanded","false");}_4.removeClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);if(!this._wipeOut){this._wipeOut=_4.fx.wipeOut({node:this.containerNode,duration:_5.defaultDuration});}this._wipeOut.play();},indent:0,setChildItems:function(_17){var _18=this.tree,_19=_18.model,_1a=[];_4.forEach(this.getChildren(),function(_1b){_5._Container.prototype.removeChild.call(this,_1b);},this);this.state="LOADED";if(_17&&_17.length>0){this.isExpandable=true;_4.forEach(_17,function(_1c){var id=_19.getIdentity(_1c),_1d=_18._itemNodesMap[id],_1e;if(_1d){for(var i=0;i<_1d.length;i++){if(_1d[i]&&!_1d[i].getParent()){_1e=_1d[i];_1e.set("indent",this.indent+1);break;}}}if(!_1e){_1e=this.tree._createTreeNode({item:_1c,tree:_18,isExpandable:_19.mayHaveChildren(_1c),label:_18.getLabel(_1c),tooltip:_18.getTooltip(_1c),dir:_18.dir,lang:_18.lang,indent:this.indent+1});if(_1d){_1d.push(_1e);}else{_18._itemNodesMap[id]=[_1e];}}this.addChild(_1e);if(this.tree.autoExpand||this.tree._state(_1c)){_1a.push(_18._expandNode(_1e));}},this);_4.forEach(this.getChildren(),function(_1f,idx){_1f._updateLayout();});}else{this.isExpandable=false;}if(this._setExpando){this._setExpando(false);}this._updateItemClasses(this.item);if(this==_18.rootNode){var fc=this.tree.showRoot?this:this.getChildren()[0];if(fc){fc.setFocusable(true);_18.lastFocused=fc;}else{_18.domNode.setAttribute("tabIndex","0");}}return new _4.DeferredList(_1a);},removeChild:function(_20){this.inherited(arguments);var _21=this.getChildren();if(_21.length==0){this.isExpandable=false;this.collapse();}_4.forEach(_21,function(_22){_22._updateLayout();});},makeExpandable:function(){this.isExpandable=true;this._setExpando(false);},_onLabelFocus:function(evt){this.tree._onNodeFocus(this);},setSelected:function(_23){_5.setWaiState(this.labelNode,"selected",_23);_4.toggleClass(this.rowNode,"dijitTreeRowSelected",_23);},setFocusable:function(_24){this.labelNode.setAttribute("tabIndex",_24?"0":"-1");},_onClick:function(evt){this.tree._onClick(this,evt);},_onDblClick:function(evt){this.tree._onDblClick(this,evt);},_onMouseEnter:function(evt){this.tree._onNodeMouseEnter(this,evt);},_onMouseLeave:function(evt){this.tree._onNodeMouseLeave(this,evt);}});_4.declare("dijit.Tree",[_5._Widget,_5._Templated],{store:null,model:null,query:null,label:"",showRoot:true,childrenAttr:["children"],path:[],selectedItem:null,openOnClick:false,openOnDblClick:false,templateString:_4.cache("dijit","templates/Tree.html","\n"),persist:true,autoExpand:false,dndController:null,dndParams:["onDndDrop","itemCreator","onDndCancel","checkAcceptance","checkItemAcceptance","dragThreshold","betweenThreshold"],onDndDrop:null,itemCreator:null,onDndCancel:null,checkAcceptance:null,checkItemAcceptance:null,dragThreshold:5,betweenThreshold:0,_nodePixelIndent:19,_publish:function(_25,_26){_4.publish(this.id,[_4.mixin({tree:this,event:_25},_26||{})]);},postMixInProperties:function(){this.tree=this;if(this.autoExpand){this.persist=false;}this._itemNodesMap={};if(!this.cookieName){this.cookieName=this.id+"SaveStateCookie";}this._loadDeferred=new _4.Deferred();this.inherited(arguments);},postCreate:function(){this._initState();if(!this.model){this._store2model();}this.connect(this.model,"onChange","_onItemChange");this.connect(this.model,"onChildrenChange","_onItemChildrenChange");this.connect(this.model,"onDelete","_onItemDelete");this._load();this.inherited(arguments);if(this.dndController){if(_4.isString(this.dndController)){this.dndController=_4.getObject(this.dndController);}var _27={};for(var i=0;i