You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2006/10/29 02:53:03 UTC

svn commit: r468816 [27/32] - in /tapestry/tapestry4/trunk/tapestry-framework: ./ src/java/org/apache/tapestry/dojo/form/ src/js/dojo/ src/js/dojo/nls/ src/js/dojo/src/ src/js/dojo/src/animation/ src/js/dojo/src/cal/ src/js/dojo/src/charting/ src/js/do...

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeLoadingControllerV3.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeLoadingControllerV3.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeLoadingControllerV3.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeLoadingControllerV3.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,41 @@
+
+dojo.provide("dojo.widget.TreeLoadingControllerV3");dojo.require("dojo.widget.TreeBasicControllerV3");dojo.require("dojo.event.*");dojo.require("dojo.json")
+dojo.require("dojo.io.*");dojo.require("dojo.Deferred");dojo.require("dojo.DeferredList");dojo.declare(
+"dojo.Error",Error,function(message, extra) {this.message = message;this.extra = extra;this.stack = (new Error()).stack;}
+);dojo.declare(
+"dojo.CommunicationError",dojo.Error,function() {this.name="CommunicationError";}
+);dojo.declare(
+"dojo.LockedError",dojo.Error,function() {this.name="LockedError";}
+);dojo.declare(
+"dojo.FormatError",dojo.Error,function() {this.name="FormatError";}
+);dojo.declare(
+"dojo.RpcError",dojo.Error,function() {this.name="RpcError";}
+);dojo.widget.defineWidget(
+"dojo.widget.TreeLoadingControllerV3",dojo.widget.TreeBasicControllerV3,{RpcUrl: "",RpcActionParam: "action",preventCache: true,checkValidRpcResponse: function(type, obj) {if (type != "load") {var extra = {}
+for(var i=1; i<arguments.length;i++) {dojo.lang.mixin(extra, arguments[i]);}
+return new dojo.CommunicationError(obj, extra);}
+if (typeof obj != 'object') {return new dojo.FormatError("Wrong server answer format "+(obj && obj.toSource ? obj.toSource() : obj)+" type "+(typeof obj), obj);}
+if (!dojo.lang.isUndefined(obj.error)) {return new dojo.RpcError(obj.error, obj);}
+return false;},getDeferredBindHandler: function( deferred){return dojo.lang.hitch(this,function(type, obj){var error = this.checkValidRpcResponse.apply(this, arguments);if (error) {deferred.errback(error);return;}
+deferred.callback(obj);}
+);},getRpcUrl: function(action) {if (this.RpcUrl == "local") {var dir = document.location.href.substr(0, document.location.href.lastIndexOf('/'));var localUrl = dir+"/local/"+action;return localUrl;}
+if (!this.RpcUrl) {dojo.raise("Empty RpcUrl: can't load");}
+var url = this.RpcUrl;if (url.indexOf("/") != 0) {var protocol = document.location.href.replace(/:\/\/.*/,'');var prefix = document.location.href.substring(protocol.length+3);if (prefix.lastIndexOf("/") != prefix.length-1) {prefix = prefix.replace(/\/[^\/]+$/,'/');}
+if (prefix.lastIndexOf("/") != prefix.length-1) {prefix = prefix+'/';}
+url = protocol + '://' + prefix + url;}
+return url + (url.indexOf("?")>-1 ? "&" : "?") + this.RpcActionParam+"="+action;},loadProcessResponse: function(node, result) {if (!dojo.lang.isArray(result)) {throw new dojo.FormatError('loadProcessResponse: Not array loaded: '+result);}
+node.setChildren(result);},runRpc: function(kw) {var _this = this;var deferred = new dojo.Deferred();dojo.io.bind({url: kw.url,handle: this.getDeferredBindHandler(deferred),mimetype: "text/javascript",preventCache: this.preventCache,sync: kw.sync,content: { data: dojo.json.serialize(kw.params) }});return deferred;},loadRemote: function(node, sync){var _this = this;var params = {node: this.getInfo(node),tree: this.getInfo(node.tree)};var deferred = this.runRpc({url: this.getRpcUrl('getChildren'),sync: sync,params: params});deferred.addCallback(function(res) { return _this.loadProcessResponse(node,res) });return deferred;},batchExpandTimeout: 0,recurseToLevel: function(widget, level, callFunc, callObj, skipFirst, sync) {if (level == 0) return;if (!skipFirst) {var deferred = callFunc.call(callObj, widget, sync);} else {var deferred = dojo.Deferred.prototype.makeCalled();}
+var _this = this;var recurseOnExpand = function() {var children = widget.children;var deferreds = [];for(var i=0; i<children.length; i++) {deferreds.push(_this.recurseToLevel(children[i], level-1, callFunc, callObj, sync));}
+return new dojo.DeferredList(deferreds);}
+deferred.addCallback(recurseOnExpand);return deferred;},expandToLevel: function(nodeOrTree, level, sync) {return this.recurseToLevel(nodeOrTree, nodeOrTree.isTree ? level+1 : level, this.expand, this, nodeOrTree.isTree, sync);},loadToLevel: function(nodeOrTree, level, sync) {return this.recurseToLevel(nodeOrTree, nodeOrTree.isTree ? level+1 : level, this.loadIfNeeded, this, nodeOrTree.isTree, sync);},loadAll: function(nodeOrTree, sync) {return this.loadToLevel(nodeOrTree, Number.POSITIVE_INFINITY, sync);},expand: function(node, sync) {var _this = this;var deferred = this.startProcessing(node);deferred.addCallback(function() {return _this.loadIfNeeded(node, sync);});deferred.addCallback(function(res) {dojo.widget.TreeBasicControllerV3.prototype.expand(node);return res;});deferred.addBoth(function(res) {_this.finishProcessing(node);return res;});return deferred;},loadIfNeeded: function(node, sync) {var deferred
+if (node.state == node.loadStates.UNCHECKED && node.isFolder && !node.children.length) {deferred = this.loadRemote(node, sync);} else {deferred = new dojo.Deferred();deferred.callback();}
+return deferred;},runStages: function(check, prepare, make, finalize, expose, args) {var _this = this;if (check && !check.apply(this, args)) {return false;}
+var deferred = dojo.Deferred.prototype.makeCalled();if (prepare) {deferred.addCallback(function() {return prepare.apply(_this, args);});}
+if (make) {deferred.addCallback(function() {var res = make.apply(_this, args);return res;});}
+if (finalize) {deferred.addBoth(function(res) {finalize.apply(_this, args);return res;});}
+if (expose) {deferred.addCallback(function(res) {expose.apply(_this, args);return res;});}
+return deferred;},startProcessing: function(nodesArray) {var deferred = new dojo.Deferred();var nodes = dojo.lang.isArray(nodesArray) ? nodesArray : arguments;for(var i=0;i<nodes.length;i++) {if (nodes[i].isLocked()) {deferred.errback(new dojo.LockedError("item locked "+nodes[i], nodes[i]));return deferred;}
+if (nodes[i].isTreeNode) {nodes[i].markProcessing();}
+nodes[i].lock();}
+deferred.callback();return deferred;},finishProcessing: function(nodesArray) {var nodes = dojo.lang.isArray(nodesArray) ? nodesArray : arguments;for(var i=0;i<nodes.length;i++) {if (!nodes[i].hasLock()) {continue;}
+nodes[i].unlock();if (nodes[i].isTreeNode) {nodes[i].unmarkProcessing();}}},refreshChildren: function(nodeOrTree, sync) {return this.runStages(null, this.prepareRefreshChildren, this.doRefreshChildren, this.finalizeRefreshChildren, this.exposeRefreshChildren, arguments);},prepareRefreshChildren: function(nodeOrTree, sync) {var deferred = this.startProcessing(nodeOrTree);nodeOrTree.destroyChildren();nodeOrTree.state = nodeOrTree.loadStates.UNCHECKED;return deferred;},doRefreshChildren: function(nodeOrTree, sync) {return this.loadRemote(nodeOrTree, sync);},finalizeRefreshChildren: function(nodeOrTree, sync) {this.finishProcessing(nodeOrTree);},exposeRefreshChildren: function(nodeOrTree, sync) {nodeOrTree.expand();},move: function(child, newParent, index) {return this.runStages(this.canMove, this.prepareMove, this.doMove, this.finalizeMove, this.exposeMove, arguments);},doMove: function(child, newParent, index) {child.tree.move(child, newParent, index);return true;},prepareMove
 : function(child, newParent, index, sync) {var deferred = this.startProcessing(newParent);deferred.addCallback(dojo.lang.hitch(this, function() {return this.loadIfNeeded(newParent, sync);}));return deferred;},finalizeMove: function(child, newParent) {this.finishProcessing(newParent);},prepareCreateChild: function(parent, index, data, sync) {var deferred = this.startProcessing(parent);deferred.addCallback(dojo.lang.hitch(this, function() {return this.loadIfNeeded(parent, sync);}));return deferred;},finalizeCreateChild: function(parent) {this.finishProcessing(parent);},prepareClone: function(child, newParent, index, deep, sync) {var deferred = this.startProcessing(child, newParent);deferred.addCallback(dojo.lang.hitch(this, function() {return this.loadIfNeeded(newParent, sync);}));return deferred;},finalizeClone: function(child, newParent) {this.finishProcessing(child, newParent);}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeLoadingControllerV3.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeNode.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeNode.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeNode.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeNode.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,31 @@
+
+dojo.provide("dojo.widget.TreeNode");dojo.require("dojo.html.*");dojo.require("dojo.event.*");dojo.require("dojo.io.*");dojo.widget.defineWidget("dojo.widget.TreeNode", dojo.widget.HtmlWidget, function() {this.actionsDisabled = [];},{widgetType: "TreeNode",loadStates: {UNCHECKED: "UNCHECKED",LOADING: "LOADING",LOADED: "LOADED"},actions: {MOVE: "MOVE",REMOVE: "REMOVE",EDIT: "EDIT",ADDCHILD: "ADDCHILD"},isContainer: true,lockLevel: 0,templateString: ('<div class="dojoTreeNode"> '
++ '<span treeNode="${this.widgetId}" class="dojoTreeNodeLabel" dojoAttachPoint="labelNode"> '
++ '		<span dojoAttachPoint="titleNode" dojoAttachEvent="onClick: onTitleClick" class="dojoTreeNodeLabelTitle">${this.title}</span> '
++ '</span> '
++ '<span class="dojoTreeNodeAfterLabel" dojoAttachPoint="afterLabelNode">${this.afterLabel}</span> '
++ '<div dojoAttachPoint="containerNode" style="display:none"></div> '
++ '</div>').replace(/(>|<)\s+/g, '$1'),childIconSrc: "",childIconFolderSrc: dojo.uri.dojoUri("src/widget/templates/images/Tree/closed.gif"),childIconDocumentSrc: dojo.uri.dojoUri("src/widget/templates/images/Tree/document.gif"),childIcon: null,isTreeNode: true,objectId: "",afterLabel: "",afterLabelNode: null,expandIcon: null,title: "",object: "",isFolder: false,labelNode: null,titleNode: null,imgs: null,expandLevel: "",tree: null,depth: 0,isExpanded: false,state: null,domNodeInitialized: false,isFirstChild: function() {return this.getParentIndex() == 0 ? true: false;},isLastChild: function() {return this.getParentIndex() == this.parent.children.length-1 ? true : false;},lock: function(){ return this.tree.lock.apply(this, arguments) },unlock: function(){ return this.tree.unlock.apply(this, arguments) },isLocked: function(){ return this.tree.isLocked.apply(this, arguments) },cleanLock: function(){ return this.tree.cleanLock.apply(this, arguments) },actionIsDisabled: function(a
 ction) {var _this = this;var disabled = false;if (this.tree.strictFolders && action == this.actions.ADDCHILD && !this.isFolder) {disabled = true;}
+if (dojo.lang.inArray(_this.actionsDisabled, action)) {disabled = true;}
+if (this.isLocked()) {disabled = true;}
+return disabled;},getInfo: function() {var info = {widgetId: this.widgetId,objectId: this.objectId,index: this.getParentIndex(),isFolder: this.isFolder}
+return info;},initialize: function(args, frag){this.state = this.loadStates.UNCHECKED;for(var i=0; i<this.actionsDisabled.length; i++) {this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();}
+this.expandLevel = parseInt(this.expandLevel);},adjustDepth: function(depthDiff) {for(var i=0; i<this.children.length; i++) {this.children[i].adjustDepth(depthDiff);}
+this.depth += depthDiff;if (depthDiff>0) {for(var i=0; i<depthDiff; i++) {var img = this.tree.makeBlankImg();this.imgs.unshift(img);dojo.html.insertBefore(this.imgs[0], this.domNode.firstChild);}}
+if (depthDiff<0) {for(var i=0; i<-depthDiff;i++) {this.imgs.shift();dojo.html.removeNode(this.domNode.firstChild);}}},markLoading: function() {this._markLoadingSavedIcon = this.expandIcon.src;this.expandIcon.src = this.tree.expandIconSrcLoading;},unMarkLoading: function() {if (!this._markLoadingSavedIcon) return;var im = new Image();im.src = this.tree.expandIconSrcLoading;if (this.expandIcon.src == im.src) {this.expandIcon.src = this._markLoadingSavedIcon;}
+this._markLoadingSavedIcon = null;},setFolder: function() {dojo.event.connect(this.expandIcon, 'onclick', this, 'onTreeClick');this.expandIcon.src = this.isExpanded ? this.tree.expandIconSrcMinus : this.tree.expandIconSrcPlus;this.isFolder = true;},createDOMNode: function(tree, depth){this.tree = tree;this.depth = depth;this.imgs = [];for(var i=0; i<this.depth+1; i++){var img = this.tree.makeBlankImg();this.domNode.insertBefore(img, this.labelNode);this.imgs.push(img);}
+this.expandIcon = this.imgs[this.imgs.length-1];this.childIcon = this.tree.makeBlankImg();this.imgs.push(this.childIcon);dojo.html.insertBefore(this.childIcon, this.titleNode);if (this.children.length || this.isFolder) {this.setFolder();}
+else {this.state = this.loadStates.LOADED;}
+dojo.event.connect(this.childIcon, 'onclick', this, 'onIconClick');for(var i=0; i<this.children.length; i++){this.children[i].parent = this;var node = this.children[i].createDOMNode(this.tree, this.depth+1);this.containerNode.appendChild(node);}
+if (this.children.length) {this.state = this.loadStates.LOADED;}
+this.updateIcons();this.domNodeInitialized = true;dojo.event.topic.publish(this.tree.eventNames.createDOMNode, { source: this } );return this.domNode;},onTreeClick: function(e){dojo.event.topic.publish(this.tree.eventNames.treeClick, { source: this, event: e });},onIconClick: function(e){dojo.event.topic.publish(this.tree.eventNames.iconClick, { source: this, event: e });},onTitleClick: function(e){dojo.event.topic.publish(this.tree.eventNames.titleClick, { source: this, event: e });},markSelected: function() {dojo.html.addClass(this.titleNode, 'dojoTreeNodeLabelSelected');},unMarkSelected: function() {dojo.html.removeClass(this.titleNode, 'dojoTreeNodeLabelSelected');},updateExpandIcon: function() {if (this.isFolder){this.expandIcon.src = this.isExpanded ? this.tree.expandIconSrcMinus : this.tree.expandIconSrcPlus;} else {this.expandIcon.src = this.tree.blankIconSrc;}},updateExpandGrid: function() {if (this.tree.showGrid){if (this.depth){this.setGridImage(-2, this.isLastChi
 ld() ? this.tree.gridIconSrcL : this.tree.gridIconSrcT);}else{if (this.isFirstChild()){this.setGridImage(-2, this.isLastChild() ? this.tree.gridIconSrcX : this.tree.gridIconSrcY);}else{this.setGridImage(-2, this.isLastChild() ? this.tree.gridIconSrcL : this.tree.gridIconSrcT);}}}else{this.setGridImage(-2, this.tree.blankIconSrc);}},updateChildGrid: function() {if ((this.depth || this.tree.showRootGrid) && this.tree.showGrid){this.setGridImage(-1, (this.children.length && this.isExpanded) ? this.tree.gridIconSrcP : this.tree.gridIconSrcC);}else{if (this.tree.showGrid && !this.tree.showRootGrid){this.setGridImage(-1, (this.children.length && this.isExpanded) ? this.tree.gridIconSrcZ : this.tree.blankIconSrc);}else{this.setGridImage(-1, this.tree.blankIconSrc);}}},updateParentGrid: function() {var parent = this.parent;for(var i=0; i<this.depth; i++){var idx = this.imgs.length-(3+i);var img = (this.tree.showGrid && !parent.isLastChild()) ? this.tree.gridIconSrcV : this.tree.blan
 kIconSrc;this.setGridImage(idx, img);parent = parent.parent;}},updateExpandGridColumn: function() {if (!this.tree.showGrid) return;var _this = this;var icon = this.isLastChild() ? this.tree.blankIconSrc : this.tree.gridIconSrcV;dojo.lang.forEach(_this.getDescendants(),function(node) { node.setGridImage(_this.depth, icon); }
+);this.updateExpandGrid();},updateIcons: function(){this.imgs[0].style.display = this.tree.showRootGrid ? 'inline' : 'none';this.buildChildIcon();this.updateExpandGrid();this.updateChildGrid();this.updateParentGrid();dojo.profile.stop("updateIcons")},buildChildIcon: function() {if(this.childIconSrc){this.childIcon.src = this.childIconSrc;}
+this.childIcon.style.display = this.childIconSrc ? 'inline' : 'none';},setGridImage: function(idx, src){if (idx < 0){idx = this.imgs.length + idx;}
+this.imgs[idx].style.backgroundImage = 'url(' + src + ')';},updateIconTree: function(){this.tree.updateIconTree.call(this);},expand: function(){if (this.isExpanded) return;if (this.children.length) {this.showChildren();}
+this.isExpanded = true;this.updateExpandIcon();dojo.event.topic.publish(this.tree.eventNames.expand, {source: this} );},collapse: function(){if (!this.isExpanded) return;this.hideChildren();this.isExpanded = false;this.updateExpandIcon();dojo.event.topic.publish(this.tree.eventNames.collapse, {source: this} );},hideChildren: function(){this.tree.toggleObj.hide(
+this.containerNode, this.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onHide")
+);if(dojo.exists(dojo, 'dnd.dragManager.dragObjects') && dojo.dnd.dragManager.dragObjects.length) {dojo.dnd.dragManager.cacheTargetLocations();}},showChildren: function(){this.tree.toggleObj.show(
+this.containerNode, this.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onShow")
+);if(dojo.exists(dojo, 'dnd.dragManager.dragObjects') && dojo.dnd.dragManager.dragObjects.length) {dojo.dnd.dragManager.cacheTargetLocations();}},addChild: function(){return this.tree.addChild.apply(this, arguments);},doAddChild: function(){return this.tree.doAddChild.apply(this, arguments);},edit: function(props) {dojo.lang.mixin(this, props);if (props.title) {this.titleNode.innerHTML = this.title;}
+if (props.afterLabel) {this.afterLabelNode.innerHTML = this.afterLabel;}
+if (props.childIconSrc) {this.buildChildIcon();}},removeNode: function(){ return this.tree.removeNode.apply(this, arguments) },doRemoveNode: function(){ return this.tree.doRemoveNode.apply(this, arguments) },toString: function() {return "["+this.widgetType+" Tree:"+this.tree+" ID:"+this.widgetId+" Title:"+this.title+"]";}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeNode.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeNodeV3.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeNodeV3.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeNodeV3.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeNodeV3.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,39 @@
+
+dojo.provide("dojo.widget.TreeNodeV3");dojo.require("dojo.html.*");dojo.require("dojo.event.*");dojo.require("dojo.io.*");dojo.require("dojo.widget.TreeWithNode");dojo.widget.defineWidget(
+"dojo.widget.TreeNodeV3",[dojo.widget.HtmlWidget, dojo.widget.TreeWithNode],function() {this.actionsDisabled = [];this.object = {};},{tryLazyInit: true,actions: {MOVE: "MOVE",DETACH: "DETACH",EDIT: "EDIT",ADDCHILD: "ADDCHILD",SELECT: "SELECT"},labelClass: "",contentClass: "",expandNode: null,labelNode: null,nodeDocType: "",selected: false,getnodeDocType: function() {return this.nodeDocType;},cloneProperties: ["actionsDisabled","tryLazyInit","nodeDocType","objectId","object","title","isFolder","isExpanded","state"],clone: function(deep) {var ret = new this.constructor();for(var i=0; i<this.cloneProperties.length; i++) {var prop = this.cloneProperties[i];ret[prop] = dojo.lang.shallowCopy(this[prop], true);}
+if (this.tree.unsetFolderOnEmpty && !deep && this.isFolder) {ret.isFolder = false;}
+ret.toggleObj = this.toggleObj;dojo.widget.manager.add(ret);ret.tree = this.tree;ret.buildRendering({},{});ret.initialize({},{});if (deep && this.children.length) {for(var i=0; i<this.children.length; i++) {var child = this.children[i];if (child.clone) {ret.children.push(child.clone(deep));} else {ret.children.push(dojo.lang.shallowCopy(child, deep));}}
+ret.setChildren();}
+return ret;},markProcessing: function() {this.markProcessingSavedClass = dojo.html.getClass(this.expandNode);dojo.html.setClass(this.expandNode, this.tree.classPrefix+'ExpandLoading');},unmarkProcessing: function() {dojo.html.setClass(this.expandNode, this.markProcessingSavedClass);},buildRendering: function(args, fragment, parent) {if (args.tree) {this.tree = dojo.lang.isString(args.tree) ? dojo.widget.manager.getWidgetById(args.tree) : args.tree;} else if (parent && parent.tree) {this.tree = parent.tree;}
+if (!this.tree) {dojo.raise("Can't evaluate tree from arguments or parent");}
+this.domNode = this.tree.nodeTemplate.cloneNode(true);this.expandNode = this.domNode.firstChild;this.contentNode = this.domNode.childNodes[1];this.labelNode = this.contentNode.firstChild;if (this.labelClass) {dojo.html.addClass(this.labelNode, this.labelClass);}
+if (this.contentClass) {dojo.html.addClass(this.contentNode, this.contentClass);}
+this.domNode.widgetId = this.widgetId;this.labelNode.innerHTML = this.title;},isTreeNode: true,object: {},title: "",isFolder: null,contentNode: null,expandClass: "",isExpanded: false,containerNode: null,getInfo: function() {var info = {widgetId: this.widgetId,objectId: this.objectId,index: this.getParentIndex()}
+return info;},setFolder: function() {this.isFolder = true;this.viewSetExpand();if (!this.containerNode) {this.viewAddContainer();}
+dojo.event.topic.publish(this.tree.eventNames.afterSetFolder, { source: this });},initialize: function(args, frag, parent) {if (args.isFolder) {this.isFolder = true;}
+if (this.children.length || this.isFolder) {this.setFolder();} else {this.viewSetExpand();}
+for(var i=0; i<this.actionsDisabled.length;i++) {this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();}
+dojo.event.topic.publish(this.tree.eventNames.afterChangeTree, {oldTree:null, newTree:this.tree, node:this} );},unsetFolder: function() {this.isFolder = false;this.viewSetExpand();dojo.event.topic.publish(this.tree.eventNames.afterUnsetFolder, { source: this });},insertNode: function(parent, index) {if (!index) index = 0;if (index==0) {dojo.html.prependChild(this.domNode, parent.containerNode);} else {dojo.html.insertAfter(this.domNode, parent.children[index-1].domNode);}},updateTree: function(newTree) {if (this.tree === newTree) {return;}
+var oldTree = this.tree;dojo.lang.forEach(this.getDescendants(),function(elem) {elem.tree = newTree;});if (oldTree.classPrefix != newTree.classPrefix) {var stack = [this.domNode]
+var elem;var reg = new RegExp("(^|\\s)"+oldTree.classPrefix, "g");while (elem = stack.pop()) {for(var i=0; i<elem.childNodes.length; i++) {var childNode = elem.childNodes[i]
+if (childNode.nodeDocType != 1) continue;dojo.html.setClass(childNode, dojo.html.getClass(childNode).replace(reg, '$1'+newTree.classPrefix));stack.push(childNode);}}}
+var message = {oldTree:oldTree, newTree:newTree, node:this}
+dojo.event.topic.publish(this.tree.eventNames.afterChangeTree, message );dojo.event.topic.publish(newTree.eventNames.afterChangeTree, message );},addedTo: function(parent, index, dontPublishEvent) {if (this.tree !== parent.tree) {this.updateTree(parent.tree);}
+if (parent.isTreeNode) {if (!parent.isFolder) {parent.setFolder();parent.state = parent.loadStates.LOADED;}}
+var siblingsCount = parent.children.length;this.insertNode(parent, index);this.viewAddLayout();if (siblingsCount > 1) {if (index == 0 && parent.children[1] instanceof dojo.widget.Widget) {parent.children[1].viewUpdateLayout();}
+if (index == siblingsCount-1 && parent.children[siblingsCount-2] instanceof dojo.widget.Widget) {parent.children[siblingsCount-2].viewUpdateLayout();}} else if (parent.isTreeNode) {parent.viewSetHasChildren();}
+if (!dontPublishEvent) {var message = {child: this,index: index,parent: parent}
+dojo.event.topic.publish(this.tree.eventNames.afterAddChild, message);}},createSimple: function(args, parent) {if (args.tree) {var tree = args.tree;} else if (parent) {var tree = parent.tree;} else {dojo.raise("createSimple: can't evaluate tree");}
+tree = dojo.widget.byId(tree);var treeNode = new tree.defaultChildWidget();for(var x in args){treeNode[x] = args[x];}
+treeNode.toggleObj = dojo.lfx.toggle[treeNode.toggle.toLowerCase()] || dojo.lfx.toggle.plain;dojo.widget.manager.add(treeNode);treeNode.buildRendering(args, {}, parent);treeNode.initialize(args, {}, parent);if (treeNode.parent) {delete dojo.widget.manager.topWidgets[treeNode.widgetId];}
+return treeNode;},viewUpdateLayout: function() {this.viewRemoveLayout();this.viewAddLayout();},viewAddContainer: function() {this.containerNode = this.tree.containerNodeTemplate.cloneNode(true);this.domNode.appendChild(this.containerNode);},viewAddLayout: function() {if (this.parent["isTree"]) {dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode) + ' '+this.tree.classPrefix+'IsRoot')}
+if (this.isLastChild()) {dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode) + ' '+this.tree.classPrefix+'IsLast')}},viewRemoveLayout: function() {dojo.html.removeClass(this.domNode, this.tree.classPrefix+"IsRoot");dojo.html.removeClass(this.domNode, this.tree.classPrefix+"IsLast");},viewGetExpandClass: function() {if (this.isFolder) {return this.isExpanded ? "ExpandOpen" : "ExpandClosed";} else {return "ExpandLeaf";}},viewSetExpand: function() {var expand = this.tree.classPrefix+this.viewGetExpandClass();var reg = new RegExp("(^|\\s)"+this.tree.classPrefix+"Expand\\w+",'g');dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode).replace(reg,'') + ' '+expand);this.viewSetHasChildrenAndExpand();},viewGetChildrenClass: function() {return 'Children'+(this.children.length ? 'Yes' : 'No');},viewSetHasChildren: function() {var clazz = this.tree.classPrefix+this.viewGetChildrenClass();var reg = new RegExp("(^|\\s)"+this.tree.classPrefix+"Children\\w+",'g');d
 ojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode).replace(reg,'') + ' '+clazz);this.viewSetHasChildrenAndExpand();},viewSetHasChildrenAndExpand: function() {var clazz = this.tree.classPrefix+'State'+this.viewGetChildrenClass()+'-'+this.viewGetExpandClass();var reg = new RegExp("(^|\\s)"+this.tree.classPrefix+"State[\\w-]+",'g');dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode).replace(reg,'') + ' '+clazz);},viewUnfocus: function() {dojo.html.removeClass(this.labelNode, this.tree.classPrefix+"LabelFocused");},viewFocus: function() {dojo.html.addClass(this.labelNode, this.tree.classPrefix+"LabelFocused");},viewEmphase: function() {dojo.html.clearSelection(this.labelNode);dojo.html.addClass(this.labelNode, this.tree.classPrefix+'NodeEmphased');},viewUnemphase: function() {dojo.html.removeClass(this.labelNode, this.tree.classPrefix+'NodeEmphased');},detach: function() {if (!this.parent) return;var parent = this.parent;var index = this.getParentInde
 x();this.doDetach.apply(this, arguments);dojo.event.topic.publish(this.tree.eventNames.afterDetach,{ child: this, parent: parent, index:index }
+);},doDetach: function() {var parent = this.parent;if (!parent) return;var index = this.getParentIndex();this.viewRemoveLayout();dojo.widget.DomWidget.prototype.removeChild.call(parent, this);var siblingsCount = parent.children.length;if (siblingsCount > 0) {if (index == 0) {parent.children[0].viewUpdateLayout();}
+if (index == siblingsCount) {parent.children[siblingsCount-1].viewUpdateLayout();}} else {if (parent.isTreeNode) {parent.viewSetHasChildren();}}
+if (this.tree.unsetFolderOnEmpty && !parent.children.length && parent.isTreeNode) {parent.unsetFolder();}
+this.parent = null;},destroy: function() {dojo.event.topic.publish(this.tree.eventNames.beforeNodeDestroy, { source: this } );this.detach();return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);},expand: function(){if (this.isExpanded) return;if (this.tryLazyInit) {this.setChildren();this.tryLazyInit = false;}
+this.isExpanded = true;this.viewSetExpand();this.showChildren();},collapse: function(){if (!this.isExpanded) return;this.isExpanded = false;this.hideChildren();},hideChildren: function(){this.tree.toggleObj.hide(
+this.containerNode, this.tree.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onHideChildren")
+);},showChildren: function(){this.tree.toggleObj.show(
+this.containerNode, this.tree.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onShowChildren")
+);},onShowChildren: function() {this.onShow();dojo.event.topic.publish(this.tree.eventNames.afterExpand, {source: this} );},onHideChildren: function() {this.viewSetExpand();this.onHide();dojo.event.topic.publish(this.tree.eventNames.afterCollapse, {source: this} );},setTitle: function(title) {var oldTitle = this.title;this.labelNode.innerHTML = this.title = title;dojo.event.topic.publish(this.tree.eventNames.afterSetTitle, { source: this, oldTitle:oldTitle });},toString: function() {return '['+this.widgetType+', '+this.title+']';}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeNodeV3.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeRPCController.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeRPCController.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeRPCController.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeRPCController.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,10 @@
+
+dojo.provide("dojo.widget.TreeRPCController");dojo.require("dojo.event.*");dojo.require("dojo.json")
+dojo.require("dojo.io.*");dojo.require("dojo.widget.TreeLoadingController");dojo.widget.defineWidget("dojo.widget.TreeRPCController", dojo.widget.TreeLoadingController, {doMove: function(child, newParent, index){var params = {child: this.getInfo(child),childTree: this.getInfo(child.tree),newParent: this.getInfo(newParent),newParentTree: this.getInfo(newParent.tree),newIndex: index};var success;this.runRPC({url: this.getRPCUrl('move'),load: function(response){success = this.doMoveProcessResponse(response, child, newParent, index) ;},sync: true,lock: [child, newParent],params: params});return success;},doMoveProcessResponse: function(response, child, newParent, index){if(!dojo.lang.isUndefined(response.error)){this.RPCErrorHandler("server", response.error);return false;}
+var args = [child, newParent, index];return dojo.widget.TreeLoadingController.prototype.doMove.apply(this, args);},doRemoveNode: function(node, callObj, callFunc){var params = {node: this.getInfo(node),tree: this.getInfo(node.tree)}
+this.runRPC({url: this.getRPCUrl('removeNode'),load: function(response){this.doRemoveNodeProcessResponse(response, node, callObj, callFunc)},params: params,lock: [node]});},doRemoveNodeProcessResponse: function(response, node, callObj, callFunc){if(!dojo.lang.isUndefined(response.error)){this.RPCErrorHandler("server", response.error);return false;}
+if(!response){ return false; }
+if(response == true){var args = [ node, callObj, callFunc ];dojo.widget.TreeLoadingController.prototype.doRemoveNode.apply(this, args);return;}else if(dojo.lang.isObject(response)){dojo.raise(response.error);}else{dojo.raise("Invalid response "+response)}},doCreateChild: function(parent, index, output, callObj, callFunc){var params = {tree: this.getInfo(parent.tree),parent: this.getInfo(parent),index: index,data: output}
+this.runRPC({url: this.getRPCUrl('createChild'),load: function(response) {this.doCreateChildProcessResponse( response, parent, index, callObj, callFunc)},params: params,lock: [parent]});},doCreateChildProcessResponse: function(response, parent, index, callObj, callFunc){if(!dojo.lang.isUndefined(response.error)){this.RPCErrorHandler("server",response.error);return false;}
+if(!dojo.lang.isObject(response)){dojo.raise("Invalid result "+response)}
+var args = [parent, index, response, callObj, callFunc];dojo.widget.TreeLoadingController.prototype.doCreateChild.apply(this, args);}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeRPCController.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeRpcControllerV3.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeRpcControllerV3.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeRpcControllerV3.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeRpcControllerV3.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,20 @@
+
+dojo.provide("dojo.widget.TreeRpcControllerV3");dojo.require("dojo.event.*");dojo.require("dojo.json")
+dojo.require("dojo.io.*");dojo.require("dojo.widget.TreeLoadingControllerV3");dojo.widget.defineWidget(
+"dojo.widget.TreeRpcControllerV3",dojo.widget.TreeLoadingControllerV3,{extraRpcOnEdit: false,doMove: function(child, newParent, index, sync){var params = {child: this.getInfo(child),childTree: this.getInfo(child.tree),newParent: this.getInfo(newParent),newParentTree: this.getInfo(newParent.tree),newIndex: index};var deferred = this.runRpc({url: this.getRpcUrl('move'),sync: sync,params: params});var _this = this;var args = arguments;deferred.addCallback(function() {dojo.widget.TreeBasicControllerV3.prototype.doMove.apply(_this,args);});return deferred;},prepareDetach: function(node, sync) {var deferred = this.startProcessing(node);return deferred;},finalizeDetach: function(node) {this.finishProcessing(node);},doDetach: function(node, sync){var params = {node: this.getInfo(node),tree: this.getInfo(node.tree)}
+var deferred = this.runRpc({url: this.getRpcUrl('detach'),sync: sync,params: params});var _this = this;var args = arguments;deferred.addCallback(function() {dojo.widget.TreeBasicControllerV3.prototype.doDetach.apply(_this,args);});return deferred;},requestEditConfirmation: function(node, action, sync) {if (!this.extraRpcOnEdit) {return dojo.Deferred.prototype.makeCalled();}
+var _this = this;var deferred = this.startProcessing(node);var params = {node: this.getInfo(node),tree: this.getInfo(node.tree)}
+deferred.addCallback(function() {return _this.runRpc({url: _this.getRpcUrl(action),sync: sync,params: params});});deferred.addBoth(function(r) {_this.finishProcessing(node);return r;});return deferred;},editLabelSave: function(node, newContent, sync) {var deferred = this.startProcessing(node);var _this = this;var params = {node: this.getInfo(node),tree: this.getInfo(node.tree),newContent: newContent}
+deferred.addCallback(function() {return _this.runRpc({url: _this.getRpcUrl('editLabelSave'),sync: sync,params: params});});deferred.addBoth(function(r) {_this.finishProcessing(node);return r;});return deferred;},editLabelStart: function(node, sync) {if (!this.canEditLabel(node)) {return false;}
+var _this = this;if (!this.editor.isClosed()) {var deferred = this.editLabelFinish(this.editor.saveOnBlur, sync);deferred.addCallback(function() {return _this.editLabelStart(node, sync);});return deferred;}
+var deferred = this.requestEditConfirmation(node, 'editLabelStart', sync);deferred.addCallback(function() {_this.doEditLabelStart(node);});return deferred;},editLabelFinish: function(save, sync) {var _this = this;var node = this.editor.node;var deferred = dojo.Deferred.prototype.makeCalled();if (!save && !node.isPhantom) {deferred = this.requestEditConfirmation(this.editor.node,'editLabelFinishCancel', sync);}
+if (save) {if (node.isPhantom) {deferred = this.sendCreateChildRequest(
+node.parent,node.getParentIndex(),{title:this.editor.getContents()},sync
+);} else {deferred = this.editLabelSave(node, this.editor.getContents(), sync);}}
+deferred.addCallback(function(server_data) {_this.doEditLabelFinish(save, server_data);});deferred.addErrback(function(r) {_this.doEditLabelFinish(false);return false;});return deferred;},createAndEdit: function(parent, index, sync) {var data = {title:parent.tree.defaultChildTitle};if (!this.canCreateChild(parent, index, data)) {return false;}
+if (!this.editor.isClosed()) {var deferred = this.editLabelFinish(this.editor.saveOnBlur, sync);deferred.addCallback(function() {return _this.createAndEdit(parent, index, sync);});return deferred;}
+var _this = this;var deferred = this.prepareCreateChild(parent, index, data, sync);deferred.addCallback(function() {var child = _this.makeDefaultNode(parent, index);child.isPhantom = true;return child;});deferred.addBoth(function(r) {_this.finalizeCreateChild(parent, index, data, sync);return r;});deferred.addCallback(function(child) {var d = _this.exposeCreateChild(parent, index, data, sync);d.addCallback(function() { return child });return d;});deferred.addCallback(function(child) {_this.doEditLabelStart(child);return child;});return deferred;},prepareDestroyChild: function(node, sync) {var deferred = this.startProcessing(node);return deferred;},finalizeDestroyChild: function(node) {this.finishProcessing(node);},doDestroyChild: function(node, sync){var params = {node: this.getInfo(node),tree: this.getInfo(node.tree)}
+var deferred = this.runRpc({url: this.getRpcUrl('destroyChild'),sync: sync,params: params});var _this = this;var args = arguments;deferred.addCallback(function() {dojo.widget.TreeBasicControllerV3.prototype.doDestroyChild.apply(_this,args);});return deferred;},sendCreateChildRequest: function(parent, index, data, sync) {var params = {tree: this.getInfo(parent.tree),parent: this.getInfo(parent),index: index,data: data}
+var deferred = this.runRpc({url: this.getRpcUrl('createChild'),sync: sync,params: params});return deferred;},doCreateChild: function(parent, index, data, sync){if (dojo.lang.isUndefined(data.title)) {data.title = parent.tree.defaultChildTitle;}
+var deferred = this.sendCreateChildRequest(parent,index,data,sync);var _this = this;var args = arguments;deferred.addCallback(function(server_data) {dojo.lang.mixin(data, server_data);return dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(_this,parent,index,data);});return deferred;},doClone: function(child, newParent, index, deep, sync) {var params = {child: this.getInfo(child),newParent: this.getInfo(newParent),index: index,deep: deep ? true : false,tree: this.getInfo(child.tree)}
+var deferred = this.runRpc({url: this.getRpcUrl('clone'),sync: sync,params: params});var _this = this;var args = arguments;deferred.addCallback(function() {dojo.widget.TreeBasicControllerV3.prototype.doClone.apply(_this,args);});return deferred;}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeRpcControllerV3.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeSelector.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeSelector.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeSelector.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeSelector.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,8 @@
+
+dojo.provide("dojo.widget.TreeSelector");dojo.require("dojo.widget.HtmlWidget");dojo.widget.defineWidget("dojo.widget.TreeSelector", dojo.widget.HtmlWidget, function() {this.eventNames = {};this.listenedTrees = [];},{widgetType: "TreeSelector",selectedNode: null,dieWithTree: false,eventNamesDefault: {select : "select",destroy : "destroy",deselect : "deselect",dblselect: "dblselect"},initialize: function() {for(name in this.eventNamesDefault) {if (dojo.lang.isUndefined(this.eventNames[name])) {this.eventNames[name] = this.widgetId+"/"+this.eventNamesDefault[name];}}},destroy: function() {dojo.event.topic.publish(this.eventNames.destroy, { source: this } );return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);},listenTree: function(tree) {dojo.event.topic.subscribe(tree.eventNames.titleClick, this, "select");dojo.event.topic.subscribe(tree.eventNames.iconClick, this, "select");dojo.event.topic.subscribe(tree.eventNames.collapse, this, "onCollapse");dojo.event.
 topic.subscribe(tree.eventNames.moveFrom, this, "onMoveFrom");dojo.event.topic.subscribe(tree.eventNames.removeNode, this, "onRemoveNode");dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");this.listenedTrees.push(tree);},unlistenTree: function(tree) {dojo.event.topic.unsubscribe(tree.eventNames.titleClick, this, "select");dojo.event.topic.unsubscribe(tree.eventNames.iconClick, this, "select");dojo.event.topic.unsubscribe(tree.eventNames.collapse, this, "onCollapse");dojo.event.topic.unsubscribe(tree.eventNames.moveFrom, this, "onMoveFrom");dojo.event.topic.unsubscribe(tree.eventNames.removeNode, this, "onRemoveNode");dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");for(var i=0; i<this.listenedTrees.length; i++){if(this.listenedTrees[i] === tree){this.listenedTrees.splice(i, 1);break;}}},onTreeDestroy: function(message) {this.unlistenTree(message.source);if (this.dieWithTree) {this.destroy();}},onCollapse: function(
 message) {if (!this.selectedNode) return;var node = message.source;var parent = this.selectedNode.parent;while (parent !== node && parent.isTreeNode) {parent = parent.parent;}
+if (parent.isTreeNode) {this.deselect();}},select: function(message) {var node = message.source;var e = message.event;if (this.selectedNode === node) {if(e.ctrlKey || e.shiftKey || e.metaKey){this.deselect();return;}
+dojo.event.topic.publish(this.eventNames.dblselect, { node: node });return;}
+if (this.selectedNode) {this.deselect();}
+this.doSelect(node);dojo.event.topic.publish(this.eventNames.select, {node: node} );},onMoveFrom: function(message) {if (message.child !== this.selectedNode) {return;}
+if (!dojo.lang.inArray(this.listenedTrees, message.newTree)) {this.deselect();}},onRemoveNode: function(message) {if (message.child !== this.selectedNode) {return;}
+this.deselect();},doSelect: function(node){node.markSelected();this.selectedNode = node;},deselect: function(){var node = this.selectedNode;this.selectedNode = null;node.unMarkSelected();dojo.event.topic.publish(this.eventNames.deselect, {node: node} );}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeSelector.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeSelectorV3.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeSelectorV3.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeSelectorV3.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeSelectorV3.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,20 @@
+
+dojo.provide("dojo.widget.TreeSelectorV3");dojo.require("dojo.widget.HtmlWidget");dojo.require("dojo.widget.TreeCommon");dojo.widget.defineWidget(
+"dojo.widget.TreeSelectorV3",[dojo.widget.HtmlWidget, dojo.widget.TreeCommon],function() {this.eventNames = {};this.listenedTrees = {};this.selectedNodes = [];this.lastClicked = {}},{listenTreeEvents: ["afterTreeCreate","afterCollapse","afterChangeTree", "afterDetach", "beforeTreeDestroy"],listenNodeFilter: function(elem) { return elem instanceof dojo.widget.Widget},allowedMulti: true,dblselectTimeout: 300,eventNamesDefault: {select : "select",deselect : "deselect",dblselect: "dblselect"},onAfterTreeCreate: function(message) {var tree = message.source;dojo.event.browser.addListener(tree.domNode, "onclick", dojo.lang.hitch(this, this.onTreeClick));if (dojo.render.html.ie) {dojo.event.browser.addListener(tree.domNode, "ondblclick", dojo.lang.hitch(this, this.onTreeDblClick));}
+dojo.event.browser.addListener(tree.domNode, "onKey", dojo.lang.hitch(this, this.onKey));},onKey: function(e) {if (!e.key || e.ctrkKey || e.altKey) { return; }
+switch(e.key) {case e.KEY_ENTER:
+var node = this.domElement2TreeNode(e.target);if (node) {this.processNode(node, e);}}},onAfterChangeTree: function(message) {if (!message.oldTree && message.node.selected) {this.select(message.node);}
+if (!message.newTree || !this.listenedTrees[message.newTree.widgetId]) {if (this.selectedNode && message.node.children) {this.deselectIfAncestorMatch(message.node);}}},initialize: function(args) {for(name in this.eventNamesDefault) {if (dojo.lang.isUndefined(this.eventNames[name])) {this.eventNames[name] = this.widgetId+"/"+this.eventNamesDefault[name];}}},onBeforeTreeDestroy: function(message) {this.unlistenTree(message.source);},onAfterCollapse: function(message) {this.deselectIfAncestorMatch(message.source);},onTreeDblClick: function(event) {this.onTreeClick(event);},checkSpecialEvent: function(event) {return event.shiftKey || event.ctrlKey;},onTreeClick: function(event) {var node = this.domElement2TreeNode(event.target);if (!node) {return;}
+var checkLabelClick = function(domElement) {return domElement === node.labelNode;}
+if (this.checkPathCondition(event.target, checkLabelClick)) {this.processNode(node, event);}},processNode: function(node, event) {if (node.actionIsDisabled(node.actions.SELECT)) {return;}
+if (dojo.lang.inArray(this.selectedNodes, node)) {if(this.checkSpecialEvent(event)){this.deselect(node);return;}
+var _this = this;var i=0;var selectedNode;while(this.selectedNodes.length > i) {selectedNode = this.selectedNodes[i];if (selectedNode !== node) {this.deselect(selectedNode);continue;}
+i++;}
+var wasJustClicked = this.checkRecentClick(node)
+eventName = wasJustClicked ? this.eventNames.dblselect : this.eventNames.select;if (wasJustClicked) {eventName = this.eventNames.dblselect;this.forgetLastClicked();} else {eventName = this.eventNames.select;this.setLastClicked(node)}
+dojo.event.topic.publish(eventName, { node: node });return;}
+this.deselectIfNoMulti(event);this.setLastClicked(node);this.select(node);},forgetLastClicked: function() {this.lastClicked = {}},setLastClicked: function(node) {this.lastClicked.date = new Date();this.lastClicked.node = node;},checkRecentClick: function(node) {var diff = new Date() - this.lastClicked.date;if (this.lastClicked.node && diff < this.dblselectTimeout) {return true;} else {return false;}},deselectIfNoMulti: function(event) {if (!this.checkSpecialEvent(event) || !this.allowedMulti) {this.deselectAll();}},deselectIfAncestorMatch: function(ancestor) {var _this = this;dojo.lang.forEach(this.selectedNodes, function(node) {var selectedNode = node;node = node.parent
+while (node && node.isTreeNode) {if (node === ancestor) {_this.deselect(selectedNode);return;}
+node = node.parent;}});},onAfterDetach: function(message) {this.deselectIfAncestorMatch(message.child);},select: function(node) {var index = dojo.lang.find(this.selectedNodes, node, true);if (index >=0 ) {return;}
+this.selectedNodes.push(node);dojo.event.topic.publish(this.eventNames.select, {node: node} );},deselect: function(node){var index = dojo.lang.find(this.selectedNodes, node, true);if (index < 0) {return;}
+this.selectedNodes.splice(index, 1);dojo.event.topic.publish(this.eventNames.deselect, {node: node} );},deselectAll: function() {while (this.selectedNodes.length) {this.deselect(this.selectedNodes[0]);}}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeSelectorV3.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeTimeoutIterator.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeTimeoutIterator.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeTimeoutIterator.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeTimeoutIterator.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,10 @@
+
+dojo.provide("dojo.widget.TreeTimeoutIterator");dojo.require("dojo.event.*");dojo.require("dojo.json")
+dojo.require("dojo.io.*");dojo.require("dojo.widget.TreeCommon");dojo.declare(
+"dojo.widget.TreeTimeoutIterator",null,function(elem, callFunc, callObj) {var _this = this;this.currentParent = elem;this.callFunc = callFunc;this.callObj = callObj ? callObj: this;this.stack = [];},{maxStackDepth: Number.POSITIVE_INFINITY,stack: null,currentParent: null,currentIndex: 0,filterFunc: function() { return true },finishFunc: function() { return true },setFilter: function(func, obj) {this.filterFunc = func;this.filterObj = obj;},setMaxLevel: function(level) {this.maxStackDepth = level-2;},forward: function(timeout) {var _this = this;if (this.timeout) {var tid = setTimeout(function() {_this.processNext(); clearTimeout(tid); }, _this.timeout);} else {return this.processNext();}},start: function(processFirst) {if (processFirst) {return this.callFunc.call(this.callObj, this.currentParent, this);}
+return this.processNext();},processNext: function() {var handler;var _this = this;var found;var next;if (this.maxStackDepth == -2) {return;}
+while (true) {var children = this.currentParent.children;if (children && children.length) {do {next = children[this.currentIndex];} while (this.currentIndex++ < children.length && !(found = this.filterFunc.call(this.filterObj,next)));if (found) {if (next.isFolder && this.stack.length <= this.maxStackDepth) {this.moveParent(next,0);}
+return this.callFunc.call(this.callObj, next, this);}}
+if (this.stack.length) {this.popParent();continue;}
+break;}
+return this.finishFunc.call(this.finishObj);},setFinish: function(func, obj) {this.finishFunc = func;this.finishObj = obj;},popParent: function() {var p = this.stack.pop();this.currentParent = p[0];this.currentIndex = p[1];},moveParent: function(nextParent, nextIndex) {this.stack.push([this.currentParent, this.currentIndex]);this.currentParent = nextParent;this.currentIndex = nextIndex;}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeTimeoutIterator.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeToggleOnSelect.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeToggleOnSelect.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeToggleOnSelect.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeToggleOnSelect.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,4 @@
+
+dojo.provide("dojo.widget.TreeToggleOnSelect");dojo.require("dojo.widget.HtmlWidget");dojo.widget.defineWidget(
+"dojo.widget.TreeToggleOnSelect",dojo.widget.HtmlWidget,{selector: "",controller: "",selectEvent: "select",initialize: function() {this.selector = dojo.widget.byId(this.selector);this.controller = dojo.widget.byId(this.controller);dojo.event.topic.subscribe(this.selector.eventNames[this.selectEvent], this, "onSelectEvent");},onSelectEvent: function(message) {var node = message.node
+node.isExpanded ? this.controller.collapse(node) : this.controller.expand(node)}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeToggleOnSelect.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeV3.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeV3.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeV3.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeV3.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,11 @@
+
+dojo.provide("dojo.widget.TreeV3");dojo.require("dojo.widget.TreeWithNode");dojo.require("dojo.widget.*");dojo.require("dojo.event.*");dojo.require("dojo.io.*");dojo.require("dojo.widget.HtmlWidget");dojo.require("dojo.widget.TreeNodeV3");dojo.widget.defineWidget(
+"dojo.widget.TreeV3",[dojo.widget.HtmlWidget, dojo.widget.TreeWithNode],function() {this.eventNames = {};this.DndAcceptTypes = [];this.actionsDisabled = [];this.listeners = [];this.tree = this;},{DndMode: "",defaultChildWidget: null,defaultChildTitle: "New Node",eagerWidgetInstantiation: false,eventNamesDefault: {afterTreeCreate: "afterTreeCreate",beforeTreeDestroy: "beforeTreeDestroy",beforeNodeDestroy: "beforeNodeDestroy",afterChangeTree: "afterChangeTree",afterSetFolder: "afterSetFolder",afterUnsetFolder: "afterUnsetFolder",beforeMoveFrom: "beforeMoveFrom",beforeMoveTo: "beforeMoveTo",afterMoveFrom: "afterMoveFrom",afterMoveTo: "afterMoveTo",afterAddChild: "afterAddChild",afterDetach: "afterDetach",afterExpand: "afterExpand",beforeExpand: "beforeExpand",afterSetTitle: "afterSetTitle",afterCollapse: "afterCollapse",beforeCollapse: "beforeCollapse"},classPrefix: "Tree",style: "",allowAddChildToLeaf: true,unsetFolderOnEmpty: true,DndModes: {BETWEEN: 1,ONTO: 2},DndAcceptTypes
 : "",templateCssPath: dojo.uri.dojoUri("src/widget/templates/TreeV3.css"),templateString: '<div style="${this.style}">\n</div>',isExpanded: true,isTree: true,createNode: function(data) {data.tree = this.widgetId;if (data.widgetName) {return dojo.widget.createWidget(data.widgetName, data);} else if (this.defaultChildWidget.prototype.createSimple) {return this.defaultChildWidget.prototype.createSimple(data);} else {var ns = this.defaultChildWidget.prototype.ns;var wt = this.defaultChildWidget.prototype.widgetType;return dojo.widget.createWidget(ns + ":" + wt, data);}},makeNodeTemplate: function() {var domNode = document.createElement("div");dojo.html.setClass(domNode, this.classPrefix+"Node "+this.classPrefix+"ExpandLeaf "+this.classPrefix+"ChildrenNo");this.nodeTemplate = domNode;var expandNode = document.createElement("div");var clazz = this.classPrefix+"Expand";if (dojo.render.html.ie) {clazz = clazz + ' ' + this.classPrefix+"IEExpand";}
+dojo.html.setClass(expandNode, clazz);this.expandNodeTemplate = expandNode;var labelNode = document.createElement("span");dojo.html.setClass(labelNode, this.classPrefix+"Label");this.labelNodeTemplate = labelNode;var contentNode = document.createElement("div");var clazz = this.classPrefix+"Content";if (dojo.render.html.ie && !dojo.render.html.ie70) {clazz = clazz + ' ' + this.classPrefix+"IEContent";}
+dojo.html.setClass(contentNode, clazz);this.contentNodeTemplate = contentNode;domNode.appendChild(expandNode);domNode.appendChild(contentNode);contentNode.appendChild(labelNode);},makeContainerNodeTemplate: function() {var div = document.createElement('div');div.style.display = 'none';dojo.html.setClass(div, this.classPrefix+"Container");this.containerNodeTemplate = div;},actions: {ADDCHILD: "ADDCHILD"},getInfo: function() {var info = {widgetId: this.widgetId,objectId: this.objectId}
+return info;},adjustEventNames: function() {for(var name in this.eventNamesDefault) {if (dojo.lang.isUndefined(this.eventNames[name])) {this.eventNames[name] = this.widgetId+"/"+this.eventNamesDefault[name];}}},adjustDndMode: function() {var _this = this;var DndMode = 0;dojo.lang.forEach(this.DndMode.split(';'),function(elem) {var mode = _this.DndModes[dojo.string.trim(elem).toUpperCase()];if (mode) DndMode = DndMode | mode;}
+);this.DndMode = DndMode;},destroy: function() {dojo.event.topic.publish(this.tree.eventNames.beforeTreeDestroy, { source: this } );return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);},initialize: function(args){this.domNode.widgetId = this.widgetId;for(var i=0; i<this.actionsDisabled.length;i++) {this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();}
+if (!args.defaultChildWidget) {this.defaultChildWidget = dojo.widget.TreeNodeV3;} else {this.defaultChildWidget = dojo.lang.getObjPathValue(args.defaultChildWidget);}
+this.adjustEventNames();this.adjustDndMode();this.makeNodeTemplate();this.makeContainerNodeTemplate();this.containerNode = this.domNode;dojo.html.setClass(this.domNode, this.classPrefix+"Container");var _this = this;dojo.lang.forEach(this.listeners,function(elem) {var t = dojo.lang.isString(elem) ? dojo.widget.byId(elem) : elem;t.listenTree(_this)}
+);},postCreate: function() {dojo.event.topic.publish(this.eventNames.afterTreeCreate, { source: this } );},move: function(child, newParent, index) {if (!child.parent) {dojo.raise(this.widgetType+": child can be moved only while it's attached");}
+var oldParent = child.parent;var oldTree = child.tree;var oldIndex = child.getParentIndex();var newTree = newParent.tree;var newParent = newParent;var newIndex = index;var message = {oldParent: oldParent, oldTree: oldTree, oldIndex: oldIndex,newParent: newParent, newTree: newTree, newIndex: newIndex,child: child};dojo.event.topic.publish(oldTree.eventNames.beforeMoveFrom, message);dojo.event.topic.publish(newTree.eventNames.beforeMoveTo, message);this.doMove.apply(this, arguments);dojo.event.topic.publish(oldTree.eventNames.afterMoveFrom, message);dojo.event.topic.publish(newTree.eventNames.afterMoveTo, message);},doMove: function(child, newParent, index) {child.doDetach();newParent.doAddChild(child, index);},toString: function() {return "["+this.widgetType+" ID:"+this.widgetId	+"]"}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeV3.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeWithNode.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeWithNode.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeWithNode.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeWithNode.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,19 @@
+
+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 node = this;while (true) {if (node.lockLevel) {return true;}
+if (!node.parent || node.isTree) {break;}
+node = node.parent;}
+return false;},flushLock: function() {this.lockLevel = 0;},actionIsDisabled: function(action) {var disabled = false;if (dojo.lang.inArray(this.actionsDisabled, action)) {disabled = true;}
+if (this.isTreeNode) {if (!this.tree.allowAddChildToLeaf && action == this.actions.ADDCHILD && !this.isFolder) {disabled = true;}}
+return disabled;},actionIsDisabledNow: function(action) {return this.actionIsDisabled(action) || this.isLocked();},setChildren: function(childrenArray) {if (this.isTreeNode && !this.isFolder) {this.setFolder();} else if (this.isTreeNode) {this.state = this.loadStates.LOADED;}
+var hadChildren = this.children.length > 0;if (hadChildren && childrenArray){this.destroyChildren()}
+if (childrenArray) {this.children = childrenArray;}
+var hasChildren = this.children.length > 0;if (this.isTreeNode && hasChildren != hadChildren) {this.viewSetHasChildren();}
+for(var i=0; i<this.children.length; i++) {var child = this.children[i];if (!(child instanceof dojo.widget.Widget)) {child = this.children[i] = this.tree.createNode(child);var childWidgetCreated = true;} else {var childWidgetCreated = false;}
+if (!child.parent) {child.parent = this;if (this.tree !== child.tree) {child.updateTree(this.tree);}
+child.viewAddLayout();this.containerNode.appendChild(child.domNode);var message = {child: child,index: i,parent: this,childWidgetCreated: childWidgetCreated}
+delete dojo.widget.manager.topWidgets[child.widgetId];dojo.event.topic.publish(this.tree.eventNames.afterAddChild, message);}
+if (this.tree.eagerWidgetInstantiation) {dojo.lang.forEach(this.children, function(child) {child.setChildren();});}}},doAddChild: function(child, index) {return this.addChild(child, index, true);},addChild: function(child, index, dontPublishEvent) {if (dojo.lang.isUndefined(index)) {index = this.children.length;}
+if (!child.isTreeNode){dojo.raise("You can only add TreeNode widgets to a "+this.widgetType+" widget!");return;}
+this.children.splice(index, 0, child);child.parent = this;child.addedTo(this, index, dontPublishEvent);delete dojo.widget.manager.topWidgets[child.widgetId];},onShow: function() {this.animationInProgress=false;},onHide: function() {this.animationInProgress=false;}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/TreeWithNode.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/UsTextbox.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/UsTextbox.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/UsTextbox.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/UsTextbox.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,11 @@
+
+dojo.provide("dojo.widget.UsTextbox");dojo.require("dojo.widget.ValidationTextbox");dojo.require("dojo.validate.us");dojo.widget.defineWidget(
+"dojo.widget.UsStateTextbox",dojo.widget.ValidationTextbox,{mixInProperties: function(localProperties){dojo.widget.UsStateTextbox.superclass.mixInProperties.apply(this, arguments);if(localProperties.allowterritories){this.flags.allowTerritories = (localProperties.allowterritories == "true");}
+if(localProperties.allowmilitary){this.flags.allowMilitary = (localProperties.allowmilitary == "true");}},isValid: function(){return dojo.validate.us.isState(this.textbox.value, this.flags);}}
+);dojo.widget.defineWidget(
+"dojo.widget.UsZipTextbox",dojo.widget.ValidationTextbox,{isValid: function(){return dojo.validate.us.isZipCode(this.textbox.value);}}
+);dojo.widget.defineWidget(
+"dojo.widget.UsSocialSecurityNumberTextbox",dojo.widget.ValidationTextbox,{isValid: function(){return dojo.validate.us.isSocialSecurityNumber(this.textbox.value);}}
+);dojo.widget.defineWidget(
+"dojo.widget.UsPhoneNumberTextbox",dojo.widget.ValidationTextbox,{isValid: function(){return dojo.validate.us.isPhoneNumber(this.textbox.value);}}
+);
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/UsTextbox.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ValidationTextbox.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ValidationTextbox.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ValidationTextbox.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ValidationTextbox.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,9 @@
+
+dojo.provide("dojo.widget.ValidationTextbox");dojo.require("dojo.widget.Textbox");dojo.require("dojo.i18n.common");dojo.widget.defineWidget(
+"dojo.widget.ValidationTextbox",dojo.widget.Textbox,function() {this.flags = {};},{required: false,rangeClass: "range",invalidClass: "invalid",missingClass: "missing",classPrefix: "dojoValidate",size: "",maxlength: "",promptMessage: "",invalidMessage: "",missingMessage: "",rangeMessage: "",listenOnKeyPress: true,htmlfloat: "none",lastCheckedValue: null,templatePath: dojo.uri.dojoUri("src/widget/templates/ValidationTextbox.html"),templateCssPath: dojo.uri.dojoUri("src/widget/templates/Validate.css"),invalidSpan: null,missingSpan: null,rangeSpan: null,getValue: function() {return this.textbox.value;},setValue: function(value) {this.textbox.value = value;this.update();},isValid: function() { return true; },isInRange: function() { return true; },isEmpty: function() {return ( /^\s*$/.test(this.textbox.value) );},isMissing: function() {return ( this.required && this.isEmpty() );},update: function() {this.lastCheckedValue = this.textbox.value;this.missingSpan.style.display = "none"
 ;this.invalidSpan.style.display = "none";this.rangeSpan.style.display = "none";var empty = this.isEmpty();var valid = true;if(this.promptMessage != this.textbox.value){valid = this.isValid();}
+var missing = this.isMissing();if(missing){this.missingSpan.style.display = "";}else if( !empty && !valid ){this.invalidSpan.style.display = "";}else if( !empty && !this.isInRange() ){this.rangeSpan.style.display = "";}
+this.highlight();},updateClass: function(className){var pre = this.classPrefix;dojo.html.removeClass(this.textbox,pre+"Empty");dojo.html.removeClass(this.textbox,pre+"Valid");dojo.html.removeClass(this.textbox,pre+"Invalid");dojo.html.addClass(this.textbox,pre+className);},highlight: function() {if (this.isEmpty()) {this.updateClass("Empty");}else if (this.isValid() && this.isInRange() ){this.updateClass("Valid");}else if(this.textbox.value != this.promptMessage){this.updateClass("Invalid");}else{this.updateClass("Empty");}},onfocus: function(evt) {if ( !this.listenOnKeyPress) {this.updateClass("Empty");}},onblur: function(evt) {this.filter();this.update();},onkeyup: function(evt){if(this.listenOnKeyPress){this.update();}else if (this.textbox.value != this.lastCheckedValue){this.updateClass("Empty");}},postMixInProperties: function(localProperties, frag) {dojo.widget.ValidationTextbox.superclass.postMixInProperties.apply(this, arguments);this.messages = dojo.i18n.getLocaliza
 tion("dojo.widget", "validate", this.lang);dojo.lang.forEach(["invalidMessage", "missingMessage", "rangeMessage"], function(prop) {if(this[prop]){ this.messages[prop] = this[prop]; }}, this);},fillInTemplate: function() {dojo.widget.ValidationTextbox.superclass.fillInTemplate.apply(this, arguments);this.textbox.isValid = function() { this.isValid.call(this); };this.textbox.isMissing = function() { this.isMissing.call(this); };this.textbox.isInRange = function() { this.isInRange.call(this); };dojo.html.setClass(this.invalidSpan,this.invalidClass);this.update();this.filter();if(dojo.render.html.ie){ dojo.html.addClass(this.domNode, "ie"); }
+if(dojo.render.html.moz){ dojo.html.addClass(this.domNode, "moz"); }
+if(dojo.render.html.opera){ dojo.html.addClass(this.domNode, "opera"); }
+if(dojo.render.html.safari){ dojo.html.addClass(this.domNode, "safari"); }}}
+);
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/ValidationTextbox.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Widget.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Widget.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Widget.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Widget.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,26 @@
+
+dojo.provide("dojo.widget.Widget");dojo.require("dojo.lang.func");dojo.require("dojo.lang.array");dojo.require("dojo.lang.extras");dojo.require("dojo.lang.declare");dojo.require("dojo.ns");dojo.require("dojo.widget.Manager");dojo.require("dojo.event.*");dojo.require("dojo.a11y");dojo.declare("dojo.widget.Widget", null,function(){this.children = [];this.extraArgs = {};},{parent: null,children: [],extraArgs: {},isTopLevel:  false,isEnabled: true,isContainer: false,widgetId: "",widgetType: "Widget",ns: "dojo",getNamespacedType: function(){return (this.ns ? this.ns + ":" + this.widgetType : this.widgetType).toLowerCase();},toString: function(){return '[Widget ' + this.getNamespacedType() + ', ' + (this.widgetId || 'NO ID') + ']';},repr: function(){return this.toString();},enable: function(){this.isEnabled = true;},disable: function(){this.isEnabled = false;},hide: function(){this.isHidden = true;},show: function(){this.isHidden = false;},onResized: function(){this.notifyChildren
 OfResize();},notifyChildrenOfResize: function(){for(var i=0; i<this.children.length; i++){var child = this.children[i];if( child.onResized ){child.onResized();}}},create: function( args, fragment, parent, ns){if(ns){this.ns = ns;}
+this.satisfyPropertySets(args, fragment, parent);this.mixInProperties(args, fragment, parent);this.postMixInProperties(args, fragment, parent);dojo.widget.manager.add(this);this.buildRendering(args, fragment, parent);this.initialize(args, fragment, parent);this.postInitialize(args, fragment, parent);this.postCreate(args, fragment, parent);return this;},destroy: function(finalize){this.destroyChildren();this.uninitialize();this.destroyRendering(finalize);dojo.widget.manager.removeById(this.widgetId);},destroyChildren: function(){var widget;var i=0;while(this.children.length > i){widget = this.children[i];if (widget instanceof dojo.widget.Widget) {this.removeChild(widget);widget.destroy();continue;}
+i++;}},getChildrenOfType: function(type, recurse){var ret = [];var isFunc = dojo.lang.isFunction(type);if(!isFunc){type = type.toLowerCase();}
+for(var x=0; x<this.children.length; x++){if(isFunc){if(this.children[x] instanceof type){ret.push(this.children[x]);}}else{if(this.children[x].widgetType.toLowerCase() == type){ret.push(this.children[x]);}}
+if(recurse){ret = ret.concat(this.children[x].getChildrenOfType(type, recurse));}}
+return ret;},getDescendants: function(){var result = [];var stack = [this];var elem;while ((elem = stack.pop())){result.push(elem);if (elem.children) {dojo.lang.forEach(elem.children, function(elem) { stack.push(elem); });}}
+return result;},isFirstChild: function(){return this === this.parent.children[0];},isLastChild: function() {return this === this.parent.children[this.parent.children.length-1];},satisfyPropertySets: function(args){return args;},mixInProperties: function(args, frag){if((args["fastMixIn"])||(frag["fastMixIn"])){for(var x in args){this[x] = args[x];}
+return;}
+var undef;var lcArgs = dojo.widget.lcArgsCache[this.widgetType];if ( lcArgs == null ){lcArgs = {};for(var y in this){lcArgs[((new String(y)).toLowerCase())] = y;}
+dojo.widget.lcArgsCache[this.widgetType] = lcArgs;}
+var visited = {};for(var x in args){if(!this[x]){var y = lcArgs[(new String(x)).toLowerCase()];if(y){args[y] = args[x];x = y;}}
+if(visited[x]){ continue; }
+visited[x] = true;if((typeof this[x]) != (typeof undef)){if(typeof args[x] != "string"){this[x] = args[x];}else{if(dojo.lang.isString(this[x])){this[x] = args[x];}else if(dojo.lang.isNumber(this[x])){this[x] = new Number(args[x]);}else if(dojo.lang.isBoolean(this[x])){this[x] = (args[x].toLowerCase()=="false") ? false : true;}else if(dojo.lang.isFunction(this[x])){if(args[x].search(/[^\w\.]+/i) == -1){this[x] = dojo.evalObjPath(args[x], false);}else{var tn = dojo.lang.nameAnonFunc(new Function(args[x]), this);dojo.event.kwConnect({srcObj: this,srcFunc: x,adviceObj: this,adviceFunc: tn});}}else if(dojo.lang.isArray(this[x])){this[x] = args[x].split(";");} else if (this[x] instanceof Date) {this[x] = new Date(Number(args[x]));}else if(typeof this[x] == "object"){if (this[x] instanceof dojo.uri.Uri){this[x] = args[x];}else{var pairs = args[x].split(";");for(var y=0; y<pairs.length; y++){var si = pairs[y].indexOf(":");if((si != -1)&&(pairs[y].length>si)){this[x][pairs[y].substr(
 0, si).replace(/^\s+|\s+$/g, "")] = pairs[y].substr(si+1);}}}}else{this[x] = args[x];}}}else{this.extraArgs[x.toLowerCase()] = args[x];}}},postMixInProperties: function(args, frag, parent){},initialize: function(args, frag, parent){return false;},postInitialize: function(args, frag, parent){return false;},postCreate: function(args, frag, parent){return false;},uninitialize: function(){return false;},buildRendering: function(args, frag, parent){dojo.unimplemented("dojo.widget.Widget.buildRendering, on "+this.toString()+", ");return false;},destroyRendering: function(){dojo.unimplemented("dojo.widget.Widget.destroyRendering");return false;},addedTo: function(parent){},addChild: function(child){dojo.unimplemented("dojo.widget.Widget.addChild");return false;},removeChild: function(widget){for(var x=0; x<this.children.length; x++){if(this.children[x] === widget){this.children.splice(x, 1);break;}}
+return widget;},getPreviousSibling: function(){var idx = this.getParentIndex();if (idx<=0) return null;return this.parent.children[idx-1];},getSiblings: function(){return this.parent.children;},getParentIndex: function(){return dojo.lang.indexOf(this.parent.children, this, true);},getNextSibling: function(){var idx = this.getParentIndex();if (idx == this.parent.children.length-1){return null;}
+if (idx < 0){return null;}
+return this.parent.children[idx+1];}});dojo.widget.lcArgsCache = {};dojo.widget.tags = {};dojo.widget.tags.addParseTreeHandler = function(type){dojo.deprecated("addParseTreeHandler", ". ParseTreeHandlers are now reserved for components. Any unfiltered DojoML tag without a ParseTreeHandler is assumed to be a widget", "0.5");}
+dojo.widget.tags["dojo:propertyset"] = function(fragment, widgetParser, parentComp){var properties = widgetParser.parseProperties(fragment["dojo:propertyset"]);}
+dojo.widget.tags["dojo:connect"] = function(fragment, widgetParser, parentComp){var properties = widgetParser.parseProperties(fragment["dojo:connect"]);}
+dojo.widget.buildWidgetFromParseTree = function(				type,frag,parser,parentComp,insertionIndex,localProps){dojo.a11y.setAccessibleMode();var stype = type.split(":");stype = (stype.length == 2) ? stype[1] : type;var localProperties = localProps || parser.parseProperties(frag[frag["ns"]+":"+stype]);var twidget = dojo.widget.manager.getImplementation(stype,null,null,frag["ns"]);if(!twidget){throw new Error('cannot find "' + type + '" widget');}else if (!twidget.create){throw new Error('"' + type + '" widget object has no "create" method and does not appear to implement *Widget');}
+localProperties["dojoinsertionindex"] = insertionIndex;var ret = twidget.create(localProperties, frag, parentComp, frag["ns"]);return ret;}
+dojo.widget.defineWidget = function(			widgetClass,renderer,superclasses,init,props){if(dojo.lang.isString(arguments[3])){dojo.widget._defineWidget(arguments[0], arguments[3], arguments[1], arguments[4], arguments[2]);}else{var args = [ arguments[0] ], p = 3;if(dojo.lang.isString(arguments[1])){args.push(arguments[1], arguments[2]);}else{args.push('', arguments[1]);p = 2;}
+if(dojo.lang.isFunction(arguments[p])){args.push(arguments[p], arguments[p+1]);}else{args.push(null, arguments[p]);}
+dojo.widget._defineWidget.apply(this, args);}}
+dojo.widget.defineWidget.renderers = "html|svg|vml";dojo.widget._defineWidget = function(widgetClass , renderer , superclasses , init , props ){var module = widgetClass.split(".");var type = module.pop();var regx = "\\.(" + (renderer ? renderer + '|' : '') + dojo.widget.defineWidget.renderers + ")\\.";var r = widgetClass.search(new RegExp(regx));module = (r < 0 ? module.join(".") : widgetClass.substr(0, r));dojo.widget.manager.registerWidgetPackage(module);var pos = module.indexOf(".");var nsName = (pos > -1) ? module.substring(0,pos) : module;props=(props)||{};props.widgetType = type;if((!init)&&(props["classConstructor"])){init = props.classConstructor;delete props.classConstructor;}
+dojo.declare(widgetClass, superclasses, init, props);}

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Widget.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Wizard.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Wizard.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Wizard.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Wizard.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,13 @@
+
+dojo.provide("dojo.widget.Wizard");dojo.require("dojo.widget.*");dojo.require("dojo.widget.LayoutContainer");dojo.require("dojo.widget.ContentPane");dojo.require("dojo.event.*");dojo.require("dojo.html.style");dojo.widget.defineWidget(
+"dojo.widget.WizardContainer",dojo.widget.LayoutContainer,{labelPosition: "top",templatePath: dojo.uri.dojoUri("src/widget/templates/Wizard.html"),templateCssPath: dojo.uri.dojoUri("src/widget/templates/Wizard.css"),selected: null,wizardNode: null,wizardPanelContainerNode: null,wizardControlContainerNode: null,previousButton: null,nextButton: null,cancelButton: null,doneButton: null,nextButtonLabel: "next",previousButtonLabel: "previous",cancelButtonLabel: "cancel",doneButtonLabel: "done",cancelFunction : "",hideDisabledButtons: false,fillInTemplate: function(args, frag){dojo.event.connect(this.nextButton, "onclick", this, "nextPanel");dojo.event.connect(this.previousButton, "onclick", this, "previousPanel");if (this.cancelFunction){dojo.event.connect(this.cancelButton, "onclick", this.cancelFunction);}else{this.cancelButton.style.display = "none";}
+dojo.event.connect(this.doneButton, "onclick", this, "done");this.nextButton.value = this.nextButtonLabel;this.previousButton.value = this.previousButtonLabel;this.cancelButton.value = this.cancelButtonLabel;this.doneButton.value = this.doneButtonLabel;},checkButtons: function(){var lastStep = !this.hasNextPanel();this.nextButton.disabled = lastStep;this.setButtonClass(this.nextButton);if(this.selected.doneFunction){this.doneButton.style.display = "";if(lastStep){this.nextButton.style.display = "none";}}else{this.doneButton.style.display = "none";}
+this.previousButton.disabled = ((!this.hasPreviousPanel()) || (!this.selected.canGoBack));this.setButtonClass(this.previousButton);},setButtonClass: function(button){if(!this.hideDisabledButtons){button.style.display = "";dojo.html.setClass(button, button.disabled ? "WizardButtonDisabled" : "WizardButton");}else{button.style.display = button.disabled ? "none" : "";}},registerChild: function(panel, insertionIndex){dojo.widget.WizardContainer.superclass.registerChild.call(this, panel, insertionIndex);this.wizardPanelContainerNode.appendChild(panel.domNode);panel.hide();if(!this.selected){this.onSelected(panel);}
+this.checkButtons();},onSelected: function(panel){if(this.selected ){if (this.selected.checkPass()) {this.selected.hide();} else {return;}}
+panel.show();this.selected = panel;},getPanels: function() {return this.getChildrenOfType("WizardPane", false);},selectedIndex: function() {if (this.selected) {return dojo.lang.indexOf(this.getPanels(), this.selected);}
+return -1;},nextPanel: function() {var selectedIndex = this.selectedIndex();if ( selectedIndex > -1 ) {var childPanels = this.getPanels();if (childPanels[selectedIndex + 1]) {this.onSelected(childPanels[selectedIndex + 1]);}}
+this.checkButtons();},previousPanel: function() {var selectedIndex = this.selectedIndex();if ( selectedIndex > -1 ) {var childPanels = this.getPanels();if (childPanels[selectedIndex - 1]) {this.onSelected(childPanels[selectedIndex - 1]);}}
+this.checkButtons();},hasNextPanel: function() {var selectedIndex = this.selectedIndex();return (selectedIndex < (this.getPanels().length - 1));},hasPreviousPanel: function() {var selectedIndex = this.selectedIndex();return (selectedIndex > 0);},done: function() {this.selected.done();}});dojo.widget.defineWidget(
+"dojo.widget.WizardPane",dojo.widget.ContentPane,{canGoBack: true,passFunction: "",doneFunction: "",fillInTemplate: function(args, frag) {if (this.passFunction) {this.passFunction = dj_global[this.passFunction];}
+if (this.doneFunction) {this.doneFunction = dj_global[this.doneFunction];}},checkPass: function() {if (this.passFunction && dojo.lang.isFunction(this.passFunction)) {var failMessage = this.passFunction();if (failMessage) {alert(failMessage);return false;}}
+return true;},done: function() {if (this.doneFunction && dojo.lang.isFunction(this.doneFunction)) {this.doneFunction();}}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/Wizard.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/YahooMap.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/YahooMap.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/YahooMap.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/YahooMap.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,19 @@
+
+dojo.provide("dojo.widget.YahooMap");dojo.require("dojo.event.*");dojo.require("dojo.math");dojo.require("dojo.widget.*");dojo.require("dojo.widget.HtmlWidget");(function(){var yappid = djConfig["yAppId"]||djConfig["yahooAppId"]||"dojotoolkit";if(!dojo.hostenv.post_load_){if(yappid == "dojotoolkit"){dojo.debug("please provide a unique Yahoo App ID in djConfig.yahooAppId when using the map widget");}
+var tag = "<scr"+"ipt src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid="+yappid+"'></scri"+"pt>";if(!dj_global["YMap"]){document.write(tag);}}else{dojo.debug("cannot initialize map system after the page has been loaded! Please either manually include the script block provided by Yahoo in your page or require() the YahooMap widget before onload has fired");}})();dojo.widget.defineWidget(
+"dojo.widget.YahooMap",dojo.widget.HtmlWidget,function(){this.map=null;this.datasrc="";this.data=[];this.width=0;this.height=0;this.controls=["zoomlong","maptype","pan"];},{isContainer: false,templatePath:null,templateCssPath:null,findCenter:function(aPts){var start=new YGeoPoint(37,-90);if(aPts.length==0) return start;var minLat,maxLat, minLon, maxLon, cLat, cLon;minLat=maxLat=aPts[0].Lat;minLon=maxLon=aPts[0].Lon;for(var i=0; i<aPts.length; i++){minLat=Math.min(minLat,aPts[i].Lat);maxLat=Math.max(maxLat,aPts[i].Lat);minLon=Math.min(minLon,aPts[i].Lon);maxLon=Math.max(maxLon,aPts[i].Lon);}
+cLat=dojo.math.round((minLat+maxLat)/2,6);cLon=dojo.math.round((minLon+maxLon)/2,6);return new YGeoPoint(cLat,cLon);},setControls:function(){var methodmap={maptype:"addTypeControl",pan:"addPanControl",zoomlong:"addZoomLong",zoomshort:"addZoomShort"}
+var c=this.controls;for(var i=0; i<c.length; i++){var controlMethod=methodmap[c[i].toLowerCase()];if(this.map[controlMethod]){this.map[controlMethod]();}}},parse:function(table){this.data=[];var h=table.getElementsByTagName("thead")[0];if(!h){return;}
+var a=[];var cols=h.getElementsByTagName("td");if(cols.length==0){cols=h.getElementsByTagName("th");}
+for(var i=0; i<cols.length; i++){var c=cols[i].innerHTML.toLowerCase();if(c=="long") c="lng";a.push(c);}
+var b=table.getElementsByTagName("tbody")[0];if(!b){return;}
+for(var i=0; i<b.childNodes.length; i++){if(!(b.childNodes[i].nodeName&&b.childNodes[i].nodeName.toLowerCase()=="tr")){continue;}
+var cells=b.childNodes[i].getElementsByTagName("td");var o={};for(var j=0; j<a.length; j++){var col=a[j];if(col=="lat"||col=="lng"){o[col]=parseFloat(cells[j].innerHTML);}else{o[col]=cells[j].innerHTML;}}
+this.data.push(o);}},render:function(){var pts=[];var d=this.data;for(var i=0; i<d.length; i++){var pt=new YGeoPoint(d[i].lat, d[i].lng);pts.push(pt);var icon=d[i].icon||null;if(icon){icon=new YImage(icon);}
+var m=new YMarker(pt,icon);if(d[i].description){m.addAutoExpand("<div>"+d[i].description+"</div>");}
+this.map.addOverlay(m);}
+var c=this.findCenter(pts);var z=this.map.getZoomLevel(pts);this.map.drawZoomAndCenter(c,z);},initialize:function(args, frag){if(!YMap || !YGeoPoint){dojo.raise("dojo.widget.YahooMap: The Yahoo Map script must be included in order to use this widget.");}
+if(this.datasrc){this.parse(dojo.byId(this.datasrc));}
+else if(this.domNode.getElementsByTagName("table")[0]){this.parse(this.domNode.getElementsByTagName("table")[0]);}},postCreate:function(){while(this.domNode.childNodes.length>0){this.domNode.removeChild(this.domNode.childNodes[0]);}
+if(this.width>0&&this.height>0){this.map=new YMap(this.domNode, YAHOO_MAP_REG, new YSize(this.width, this.height));}else{this.map=new YMap(this.domNode);}
+this.setControls();this.render();}});
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/YahooMap.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/__package__.js?view=auto&rev=468816
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/__package__.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/__package__.js Sat Oct 28 18:52:42 2006
@@ -0,0 +1,2 @@
+
+dojo.kwCompoundRequire({common: ["dojo.xml.Parse","dojo.widget.Widget","dojo.widget.Parse","dojo.widget.Manager"],browser: ["dojo.widget.DomWidget","dojo.widget.HtmlWidget"],dashboard: ["dojo.widget.DomWidget","dojo.widget.HtmlWidget"],svg: 	 ["dojo.widget.SvgWidget"],rhino: 	 ["dojo.widget.SwtWidget"]});dojo.provide("dojo.widget.*");
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/__package__.js
------------------------------------------------------------------------------
    svn:eol-style = native