geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r794787 [28/34] - in /geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src: ./ animation/ cal/ charting/ charting/svg/ charting/vml/ collections/ crypto/ data/ data/core/ data/old/ data/old/format/ data/old/provider/ date/ debug/...
Date Thu, 16 Jul 2009 19:14:56 GMT
Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicController.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicController.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicController.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicController.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,154 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeBasicController");
+dojo.require("dojo.event.*");
+dojo.require("dojo.json");
+dojo.require("dojo.io.*");
+dojo.widget.defineWidget("dojo.widget.TreeBasicController", dojo.widget.HtmlWidget, {widgetType:"TreeBasicController", DNDController:"", dieWithTree:false, initialize:function (args, frag) {
+	if (this.DNDController == "create") {
+		dojo.require("dojo.dnd.TreeDragAndDrop");
+		this.DNDController = new dojo.dnd.TreeDNDController(this);
+	}
+}, listenTree:function (tree) {
+	dojo.event.topic.subscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
+	dojo.event.topic.subscribe(tree.eventNames.treeClick, this, "onTreeClick");
+	dojo.event.topic.subscribe(tree.eventNames.treeCreate, this, "onTreeCreate");
+	dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
+	if (this.DNDController) {
+		this.DNDController.listenTree(tree);
+	}
+}, unlistenTree:function (tree) {
+	dojo.event.topic.unsubscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
+	dojo.event.topic.unsubscribe(tree.eventNames.treeClick, this, "onTreeClick");
+	dojo.event.topic.unsubscribe(tree.eventNames.treeCreate, this, "onTreeCreate");
+	dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
+}, onTreeDestroy:function (message) {
+	var tree = message.source;
+	this.unlistenTree(tree);
+	if (this.dieWithTree) {
+		this.destroy();
+	}
+}, onCreateDOMNode:function (message) {
+	var node = message.source;
+	if (node.expandLevel > 0) {
+		this.expandToLevel(node, node.expandLevel);
+	}
+}, onTreeCreate:function (message) {
+	var tree = message.source;
+	var _this = this;
+	if (tree.expandLevel) {
+		dojo.lang.forEach(tree.children, function (child) {
+			_this.expandToLevel(child, tree.expandLevel - 1);
+		});
+	}
+}, expandToLevel:function (node, level) {
+	if (level == 0) {
+		return;
+	}
+	var children = node.children;
+	var _this = this;
+	var handler = function (node, expandLevel) {
+		this.node = node;
+		this.expandLevel = expandLevel;
+		this.process = function () {
+			for (var i = 0; i < this.node.children.length; i++) {
+				var child = node.children[i];
+				_this.expandToLevel(child, this.expandLevel);
+			}
+		};
+	};
+	var h = new handler(node, level - 1);
+	this.expand(node, false, h, h.process);
+}, onTreeClick:function (message) {
+	var node = message.source;
+	if (node.isLocked()) {
+		return false;
+	}
+	if (node.isExpanded) {
+		this.collapse(node);
+	} else {
+		this.expand(node);
+	}
+}, expand:function (node, sync, callObj, callFunc) {
+	node.expand();
+	if (callFunc) {
+		callFunc.apply(callObj, [node]);
+	}
+}, collapse:function (node) {
+	node.collapse();
+}, canMove:function (child, newParent) {
+	if (child.actionIsDisabled(child.actions.MOVE)) {
+		return false;
+	}
+	if (child.parent !== newParent && newParent.actionIsDisabled(newParent.actions.ADDCHILD)) {
+		return false;
+	}
+	var node = newParent;
+	while (node.isTreeNode) {
+		if (node === child) {
+			return false;
+		}
+		node = node.parent;
+	}
+	return true;
+}, move:function (child, newParent, index) {
+	if (!this.canMove(child, newParent)) {
+		return false;
+	}
+	var result = this.doMove(child, newParent, index);
+	if (!result) {
+		return result;
+	}
+	if (newParent.isTreeNode) {
+		this.expand(newParent);
+	}
+	return result;
+}, doMove:function (child, newParent, index) {
+	child.tree.move(child, newParent, index);
+	return true;
+}, canRemoveNode:function (child) {
+	if (child.actionIsDisabled(child.actions.REMOVE)) {
+		return false;
+	}
+	return true;
+}, removeNode:function (node, callObj, callFunc) {
+	if (!this.canRemoveNode(node)) {
+		return false;
+	}
+	return this.doRemoveNode(node, callObj, callFunc);
+}, doRemoveNode:function (node, callObj, callFunc) {
+	node.tree.removeNode(node);
+	if (callFunc) {
+		callFunc.apply(dojo.lang.isUndefined(callObj) ? this : callObj, [node]);
+	}
+}, canCreateChild:function (parent, index, data) {
+	if (parent.actionIsDisabled(parent.actions.ADDCHILD)) {
+		return false;
+	}
+	return true;
+}, createChild:function (parent, index, data, callObj, callFunc) {
+	if (!this.canCreateChild(parent, index, data)) {
+		return false;
+	}
+	return this.doCreateChild.apply(this, arguments);
+}, doCreateChild:function (parent, index, data, callObj, callFunc) {
+	var widgetType = data.widgetType ? data.widgetType : "TreeNode";
+	var newChild = dojo.widget.createWidget(widgetType, data);
+	parent.addChild(newChild, index);
+	this.expand(parent);
+	if (callFunc) {
+		callFunc.apply(callObj, [newChild]);
+	}
+	return newChild;
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicController.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicController.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicController.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicControllerV3.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicControllerV3.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicControllerV3.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicControllerV3.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,461 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeBasicControllerV3");
+dojo.require("dojo.event.*");
+dojo.require("dojo.json");
+dojo.require("dojo.io.*");
+dojo.require("dojo.widget.TreeCommon");
+dojo.require("dojo.widget.TreeNodeV3");
+dojo.require("dojo.widget.TreeV3");
+dojo.widget.defineWidget("dojo.widget.TreeBasicControllerV3", [dojo.widget.HtmlWidget, dojo.widget.TreeCommon], function () {
+	this.listenedTrees = {};
+}, {listenTreeEvents:["afterSetFolder", "afterTreeCreate", "beforeTreeDestroy"], listenNodeFilter:function (elem) {
+	return elem instanceof dojo.widget.Widget;
+}, editor:null, initialize:function (args) {
+	if (args.editor) {
+		this.editor = dojo.widget.byId(args.editor);
+		this.editor.controller = this;
+	}
+}, getInfo:function (elem) {
+	return elem.getInfo();
+}, onBeforeTreeDestroy:function (message) {
+	this.unlistenTree(message.source);
+}, onAfterSetFolder:function (message) {
+	if (message.source.expandLevel > 0) {
+		this.expandToLevel(message.source, message.source.expandLevel);
+	}
+	if (message.source.loadLevel > 0) {
+		this.loadToLevel(message.source, message.source.loadLevel);
+	}
+}, _focusNextVisible:function (nodeWidget) {
+	if (nodeWidget.isFolder && nodeWidget.isExpanded && nodeWidget.children.length > 0) {
+		returnWidget = nodeWidget.children[0];
+	} else {
+		while (nodeWidget.isTreeNode && nodeWidget.isLastChild()) {
+			nodeWidget = nodeWidget.parent;
+		}
+		if (nodeWidget.isTreeNode) {
+			var returnWidget = nodeWidget.parent.children[nodeWidget.getParentIndex() + 1];
+		}
+	}
+	if (returnWidget && returnWidget.isTreeNode) {
+		this._focusLabel(returnWidget);
+		return returnWidget;
+	}
+}, _focusPreviousVisible:function (nodeWidget) {
+	var returnWidget = nodeWidget;
+	if (!nodeWidget.isFirstChild()) {
+		var previousSibling = nodeWidget.parent.children[nodeWidget.getParentIndex() - 1];
+		nodeWidget = previousSibling;
+		while (nodeWidget.isFolder && nodeWidget.isExpanded && nodeWidget.children.length > 0) {
+			returnWidget = nodeWidget;
+			nodeWidget = nodeWidget.children[nodeWidget.children.length - 1];
+		}
+	} else {
+		nodeWidget = nodeWidget.parent;
+	}
+	if (nodeWidget && nodeWidget.isTreeNode) {
+		returnWidget = nodeWidget;
+	}
+	if (returnWidget && returnWidget.isTreeNode) {
+		this._focusLabel(returnWidget);
+		return returnWidget;
+	}
+}, _focusZoomIn:function (nodeWidget) {
+	var returnWidget = nodeWidget;
+	if (nodeWidget.isFolder && !nodeWidget.isExpanded) {
+		this.expand(nodeWidget);
+	} else {
+		if (nodeWidget.children.length > 0) {
+			nodeWidget = nodeWidget.children[0];
+		}
+	}
+	if (nodeWidget && nodeWidget.isTreeNode) {
+		returnWidget = nodeWidget;
+	}
+	if (returnWidget && returnWidget.isTreeNode) {
+		this._focusLabel(returnWidget);
+		return returnWidget;
+	}
+}, _focusZoomOut:function (node) {
+	var returnWidget = node;
+	if (node.isFolder && node.isExpanded) {
+		this.collapse(node);
+	} else {
+		node = node.parent;
+	}
+	if (node && node.isTreeNode) {
+		returnWidget = node;
+	}
+	if (returnWidget && returnWidget.isTreeNode) {
+		this._focusLabel(returnWidget);
+		return returnWidget;
+	}
+}, onFocusNode:function (e) {
+	var node = this.domElement2TreeNode(e.target);
+	if (node) {
+		node.viewFocus();
+		dojo.event.browser.stopEvent(e);
+	}
+}, onBlurNode:function (e) {
+	var node = this.domElement2TreeNode(e.target);
+	if (!node) {
+		return;
+	}
+	var labelNode = node.labelNode;
+	labelNode.setAttribute("tabIndex", "-1");
+	node.viewUnfocus();
+	dojo.event.browser.stopEvent(e);
+	node.tree.domNode.setAttribute("tabIndex", "0");
+}, _focusLabel:function (node) {
+	var lastFocused = node.tree.lastFocused;
+	var labelNode;
+	if (lastFocused && lastFocused.labelNode) {
+		labelNode = lastFocused.labelNode;
+		dojo.event.disconnect(labelNode, "onblur", this, "onBlurNode");
+		labelNode.setAttribute("tabIndex", "-1");
+		dojo.html.removeClass(labelNode, "TreeLabelFocused");
+	}
+	labelNode = node.labelNode;
+	labelNode.setAttribute("tabIndex", "0");
+	node.tree.lastFocused = node;
+	dojo.html.addClass(labelNode, "TreeLabelFocused");
+	dojo.event.connectOnce(labelNode, "onblur", this, "onBlurNode");
+	dojo.event.connectOnce(labelNode, "onfocus", this, "onFocusNode");
+	labelNode.focus();
+}, onKey:function (e) {
+	if (!e.key || e.ctrkKey || e.altKey) {
+		return;
+	}
+	var nodeWidget = this.domElement2TreeNode(e.target);
+	if (!nodeWidget) {
+		return;
+	}
+	var treeWidget = nodeWidget.tree;
+	if (treeWidget.lastFocused && treeWidget.lastFocused.labelNode) {
+		nodeWidget = treeWidget.lastFocused;
+	}
+	switch (e.key) {
+	  case e.KEY_TAB:
+		if (e.shiftKey) {
+			treeWidget.domNode.setAttribute("tabIndex", "-1");
+		}
+		break;
+	  case e.KEY_RIGHT_ARROW:
+		this._focusZoomIn(nodeWidget);
+		dojo.event.browser.stopEvent(e);
+		break;
+	  case e.KEY_LEFT_ARROW:
+		this._focusZoomOut(nodeWidget);
+		dojo.event.browser.stopEvent(e);
+		break;
+	  case e.KEY_UP_ARROW:
+		this._focusPreviousVisible(nodeWidget);
+		dojo.event.browser.stopEvent(e);
+		break;
+	  case e.KEY_DOWN_ARROW:
+		this._focusNextVisible(nodeWidget);
+		dojo.event.browser.stopEvent(e);
+		break;
+	}
+}, onFocusTree:function (e) {
+	if (!e.currentTarget) {
+		return;
+	}
+	try {
+		var treeWidget = this.getWidgetByNode(e.currentTarget);
+		if (!treeWidget || !treeWidget.isTree) {
+			return;
+		}
+		var nodeWidget = this.getWidgetByNode(treeWidget.domNode.firstChild);
+		if (nodeWidget && nodeWidget.isTreeNode) {
+			if (treeWidget.lastFocused && treeWidget.lastFocused.isTreeNode) {
+				nodeWidget = treeWidget.lastFocused;
+			}
+			this._focusLabel(nodeWidget);
+		}
+	}
+	catch (e) {
+	}
+}, onAfterTreeCreate:function (message) {
+	var tree = message.source;
+	dojo.event.browser.addListener(tree.domNode, "onKey", dojo.lang.hitch(this, this.onKey));
+	dojo.event.browser.addListener(tree.domNode, "onmousedown", dojo.lang.hitch(this, this.onTreeMouseDown));
+	dojo.event.browser.addListener(tree.domNode, "onclick", dojo.lang.hitch(this, this.onTreeClick));
+	dojo.event.browser.addListener(tree.domNode, "onfocus", dojo.lang.hitch(this, this.onFocusTree));
+	tree.domNode.setAttribute("tabIndex", "0");
+	if (tree.expandLevel) {
+		this.expandToLevel(tree, tree.expandLevel);
+	}
+	if (tree.loadLevel) {
+		this.loadToLevel(tree, tree.loadLevel);
+	}
+}, onTreeMouseDown:function (e) {
+}, onTreeClick:function (e) {
+	var domElement = e.target;
+	var node = this.domElement2TreeNode(domElement);
+	if (!node || !node.isTreeNode) {
+		return;
+	}
+	var checkExpandClick = function (el) {
+		return el === node.expandNode;
+	};
+	if (this.checkPathCondition(domElement, checkExpandClick)) {
+		this.processExpandClick(node);
+	}
+	this._focusLabel(node);
+}, processExpandClick:function (node) {
+	if (node.isExpanded) {
+		this.collapse(node);
+	} else {
+		this.expand(node);
+	}
+}, batchExpandTimeout:20, expandAll:function (nodeOrTree) {
+	return this.expandToLevel(nodeOrTree, Number.POSITIVE_INFINITY);
+}, collapseAll:function (nodeOrTree) {
+	var _this = this;
+	var filter = function (elem) {
+		return (elem instanceof dojo.widget.Widget) && elem.isFolder && elem.isExpanded;
+	};
+	if (nodeOrTree.isTreeNode) {
+		this.processDescendants(nodeOrTree, filter, this.collapse);
+	} else {
+		if (nodeOrTree.isTree) {
+			dojo.lang.forEach(nodeOrTree.children, function (c) {
+				_this.processDescendants(c, filter, _this.collapse);
+			});
+		}
+	}
+}, expandToNode:function (node, withSelected) {
+	n = withSelected ? node : node.parent;
+	s = [];
+	while (!n.isExpanded) {
+		s.push(n);
+		n = n.parent;
+	}
+	dojo.lang.forEach(s, function (n) {
+		n.expand();
+	});
+}, expandToLevel:function (nodeOrTree, level) {
+	dojo.require("dojo.widget.TreeTimeoutIterator");
+	var _this = this;
+	var filterFunc = function (elem) {
+		var res = elem.isFolder || elem.children && elem.children.length;
+		return res;
+	};
+	var callFunc = function (node, iterator) {
+		_this.expand(node, true);
+		iterator.forward();
+	};
+	var iterator = new dojo.widget.TreeTimeoutIterator(nodeOrTree, callFunc, this);
+	iterator.setFilter(filterFunc);
+	iterator.timeout = this.batchExpandTimeout;
+	iterator.setMaxLevel(nodeOrTree.isTreeNode ? level - 1 : level);
+	return iterator.start(nodeOrTree.isTreeNode);
+}, getWidgetByNode:function (node) {
+	var widgetId;
+	var newNode = node;
+	while (!(widgetId = newNode.widgetId)) {
+		newNode = newNode.parentNode;
+		if (newNode == null) {
+			break;
+		}
+	}
+	if (widgetId) {
+		return dojo.widget.byId(widgetId);
+	} else {
+		if (node == null) {
+			return null;
+		} else {
+			return dojo.widget.manager.byNode(node);
+		}
+	}
+}, expand:function (node) {
+	if (node.isFolder) {
+		node.expand();
+	}
+}, collapse:function (node) {
+	if (node.isFolder) {
+		node.collapse();
+	}
+}, canEditLabel:function (node) {
+	if (node.actionIsDisabledNow(node.actions.EDIT)) {
+		return false;
+	}
+	return true;
+}, editLabelStart:function (node) {
+	if (!this.canEditLabel(node)) {
+		return false;
+	}
+	if (!this.editor.isClosed()) {
+		this.editLabelFinish(this.editor.saveOnBlur);
+	}
+	this.doEditLabelStart(node);
+}, editLabelFinish:function (save) {
+	this.doEditLabelFinish(save);
+}, doEditLabelStart:function (node) {
+	if (!this.editor) {
+		dojo.raise(this.widgetType + ": no editor specified");
+	}
+	this.editor.open(node);
+}, doEditLabelFinish:function (save, server_data) {
+	if (!this.editor) {
+		dojo.raise(this.widgetType + ": no editor specified");
+	}
+	var node = this.editor.node;
+	var editorTitle = this.editor.getContents();
+	this.editor.close(save);
+	if (save) {
+		var data = {title:editorTitle};
+		if (server_data) {
+			dojo.lang.mixin(data, server_data);
+		}
+		if (node.isPhantom) {
+			var parent = node.parent;
+			var index = node.getParentIndex();
+			node.destroy();
+			dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(this, parent, index, data);
+		} else {
+			var title = server_data && server_data.title ? server_data.title : editorTitle;
+			node.setTitle(title);
+		}
+	} else {
+		if (node.isPhantom) {
+			node.destroy();
+		}
+	}
+}, makeDefaultNode:function (parent, index) {
+	var data = {title:parent.tree.defaultChildTitle};
+	return dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(this, parent, index, data);
+}, runStages:function (check, prepare, make, finalize, expose, args) {
+	if (check && !check.apply(this, args)) {
+		return false;
+	}
+	if (prepare && !prepare.apply(this, args)) {
+		return false;
+	}
+	var result = make.apply(this, args);
+	if (finalize) {
+		finalize.apply(this, args);
+	}
+	if (!result) {
+		return result;
+	}
+	if (expose) {
+		expose.apply(this, args);
+	}
+	return result;
+}});
+dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {createAndEdit:function (parent, index) {
+	var data = {title:parent.tree.defaultChildTitle};
+	if (!this.canCreateChild(parent, index, data)) {
+		return false;
+	}
+	var child = this.doCreateChild(parent, index, data);
+	if (!child) {
+		return false;
+	}
+	this.exposeCreateChild(parent, index, data);
+	child.isPhantom = true;
+	if (!this.editor.isClosed()) {
+		this.editLabelFinish(this.editor.saveOnBlur);
+	}
+	this.doEditLabelStart(child);
+}});
+dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canClone:function (child, newParent, index, deep) {
+	return true;
+}, clone:function (child, newParent, index, deep) {
+	return this.runStages(this.canClone, this.prepareClone, this.doClone, this.finalizeClone, this.exposeClone, arguments);
+}, exposeClone:function (child, newParent) {
+	if (newParent.isTreeNode) {
+		this.expand(newParent);
+	}
+}, doClone:function (child, newParent, index, deep) {
+	var cloned = child.clone(deep);
+	newParent.addChild(cloned, index);
+	return cloned;
+}});
+dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canDetach:function (child) {
+	if (child.actionIsDisabledNow(child.actions.DETACH)) {
+		return false;
+	}
+	return true;
+}, detach:function (node) {
+	return this.runStages(this.canDetach, this.prepareDetach, this.doDetach, this.finalizeDetach, this.exposeDetach, arguments);
+}, doDetach:function (node, callObj, callFunc) {
+	node.detach();
+}});
+dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canDestroyChild:function (child) {
+	if (child.parent && !this.canDetach(child)) {
+		return false;
+	}
+	return true;
+}, destroyChild:function (node) {
+	return this.runStages(this.canDestroyChild, this.prepareDestroyChild, this.doDestroyChild, this.finalizeDestroyChild, this.exposeDestroyChild, arguments);
+}, doDestroyChild:function (node) {
+	node.destroy();
+}});
+dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canMoveNotANode:function (child, parent) {
+	if (child.treeCanMove) {
+		return child.treeCanMove(parent);
+	}
+	return true;
+}, canMove:function (child, newParent) {
+	if (!child.isTreeNode) {
+		return this.canMoveNotANode(child, newParent);
+	}
+	if (child.actionIsDisabledNow(child.actions.MOVE)) {
+		return false;
+	}
+	if (child.parent !== newParent && newParent.actionIsDisabledNow(newParent.actions.ADDCHILD)) {
+		return false;
+	}
+	var node = newParent;
+	while (node.isTreeNode) {
+		if (node === child) {
+			return false;
+		}
+		node = node.parent;
+	}
+	return true;
+}, 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;
+}, exposeMove:function (child, newParent) {
+	if (newParent.isTreeNode) {
+		this.expand(newParent);
+	}
+}});
+dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canCreateChild:function (parent, index, data) {
+	if (parent.actionIsDisabledNow(parent.actions.ADDCHILD)) {
+		return false;
+	}
+	return true;
+}, createChild:function (parent, index, data) {
+	if (!data) {
+		data = {title:parent.tree.defaultChildTitle};
+	}
+	return this.runStages(this.canCreateChild, this.prepareCreateChild, this.doCreateChild, this.finalizeCreateChild, this.exposeCreateChild, [parent, index, data]);
+}, prepareCreateChild:function () {
+	return true;
+}, finalizeCreateChild:function () {
+}, doCreateChild:function (parent, index, data) {
+	var newChild = parent.tree.createNode(data);
+	parent.addChild(newChild, index);
+	return newChild;
+}, exposeCreateChild:function (parent) {
+	return this.expand(parent);
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicControllerV3.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicControllerV3.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeBasicControllerV3.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeCommon.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeCommon.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeCommon.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeCommon.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,82 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeCommon");
+dojo.require("dojo.widget.*");
+dojo.declare("dojo.widget.TreeCommon", null, {listenTreeEvents:[], listenedTrees:{}, listenNodeFilter:null, listenTree:function (tree) {
+	var _this = this;
+	if (this.listenedTrees[tree.widgetId]) {
+		return;
+	}
+	dojo.lang.forEach(this.listenTreeEvents, function (event) {
+		var eventHandler = "on" + event.charAt(0).toUpperCase() + event.substr(1);
+		dojo.event.topic.subscribe(tree.eventNames[event], _this, eventHandler);
+	});
+	var filter;
+	if (this.listenNodeFilter) {
+		this.processDescendants(tree, this.listenNodeFilter, this.listenNode, true);
+	}
+	this.listenedTrees[tree.widgetId] = true;
+}, listenNode:function () {
+}, unlistenNode:function () {
+}, unlistenTree:function (tree, nodeFilter) {
+	var _this = this;
+	if (!this.listenedTrees[tree.widgetId]) {
+		return;
+	}
+	dojo.lang.forEach(this.listenTreeEvents, function (event) {
+		var eventHandler = "on" + event.charAt(0).toUpperCase() + event.substr(1);
+		dojo.event.topic.unsubscribe(tree.eventNames[event], _this, eventHandler);
+	});
+	if (this.listenNodeFilter) {
+		this.processDescendants(tree, this.listenNodeFilter, this.unlistenNode, true);
+	}
+	delete this.listenedTrees[tree.widgetId];
+}, checkPathCondition:function (domElement, condition) {
+	while (domElement && !domElement.widgetId) {
+		if (condition.call(null, domElement)) {
+			return true;
+		}
+		domElement = domElement.parentNode;
+	}
+	return false;
+}, domElement2TreeNode:function (domElement) {
+	while (domElement && !domElement.widgetId) {
+		domElement = domElement.parentNode;
+	}
+	if (!domElement) {
+		return null;
+	}
+	var widget = dojo.widget.byId(domElement.widgetId);
+	if (!widget.isTreeNode) {
+		return null;
+	}
+	return widget;
+}, processDescendants:function (elem, filter, func, skipFirst) {
+	var _this = this;
+	if (!skipFirst) {
+		if (!filter.call(_this, elem)) {
+			return;
+		}
+		func.call(_this, elem);
+	}
+	var stack = [elem];
+	while (elem = stack.pop()) {
+		dojo.lang.forEach(elem.children, function (elem) {
+			if (filter.call(_this, elem)) {
+				func.call(_this, elem);
+				stack.push(elem);
+			}
+		});
+	}
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeCommon.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeCommon.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeCommon.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenu.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenu.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenu.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenu.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,110 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeContextMenu");
+dojo.require("dojo.event.*");
+dojo.require("dojo.io.*");
+dojo.require("dojo.widget.Menu2");
+dojo.widget.defineWidget("dojo.widget.TreeContextMenu", dojo.widget.PopupMenu2, function () {
+	this.listenedTrees = [];
+}, {open:function (x, y, parentMenu, explodeSrc) {
+	var result = dojo.widget.PopupMenu2.prototype.open.apply(this, arguments);
+	dojo.event.topic.publish(this.eventNames.open, {menu:this});
+	return result;
+}, listenTree:function (tree) {
+	var nodes = tree.getDescendants();
+	for (var i = 0; i < nodes.length; i++) {
+		if (!nodes[i].isTreeNode) {
+			continue;
+		}
+		this.bindDomNode(nodes[i].labelNode);
+	}
+	var _this = this;
+	dojo.event.topic.subscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
+	dojo.event.topic.subscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
+	dojo.event.topic.subscribe(tree.eventNames.moveTo, this, "onMoveTo");
+	dojo.event.topic.subscribe(tree.eventNames.removeNode, this, "onRemoveNode");
+	dojo.event.topic.subscribe(tree.eventNames.addChild, this, "onAddChild");
+	dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
+	this.listenedTrees.push(tree);
+}, unlistenTree:function (tree) {
+	dojo.event.topic.unsubscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
+	dojo.event.topic.unsubscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
+	dojo.event.topic.unsubscribe(tree.eventNames.moveTo, this, "onMoveTo");
+	dojo.event.topic.unsubscribe(tree.eventNames.removeNode, this, "onRemoveNode");
+	dojo.event.topic.unsubscribe(tree.eventNames.addChild, this, "onAddChild");
+	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);
+}, bindTreeNode:function (node) {
+	var _this = this;
+	dojo.lang.forEach(node.getDescendants(), function (e) {
+		_this.bindDomNode(e.labelNode);
+	});
+}, unBindTreeNode:function (node) {
+	var _this = this;
+	dojo.lang.forEach(node.getDescendants(), function (e) {
+		_this.unBindDomNode(e.labelNode);
+	});
+}, onCreateDOMNode:function (message) {
+	this.bindTreeNode(message.source);
+}, onMoveFrom:function (message) {
+	if (!dojo.lang.inArray(this.listenedTrees, message.newTree)) {
+		this.unBindTreeNode(message.child);
+	}
+}, onMoveTo:function (message) {
+	if (dojo.lang.inArray(this.listenedTrees, message.newTree)) {
+		this.bindTreeNode(message.child);
+	}
+}, onRemoveNode:function (message) {
+	this.unBindTreeNode(message.child);
+}, onAddChild:function (message) {
+	if (message.domNodeInitialized) {
+		this.bindTreeNode(message.child);
+	}
+}});
+dojo.widget.defineWidget("dojo.widget.TreeMenuItem", dojo.widget.MenuItem2, {treeActions:"", initialize:function (args, frag) {
+	this.treeActions = this.treeActions.split(",");
+	for (var i = 0; i < this.treeActions.length; i++) {
+		this.treeActions[i] = this.treeActions[i].toUpperCase();
+	}
+}, getTreeNode:function () {
+	var menu = this;
+	while (!(menu instanceof dojo.widget.TreeContextMenu)) {
+		menu = menu.parent;
+	}
+	var source = menu.getTopOpenEvent().target;
+	while (!source.getAttribute("treeNode") && source.tagName != "body") {
+		source = source.parentNode;
+	}
+	if (source.tagName == "body") {
+		dojo.raise("treeNode not detected");
+	}
+	var treeNode = dojo.widget.manager.getWidgetById(source.getAttribute("treeNode"));
+	return treeNode;
+}, menuOpen:function (message) {
+	var treeNode = this.getTreeNode();
+	this.setDisabled(false);
+	var _this = this;
+	dojo.lang.forEach(_this.treeActions, function (action) {
+		_this.setDisabled(treeNode.actionIsDisabled(action));
+	});
+}, toString:function () {
+	return "[" + this.widgetType + " node " + this.getTreeNode() + "]";
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenu.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenu.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenu.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenuV3.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenuV3.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenuV3.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenuV3.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,74 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeContextMenuV3");
+dojo.require("dojo.event.*");
+dojo.require("dojo.io.*");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.Menu2");
+dojo.require("dojo.widget.TreeCommon");
+dojo.widget.defineWidget("dojo.widget.TreeContextMenuV3", [dojo.widget.PopupMenu2, dojo.widget.TreeCommon], function () {
+	this.listenedTrees = {};
+}, {listenTreeEvents:["afterTreeCreate", "beforeTreeDestroy"], listenNodeFilter:function (elem) {
+	return elem instanceof dojo.widget.Widget;
+}, onAfterTreeCreate:function (message) {
+	var tree = message.source;
+	this.bindDomNode(tree.domNode);
+}, onBeforeTreeDestroy:function (message) {
+	this.unBindDomNode(message.source.domNode);
+}, getTreeNode:function () {
+	var source = this.getTopOpenEvent().target;
+	var treeNode = this.domElement2TreeNode(source);
+	return treeNode;
+}, open:function () {
+	var result = dojo.widget.PopupMenu2.prototype.open.apply(this, arguments);
+	for (var i = 0; i < this.children.length; i++) {
+		if (this.children[i].menuOpen) {
+			this.children[i].menuOpen(this.getTreeNode());
+		}
+	}
+	return result;
+}, close:function () {
+	for (var i = 0; i < this.children.length; i++) {
+		if (this.children[i].menuClose) {
+			this.children[i].menuClose(this.getTreeNode());
+		}
+	}
+	var result = dojo.widget.PopupMenu2.prototype.close.apply(this, arguments);
+	return result;
+}});
+dojo.widget.defineWidget("dojo.widget.TreeMenuItemV3", [dojo.widget.MenuItem2, dojo.widget.TreeCommon], function () {
+	this.treeActions = [];
+}, {treeActions:"", initialize:function (args, frag) {
+	for (var i = 0; i < this.treeActions.length; i++) {
+		this.treeActions[i] = this.treeActions[i].toUpperCase();
+	}
+}, getTreeNode:function () {
+	var menu = this;
+	while (!(menu instanceof dojo.widget.TreeContextMenuV3)) {
+		menu = menu.parent;
+	}
+	var treeNode = menu.getTreeNode();
+	return treeNode;
+}, menuOpen:function (treeNode) {
+	treeNode.viewEmphasize();
+	this.setDisabled(false);
+	var _this = this;
+	dojo.lang.forEach(_this.treeActions, function (action) {
+		_this.setDisabled(treeNode.actionIsDisabledNow(action));
+	});
+}, menuClose:function (treeNode) {
+	treeNode.viewUnemphasize();
+}, toString:function () {
+	return "[" + this.widgetType + " node " + this.getTreeNode() + "]";
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenuV3.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenuV3.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeContextMenuV3.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeControllerExtension.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeControllerExtension.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeControllerExtension.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeControllerExtension.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,60 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeControllerExtension");
+dojo.declare("dojo.widget.TreeControllerExtension", null, {saveExpandedIndices:function (node, field) {
+	var obj = {};
+	for (var i = 0; i < node.children.length; i++) {
+		if (node.children[i].isExpanded) {
+			var key = dojo.lang.isUndefined(field) ? i : node.children[i][field];
+			obj[key] = this.saveExpandedIndices(node.children[i], field);
+		}
+	}
+	return obj;
+}, restoreExpandedIndices:function (node, savedIndices, field) {
+	var _this = this;
+	var handler = function (node, savedIndices) {
+		this.node = node;
+		this.savedIndices = savedIndices;
+		this.process = function () {
+			_this.restoreExpandedIndices(this.node, this.savedIndices, field);
+		};
+	};
+	for (var i = 0; i < node.children.length; i++) {
+		var child = node.children[i];
+		var found = false;
+		var key = -1;
+		if (dojo.lang.isUndefined(field) && savedIndices[i]) {
+			found = true;
+			key = i;
+		}
+		if (field) {
+			for (var key in savedIndices) {
+				if (key == child[field]) {
+					found = true;
+					break;
+				}
+			}
+		}
+		if (found) {
+			var h = new handler(child, savedIndices[key]);
+			_this.expand(child, false, h, h.process);
+		} else {
+			if (child.isExpanded) {
+				dojo.lang.forEach(child.getDescendants(), function (elem) {
+					_this.collapse(elem);
+				});
+			}
+		}
+	}
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeControllerExtension.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeControllerExtension.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeControllerExtension.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDemo.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDemo.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDemo.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDemo.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,85 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeDemo");
+dojo.require("dojo.Deferred");
+dojo.widget.TreeDemo = {reportIfDefered:function (res) {
+	if (res instanceof dojo.Deferred) {
+		res.addCallbacks(function (res) {
+			return res;
+		}, function (err) {
+			dojo.debug("Error");
+			dojo.debugShallow(err);
+		});
+	}
+}, resetRandomChildren:function (maxCount) {
+	this.randomChildrenMaxCount = maxCount;
+	this.randomChildrenCount = 0;
+	this.randomChildrenDepth = 0;
+}, makeRandomChildren:function (title) {
+	this.randomChildrenDepth++;
+	var children = [];
+	for (var i = 1; i <= 5; i++) {
+		var t = title + (this.randomChildrenDepth == 1 ? "" : ".") + i;
+		var node = {title:t};
+		children.push(node);
+		this.randomChildrenCount++;
+		if (this.randomChildrenCount >= this.randomChildrenMaxCount) {
+			break;
+		}
+	}
+	var i = 1;
+	var _this = this;
+	dojo.lang.forEach(children, function (child) {
+		var t = title + (_this.randomChildrenDepth == 1 ? "" : ".") + i;
+		i++;
+		if (_this.randomChildrenCount < _this.randomChildrenMaxCount && (_this.randomChildrenDepth == 1 && child === children[0] || _this.randomChildrenDepth < 5 && Math.random() > 0.3)) {
+			child.children = _this.makeRandomChildren(t);
+		}
+	});
+	this.randomChildrenDepth--;
+	return children;
+}, bindDemoMenu:function (controller) {
+	var _t = this;
+	dojo.event.topic.subscribe("treeContextMenuDestroy/engage", function (menuItem) {
+		var node = menuItem.getTreeNode();
+		_t.reportIfDefered(controller.destroyChild(node));
+	});
+	dojo.event.topic.subscribe("treeContextMenuRefresh/engage", function (menuItem) {
+		var node = menuItem.getTreeNode();
+		_t.reportIfDefered(controller.refreshChildren(node));
+	});
+	dojo.event.topic.subscribe("treeContextMenuCreate/engage", function (menuItem) {
+		var node = menuItem.getTreeNode();
+		var d = controller.createAndEdit(node, 0);
+		_t.reportIfDefered(d);
+	});
+	dojo.event.topic.subscribe("treeContextMenuUp/engage", function (menuItem) {
+		var node = menuItem.getTreeNode();
+		if (node.isFirstChild()) {
+			return;
+		}
+		_t.reportIfDefered(controller.move(node, node.parent, node.getParentIndex() - 1));
+	});
+	dojo.event.topic.subscribe("treeContextMenuDown/engage", function (menuItem) {
+		var node = menuItem.getTreeNode();
+		if (node.isLastChild()) {
+			return;
+		}
+		_t.reportIfDefered(controller.move(node, node.parent, node.getParentIndex() + 1));
+	});
+	dojo.event.topic.subscribe("treeContextMenuEdit/engage", function (menuItem) {
+		var node = menuItem.getTreeNode();
+		_t.reportIfDefered(controller.editLabelStart(node));
+	});
+}};
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDemo.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDemo.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDemo.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDeselectOnDblselect.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDeselectOnDblselect.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDeselectOnDblselect.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDeselectOnDblselect.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,23 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeDeselectOnDblselect");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.TreeSelectorV3");
+dojo.deprecated("Does anyone still need this extension? (TreeDeselectOnDblselect)");
+dojo.widget.defineWidget("dojo.widget.TreeDeselectOnDblselect", [dojo.widget.HtmlWidget], {selector:"", initialize:function () {
+	this.selector = dojo.widget.byId(this.selector);
+	dojo.event.topic.subscribe(this.selector.eventNames.dblselect, this, "onDblselect");
+}, onDblselect:function (message) {
+	this.selector.deselect(message.node);
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDeselectOnDblselect.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDeselectOnDblselect.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDeselectOnDblselect.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDisableWrapExtension.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDisableWrapExtension.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDisableWrapExtension.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDisableWrapExtension.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,37 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeDisableWrapExtension");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.TreeExtension");
+dojo.widget.defineWidget("dojo.widget.TreeDisableWrapExtension", dojo.widget.TreeExtension, {templateCssString:"\n/* CSS for TreeDisableWrapExtension */\n\n.TreeDisableWrap {\n\twhite-space: nowrap;\n}\n.TreeIEDisableWrap {\n\twidth: expression( 5 + firstChild.offsetWidth );\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TreeDisableWrap.css"), listenTree:function (tree) {
+	var wrappingDiv = document.createElement("div");
+	var clazz = tree.classPrefix + "DisableWrap";
+	if (dojo.render.html.ie) {
+		clazz = clazz + " " + tree.classPrefix + "IEDisableWrap";
+	}
+	dojo.html.setClass(wrappingDiv, clazz);
+	var table = document.createElement("table");
+	wrappingDiv.appendChild(table);
+	var tbody = document.createElement("tbody");
+	table.appendChild(tbody);
+	var tr = document.createElement("tr");
+	tbody.appendChild(tr);
+	var td = document.createElement("td");
+	tr.appendChild(td);
+	if (tree.domNode.parentNode) {
+		tree.domNode.parentNode.replaceChild(wrappingDiv, tree.domNode);
+	}
+	td.appendChild(tree.domNode);
+	tree.domNode = wrappingDiv;
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDisableWrapExtension.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDisableWrapExtension.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDisableWrapExtension.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDndControllerV3.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDndControllerV3.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDndControllerV3.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDndControllerV3.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,71 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeDndControllerV3");
+dojo.require("dojo.dnd.TreeDragAndDropV3");
+dojo.require("dojo.experimental");
+dojo.experimental("Tree drag'n'drop' has lots of problems/bugs, it requires dojo drag'n'drop overhaul to work, probably in 0.5");
+dojo.widget.defineWidget("dojo.widget.TreeDndControllerV3", [dojo.widget.HtmlWidget, dojo.widget.TreeCommon], function () {
+	this.dragSources = {};
+	this.dropTargets = {};
+	this.listenedTrees = {};
+}, {listenTreeEvents:["afterChangeTree", "beforeTreeDestroy", "afterAddChild"], listenNodeFilter:function (elem) {
+	return elem instanceof dojo.widget.Widget;
+}, initialize:function (args) {
+	this.treeController = dojo.lang.isString(args.controller) ? dojo.widget.byId(args.controller) : args.controller;
+	if (!this.treeController) {
+		dojo.raise("treeController must be declared");
+	}
+}, onBeforeTreeDestroy:function (message) {
+	this.unlistenTree(message.source);
+}, onAfterAddChild:function (message) {
+	this.listenNode(message.child);
+}, onAfterChangeTree:function (message) {
+	if (!message.oldTree) {
+		return;
+	}
+	if (!message.newTree || !this.listenedTrees[message.newTree.widgetId]) {
+		this.processDescendants(message.node, this.listenNodeFilter, this.unlistenNode);
+	}
+	if (!this.listenedTrees[message.oldTree.widgetId]) {
+		this.processDescendants(message.node, this.listenNodeFilter, this.listenNode);
+	}
+}, listenNode:function (node) {
+	if (!node.tree.DndMode) {
+		return;
+	}
+	if (this.dragSources[node.widgetId] || this.dropTargets[node.widgetId]) {
+		return;
+	}
+	var source = null;
+	var target = null;
+	if (!node.actionIsDisabled(node.actions.MOVE)) {
+		var source = this.makeDragSource(node);
+		this.dragSources[node.widgetId] = source;
+	}
+	var target = this.makeDropTarget(node);
+	this.dropTargets[node.widgetId] = target;
+}, makeDragSource:function (node) {
+	return new dojo.dnd.TreeDragSourceV3(node.contentNode, this, node.tree.widgetId, node);
+}, makeDropTarget:function (node) {
+	return new dojo.dnd.TreeDropTargetV3(node.contentNode, this.treeController, node.tree.DndAcceptTypes, node);
+}, unlistenNode:function (node) {
+	if (this.dragSources[node.widgetId]) {
+		dojo.dnd.dragManager.unregisterDragSource(this.dragSources[node.widgetId]);
+		delete this.dragSources[node.widgetId];
+	}
+	if (this.dropTargets[node.widgetId]) {
+		dojo.dnd.dragManager.unregisterDropTarget(this.dropTargets[node.widgetId]);
+		delete this.dropTargets[node.widgetId];
+	}
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDndControllerV3.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDndControllerV3.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDndControllerV3.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDocIconExtension.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDocIconExtension.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDocIconExtension.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDocIconExtension.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,54 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeDocIconExtension");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.TreeExtension");
+dojo.widget.defineWidget("dojo.widget.TreeDocIconExtension", [dojo.widget.TreeExtension], {templateCssString:"\n/* CSS for TreeDocIconExtension */\n\n\n/* long vertical line under docIcon, connecting w/ children */\n.TreeStateChildrenYes-ExpandOpen .TreeIconContent {\n	background-image : url('../templates/images/TreeV3/i_long.gif');\n	background-repeat : no-repeat;\n	background-position: 18px 9px;\n}\n\n/* close has higher priority */\n.TreeStateChildrenYes-ExpandClosed .TreeIconContent {\n	background-image : url();\n}\n\n/* higher priotity: same length and appear after background-definition */\n.TreeStateChildrenNo-ExpandLeaf .TreeIconContent {\n	background-image : url();\n}\n\n.TreeStateChildrenNo-ExpandClosed .TreeIconContent {\n	background-image : url();\n}\n\n.TreeStateChildrenNo-ExpandOpen .TreeIconContent {\n	background-image : url();\n}\n\n\n/* highest priority */\n.TreeIconDocument {\n	background-image: url('../templates/images/TreeV3/document.gif');\n}\n\n.TreeExpa
 ndOpen .TreeIconFolder {\n	background-image: url('../templates/images/TreeV3/open.gif');\n}\n\n.TreeExpandClosed .TreeIconFolder {\n	background-image: url('../templates/images/TreeV3/closed.gif');\n}\n\n/* generic class for docIcon */\n.TreeIcon {\n	width: 18px;\n	height: 18px;\n	float: left;\n	display: inline;\n	background-repeat : no-repeat;\n}\n\ndiv.TreeContent {\n	margin-left: 36px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TreeDocIcon.css"), listenTreeEvents:["afterChangeTree", "afterSetFolder", "afterUnsetFolder"], listenNodeFilter:function (elem) {
+	return elem instanceof dojo.widget.Widget;
+}, getnodeDocType:function (node) {
+	var nodeDocType = node.getnodeDocType();
+	if (!nodeDocType) {
+		nodeDocType = node.isFolder ? "Folder" : "Document";
+	}
+	return nodeDocType;
+}, setnodeDocTypeClass:function (node) {
+	var reg = new RegExp("(^|\\s)" + node.tree.classPrefix + "Icon\\w+", "g");
+	var clazz = dojo.html.getClass(node.iconNode).replace(reg, "") + " " + node.tree.classPrefix + "Icon" + this.getnodeDocType(node);
+	dojo.html.setClass(node.iconNode, clazz);
+}, onAfterSetFolder:function (message) {
+	if (message.source.iconNode) {
+		this.setnodeDocTypeClass(message.source);
+	}
+}, onAfterUnsetFolder:function (message) {
+	this.setnodeDocTypeClass(message.source);
+}, listenNode:function (node) {
+	node.contentIconNode = document.createElement("div");
+	var clazz = node.tree.classPrefix + "IconContent";
+	if (dojo.render.html.ie) {
+		clazz = clazz + " " + node.tree.classPrefix + "IEIconContent";
+	}
+	dojo.html.setClass(node.contentIconNode, clazz);
+	node.contentNode.parentNode.replaceChild(node.contentIconNode, node.expandNode);
+	node.iconNode = document.createElement("div");
+	dojo.html.setClass(node.iconNode, node.tree.classPrefix + "Icon" + " " + node.tree.classPrefix + "Icon" + this.getnodeDocType(node));
+	node.contentIconNode.appendChild(node.expandNode);
+	node.contentIconNode.appendChild(node.iconNode);
+	dojo.dom.removeNode(node.contentNode);
+	node.contentIconNode.appendChild(node.contentNode);
+}, onAfterChangeTree:function (message) {
+	var _this = this;
+	if (!message.oldTree || !this.listenedTrees[message.oldTree.widgetId]) {
+		this.processDescendants(message.node, this.listenNodeFilter, this.listenNode);
+	}
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDocIconExtension.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDocIconExtension.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeDocIconExtension.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEditor.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEditor.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEditor.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEditor.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,67 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.RichText");
+dojo.provide("dojo.widget.TreeEditor");
+dojo.widget.defineWidget("dojo.widget.TreeEditor", dojo.widget.HtmlWidget, {singleLineMode:false, saveOnBlur:true, sync:false, selectOnOpen:true, controller:null, node:null, richTextParams:{styleSheets:"src/widget/templates/TreeEditor.css"}, getContents:function () {
+	return this.richText.getEditorContent();
+}, open:function (node) {
+	if (!this.richText) {
+		this.richText = dojo.widget.createWidget("RichText", this.richTextParams, node.labelNode);
+		dojo.event.connect("around", this.richText, "onKeyDown", this, "richText_onKeyDown");
+		dojo.event.connect(this.richText, "onBlur", this, "richText_onBlur");
+		var self = this;
+		dojo.event.connect(this.richText, "onLoad", function () {
+			if (self.selectOnOpen) {
+				self.richText.execCommand("selectall");
+			}
+		});
+	} else {
+		this.richText.open(node.labelNode);
+	}
+	this.node = node;
+}, close:function (save) {
+	this.richText.close(save);
+	this.node = null;
+}, isClosed:function () {
+	return !this.richText || this.richText.isClosed;
+}, execCommand:function () {
+	this.richText.execCommand.apply(this.richText, arguments);
+}, richText_onKeyDown:function (invocation) {
+	var e = invocation.args[0];
+	if ((!e) && (this.object)) {
+		e = dojo.event.browser.fixEvent(this.editor.window.event);
+	}
+	switch (e.keyCode) {
+	  case e.KEY_ESCAPE:
+		this.finish(false);
+		dojo.event.browser.stopEvent(e);
+		break;
+	  case e.KEY_ENTER:
+		if (e.ctrlKey && !this.singleLineMode) {
+			this.execCommand("inserthtml", "<br/>");
+		} else {
+			this.finish(true);
+		}
+		dojo.event.browser.stopEvent(e);
+		break;
+	  default:
+		return invocation.proceed();
+	}
+}, richText_onBlur:function () {
+	this.finish(this.saveOnBlur);
+}, finish:function (save) {
+	return this.controller.editLabelFinish(save, this.sync);
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEditor.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEditor.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEditor.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEmphasizeOnSelect.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEmphasizeOnSelect.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEmphasizeOnSelect.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEmphasizeOnSelect.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,26 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeEmphasizeOnSelect");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.TreeSelectorV3");
+dojo.require("dojo.html.selection");
+dojo.widget.defineWidget("dojo.widget.TreeEmphasizeOnSelect", dojo.widget.HtmlWidget, {selector:"", initialize:function () {
+	this.selector = dojo.widget.byId(this.selector);
+	dojo.event.topic.subscribe(this.selector.eventNames.select, this, "onSelect");
+	dojo.event.topic.subscribe(this.selector.eventNames.deselect, this, "onDeselect");
+}, onSelect:function (message) {
+	message.node.viewEmphasize();
+}, onDeselect:function (message) {
+	message.node.viewUnemphasize();
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEmphasizeOnSelect.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEmphasizeOnSelect.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeEmphasizeOnSelect.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExpandToNodeOnSelect.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExpandToNodeOnSelect.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExpandToNodeOnSelect.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExpandToNodeOnSelect.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,22 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeExpandToNodeOnSelect");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.widget.defineWidget("dojo.widget.TreeExpandToNodeOnSelect", dojo.widget.HtmlWidget, {selector:"", controller:"", withSelected:false, initialize:function () {
+	this.selector = dojo.widget.byId(this.selector);
+	this.controller = dojo.widget.byId(this.controller);
+	dojo.event.topic.subscribe(this.selector.eventNames.select, this, "onSelect");
+}, onSelectEvent:function (message) {
+	this.controller.expandToNode(message.node, this.withSelected);
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExpandToNodeOnSelect.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExpandToNodeOnSelect.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExpandToNodeOnSelect.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExtension.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExtension.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExtension.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExtension.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,19 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeExtension");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.TreeCommon");
+dojo.widget.defineWidget("dojo.widget.TreeExtension", [dojo.widget.HtmlWidget, dojo.widget.TreeCommon], function () {
+	this.listenedTrees = {};
+}, {});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExtension.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExtension.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeExtension.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLinkExtension.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLinkExtension.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLinkExtension.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLinkExtension.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,46 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeLinkExtension");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.TreeExtension");
+dojo.widget.defineWidget("dojo.widget.TreeLinkExtension", dojo.widget.TreeExtension, function () {
+	this.params = {};
+}, {listenTreeEvents:["afterChangeTree"], listenTree:function (tree) {
+	dojo.widget.TreeCommon.prototype.listenTree.call(this, tree);
+	var labelNode = tree.labelNodeTemplate;
+	var newLabel = this.makeALabel();
+	dojo.html.setClass(newLabel, dojo.html.getClass(labelNode));
+	labelNode.parentNode.replaceChild(newLabel, labelNode);
+}, makeALabel:function () {
+	var newLabel = document.createElement("a");
+	for (var key in this.params) {
+		if (key in {}) {
+			continue;
+		}
+		newLabel.setAttribute(key, this.params[key]);
+	}
+	return newLabel;
+}, onAfterChangeTree:function (message) {
+	var _this = this;
+	if (!message.oldTree) {
+		this.listenNode(message.node);
+	}
+}, listenNode:function (node) {
+	for (var key in node.object) {
+		if (key in {}) {
+			continue;
+		}
+		node.labelNode.setAttribute(key, node.object[key]);
+	}
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLinkExtension.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLinkExtension.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLinkExtension.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingController.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingController.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingController.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingController.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,94 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.provide("dojo.widget.TreeLoadingController");
+dojo.require("dojo.widget.TreeBasicController");
+dojo.require("dojo.event.*");
+dojo.require("dojo.json");
+dojo.require("dojo.io.*");
+dojo.widget.defineWidget("dojo.widget.TreeLoadingController", dojo.widget.TreeBasicController, {RPCUrl:"", RPCActionParam:"action", RPCErrorHandler:function (type, obj, evt) {
+	alert("RPC Error: " + (obj.message || "no message"));
+}, preventCache:true, getRPCUrl:function (action) {
+	if (this.RPCUrl == "local") {
+		var dir = document.location.href.substr(0, document.location.href.lastIndexOf("/"));
+		var localUrl = dir + "/" + action;
+		return localUrl;
+	}
+	if (!this.RPCUrl) {
+		dojo.raise("Empty RPCUrl: can't load");
+	}
+	return this.RPCUrl + (this.RPCUrl.indexOf("?") > -1 ? "&" : "?") + this.RPCActionParam + "=" + action;
+}, loadProcessResponse:function (node, result, callObj, callFunc) {
+	if (!dojo.lang.isUndefined(result.error)) {
+		this.RPCErrorHandler("server", result.error);
+		return false;
+	}
+	var newChildren = result;
+	if (!dojo.lang.isArray(newChildren)) {
+		dojo.raise("loadProcessResponse: Not array loaded: " + newChildren);
+	}
+	for (var i = 0; i < newChildren.length; i++) {
+		newChildren[i] = dojo.widget.createWidget(node.widgetType, newChildren[i]);
+		node.addChild(newChildren[i]);
+	}
+	node.state = node.loadStates.LOADED;
+	if (dojo.lang.isFunction(callFunc)) {
+		callFunc.apply(dojo.lang.isUndefined(callObj) ? this : callObj, [node, newChildren]);
+	}
+}, getInfo:function (obj) {
+	return obj.getInfo();
+}, runRPC:function (kw) {
+	var _this = this;
+	var handle = function (type, data, evt) {
+		if (kw.lock) {
+			dojo.lang.forEach(kw.lock, function (t) {
+				t.unlock();
+			});
+		}
+		if (type == "load") {
+			kw.load.call(this, data);
+		} else {
+			this.RPCErrorHandler(type, data, evt);
+		}
+	};
+	if (kw.lock) {
+		dojo.lang.forEach(kw.lock, function (t) {
+			t.lock();
+		});
+	}
+	dojo.io.bind({url:kw.url, handle:dojo.lang.hitch(this, handle), mimetype:"text/json", preventCache:_this.preventCache, sync:kw.sync, content:{data:dojo.json.serialize(kw.params)}});
+}, loadRemote:function (node, sync, callObj, callFunc) {
+	var _this = this;
+	var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
+	this.runRPC({url:this.getRPCUrl("getChildren"), load:function (result) {
+		_this.loadProcessResponse(node, result, callObj, callFunc);
+	}, sync:sync, lock:[node], params:params});
+}, expand:function (node, sync, callObj, callFunc) {
+	if (node.state == node.loadStates.UNCHECKED && node.isFolder) {
+		this.loadRemote(node, sync, this, function (node, newChildren) {
+			this.expand(node, sync, callObj, callFunc);
+		});
+		return;
+	}
+	dojo.widget.TreeBasicController.prototype.expand.apply(this, arguments);
+}, doMove:function (child, newParent, index) {
+	if (newParent.isTreeNode && newParent.state == newParent.loadStates.UNCHECKED) {
+		this.loadRemote(newParent, true);
+	}
+	return dojo.widget.TreeBasicController.prototype.doMove.apply(this, arguments);
+}, doCreateChild:function (parent, index, data, callObj, callFunc) {
+	if (parent.state == parent.loadStates.UNCHECKED) {
+		this.loadRemote(parent, true);
+	}
+	return dojo.widget.TreeBasicController.prototype.doCreateChild.apply(this, arguments);
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingController.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingController.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingController.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingControllerV3.js
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingControllerV3.js?rev=794787&view=auto
==============================================================================
--- geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingControllerV3.js (added)
+++ geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingControllerV3.js Thu Jul 16 19:14:41 2009
@@ -0,0 +1,250 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+
+
+dojo.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);
+}});
+

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingControllerV3.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingControllerV3.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/geronimo-dojo-0.4.3/src/main/webapp/src/widget/TreeLoadingControllerV3.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message