myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r432754 [4/28] - in /myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource: ./ src/ src/animation/ src/collections/ src/compat/ src/crypto/ src/data/ src/data/format/ src/data/provider/ src/debug/ sr...
Date Fri, 18 Aug 2006 22:33:00 GMT
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/AdapterRegistry.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/AdapterRegistry.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/AdapterRegistry.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/AdapterRegistry.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,72 @@
+/*
+	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.AdapterRegistry");
+dojo.require("dojo.lang.func");
+
+dojo.AdapterRegistry = function(){
+    /***
+        A registry to facilitate adaptation.
+
+        Pairs is an array of [name, check, wrap] triples
+        
+        All check/wrap functions in this registry should be of the same arity.
+    ***/
+    this.pairs = [];
+}
+
+dojo.lang.extend(dojo.AdapterRegistry, {
+    register: function (name, check, wrap, /* optional */ override){
+        /***
+			The check function should return true if the given arguments are
+			appropriate for the wrap function.
+
+			If override is given and true, the check function will be given
+			highest priority.  Otherwise, it will be the lowest priority
+			adapter.
+        ***/
+
+        if (override) {
+            this.pairs.unshift([name, check, wrap]);
+        } else {
+            this.pairs.push([name, check, wrap]);
+        }
+    },
+
+    match: function (/* ... */) {
+        /***
+			Find an adapter for the given arguments.
+
+			If no suitable adapter is found, throws NotFound.
+        ***/
+        for(var i = 0; i < this.pairs.length; i++){
+            var pair = this.pairs[i];
+            if(pair[1].apply(this, arguments)){
+                return pair[2].apply(this, arguments);
+            }
+        }
+		throw new Error("No match found");
+        // dojo.raise("No match found");
+    },
+
+    unregister: function (name) {
+        /***
+			Remove a named adapter from the registry
+        ***/
+        for(var i = 0; i < this.pairs.length; i++){
+            var pair = this.pairs[i];
+            if(pair[0] == name){
+                this.pairs.splice(i, 1);
+                return true;
+            }
+        }
+        return false;
+    }
+});

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/Deferred.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/Deferred.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/Deferred.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/Deferred.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,309 @@
+/*
+	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.Deferred");
+dojo.require("dojo.lang.func");
+
+dojo.Deferred = function(/* optional */ canceller){
+	/*
+	NOTE: this namespace and documentation are imported wholesale 
+		from MochiKit
+
+	Encapsulates a sequence of callbacks in response to a value that
+	may not yet be available.  This is modeled after the Deferred class
+	from Twisted <http://twistedmatrix.com>.
+
+	Why do we want this?  JavaScript has no threads, and even if it did,
+	threads are hard.  Deferreds are a way of abstracting non-blocking
+	events, such as the final response to an XMLHttpRequest.
+
+	The sequence of callbacks is internally represented as a list
+	of 2-tuples containing the callback/errback pair.  For example,
+	the following call sequence::
+
+		var d = new Deferred();
+		d.addCallback(myCallback);
+		d.addErrback(myErrback);
+		d.addBoth(myBoth);
+		d.addCallbacks(myCallback, myErrback);
+
+	is translated into a Deferred with the following internal
+	representation::
+
+		[
+			[myCallback, null],
+			[null, myErrback],
+			[myBoth, myBoth],
+			[myCallback, myErrback]
+		]
+
+	The Deferred also keeps track of its current status (fired).
+	Its status may be one of three things:
+
+		-1: no value yet (initial condition)
+		0: success
+		1: error
+
+	A Deferred will be in the error state if one of the following
+	three conditions are met:
+
+		1. The result given to callback or errback is "instanceof" Error
+		2. The previous callback or errback raised an exception while
+		   executing
+		3. The previous callback or errback returned a value "instanceof"
+			Error
+
+	Otherwise, the Deferred will be in the success state.  The state of
+	the Deferred determines the next element in the callback sequence to
+	run.
+
+	When a callback or errback occurs with the example deferred chain,
+	something equivalent to the following will happen (imagine that
+	exceptions are caught and returned)::
+
+		// d.callback(result) or d.errback(result)
+		if(!(result instanceof Error)){
+			result = myCallback(result);
+		}
+		if(result instanceof Error){
+			result = myErrback(result);
+		}
+		result = myBoth(result);
+		if(result instanceof Error){
+			result = myErrback(result);
+		}else{
+			result = myCallback(result);
+		}
+
+	The result is then stored away in case another step is added to the
+	callback sequence.	Since the Deferred already has a value available,
+	any new callbacks added will be called immediately.
+
+	There are two other "advanced" details about this implementation that
+	are useful:
+
+	Callbacks are allowed to return Deferred instances themselves, so you
+	can build complicated sequences of events with ease.
+
+	The creator of the Deferred may specify a canceller.  The canceller
+	is a function that will be called if Deferred.cancel is called before
+	the Deferred fires.	 You can use this to implement clean aborting of
+	an XMLHttpRequest, etc.	 Note that cancel will fire the deferred with
+	a CancelledError (unless your canceller returns another kind of
+	error), so the errbacks should be prepared to handle that error for
+	cancellable Deferreds.
+
+	*/
+	
+	this.chain = [];
+	this.id = this._nextId();
+	this.fired = -1;
+	this.paused = 0;
+	this.results = [null, null];
+	this.canceller = canceller;
+	this.silentlyCancelled = false;
+};
+
+dojo.lang.extend(dojo.Deferred, {
+	getFunctionFromArgs: function(){
+		var a = arguments;
+		if((a[0])&&(!a[1])){
+			if(dojo.lang.isFunction(a[0])){
+				return a[0];
+			}else if(dojo.lang.isString(a[0])){
+				return dj_global[a[0]];
+			}
+		}else if((a[0])&&(a[1])){
+			return dojo.lang.hitch(a[0], a[1]);
+		}
+		return null;
+	},
+
+	repr: function(){
+		var state;
+		if(this.fired == -1){
+			state = 'unfired';
+		}else if(this.fired == 0){
+			state = 'success';
+		} else {
+			state = 'error';
+		}
+		return 'Deferred(' + this.id + ', ' + state + ')';
+	},
+
+	toString: dojo.lang.forward("repr"),
+
+	_nextId: (function(){
+		var n = 1;
+		return function(){ return n++; };
+	})(),
+
+	cancel: function(){
+		/***
+		Cancels a Deferred that has not yet received a value, or is
+		waiting on another Deferred as its value.
+
+		If a canceller is defined, the canceller is called. If the
+		canceller did not return an error, or there was no canceller,
+		then the errback chain is started with CancelledError.
+		***/
+		if(this.fired == -1){
+			if (this.canceller){
+				this.canceller(this);
+			}else{
+				this.silentlyCancelled = true;
+			}
+			if(this.fired == -1){
+				this.errback(new Error(this.repr()));
+			}
+		}else if(	(this.fired == 0)&&
+					(this.results[0] instanceof dojo.Deferred)){
+			this.results[0].cancel();
+		}
+	},
+			
+
+	_pause: function(){
+		// Used internally to signal that it's waiting on another Deferred
+		this.paused++;
+	},
+
+	_unpause: function(){
+		// Used internally to signal that it's no longer waiting on
+		// another Deferred.
+		this.paused--;
+		if ((this.paused == 0) && (this.fired >= 0)) {
+			this._fire();
+		}
+	},
+
+	_continue: function(res){
+		// Used internally when a dependent deferred fires.
+		this._resback(res);
+		this._unpause();
+	},
+
+	_resback: function(res){
+		// The primitive that means either callback or errback
+		this.fired = ((res instanceof Error) ? 1 : 0);
+		this.results[this.fired] = res;
+		this._fire();
+	},
+
+	_check: function(){
+		if(this.fired != -1){
+			if(!this.silentlyCancelled){
+				dojo.raise("already called!");
+			}
+			this.silentlyCancelled = false;
+			return;
+		}
+	},
+
+	callback: function(res){
+		/*
+		Begin the callback sequence with a non-error value.
+		
+		callback or errback should only be called once on a given
+		Deferred.
+		*/
+		this._check();
+		this._resback(res);
+	},
+
+	errback: function(res){
+		// Begin the callback sequence with an error result.
+		this._check();
+		if(!(res instanceof Error)){
+			res = new Error(res);
+		}
+		this._resback(res);
+	},
+
+	addBoth: function(cb, cbfn){
+		/*
+		Add the same function as both a callback and an errback as the
+		next element on the callback sequence.	This is useful for code
+		that you want to guarantee to run, e.g. a finalizer.
+		*/
+		var enclosed = this.getFunctionFromArgs(cb, cbfn);
+		if(arguments.length > 2){
+			enclosed = dojo.lang.curryArguments(null, enclosed, arguments, 2);
+		}
+		return this.addCallbacks(enclosed, enclosed);
+	},
+
+	addCallback: function(cb, cbfn){
+		// Add a single callback to the end of the callback sequence.
+		var enclosed = this.getFunctionFromArgs(cb, cbfn);
+		if(arguments.length > 2){
+			enclosed = dojo.lang.curryArguments(null, enclosed, arguments, 2);
+		}
+		return this.addCallbacks(enclosed, null);
+	},
+
+	addErrback: function(cb, cbfn){
+		// Add a single callback to the end of the callback sequence.
+		var enclosed = this.getFunctionFromArgs(cb, cbfn);
+		if(arguments.length > 2){
+			enclosed = dojo.lang.curryArguments(null, enclosed, arguments, 2);
+		}
+		return this.addCallbacks(null, enclosed);
+		return this.addCallbacks(null, cbfn);
+	},
+
+	addCallbacks: function (cb, eb) {
+		// Add separate callback and errback to the end of the callback
+		// sequence.
+		this.chain.push([cb, eb])
+		if (this.fired >= 0) {
+			this._fire();
+		}
+		return this;
+	},
+
+	_fire: function(){
+		// Used internally to exhaust the callback sequence when a result
+		// is available.
+		var chain = this.chain;
+		var fired = this.fired;
+		var res = this.results[fired];
+		var self = this;
+		var cb = null;
+		while (chain.length > 0 && this.paused == 0) {
+			// Array
+			var pair = chain.shift();
+			var f = pair[fired];
+			if (f == null) {
+				continue;
+			}
+			try {
+				res = f(res);
+				fired = ((res instanceof Error) ? 1 : 0);
+				if(res instanceof dojo.Deferred) {
+					cb = function(res){
+						self._continue(res);
+					}
+					this._pause();
+				}
+			}catch(err){
+				fired = 1;
+				res = err;
+			}
+		}
+		this.fired = fired;
+		this.results[fired] = res;
+		if((cb)&&(this.paused)){
+			// this is for "tail recursion" in case the dependent
+			// deferred is already fired
+			res.addBoth(cb);
+		}
+	}
+});

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,12 @@
+/*
+	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.animation");
+dojo.require("dojo.animation.Animation");

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/Animation.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/Animation.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/Animation.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/Animation.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,217 @@
+/*
+	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.animation.Animation");
+dojo.require("dojo.animation.AnimationEvent");
+
+dojo.require("dojo.lang.func");
+dojo.require("dojo.math");
+dojo.require("dojo.math.curves");
+
+/*
+Animation package based off of Dan Pupius' work on Animations:
+http://pupius.co.uk/js/Toolkit.Drawing.js
+*/
+
+dojo.animation.Animation = function(/*dojo.math.curves.Line*/ curve, /*int*/ duration, /*Decimal?*/ accel, /*int?*/ repeatCount, /*int?*/ rate) {
+	// public properties
+	if(dojo.lang.isArray(curve)) {
+		// curve: Array
+		// id: i
+		curve = new dojo.math.curves.Line(curve[0], curve[1]);
+	}
+	this.curve = curve;
+	this.duration = duration;
+	this.repeatCount = repeatCount || 0;
+	this.rate = rate || 25;
+	if(accel) {
+		// accel: Decimal
+		// id: j
+		if(dojo.lang.isFunction(accel.getValue)) {
+			// accel: dojo.math.curves.CatmullRom
+			// id: k
+			this.accel = accel;
+		} else {
+			var i = 0.35*accel+0.5;	// 0.15 <= i <= 0.85
+			this.accel = new dojo.math.curves.CatmullRom([[0], [i], [1]], 0.45);
+		}
+	}
+}
+
+dojo.lang.extend(dojo.animation.Animation, {
+	// public properties
+	curve: null,
+	duration: 0,
+	repeatCount: 0,
+	accel: null,
+
+	// events
+	onBegin: null,
+	onAnimate: null,
+	onEnd: null,
+	onPlay: null,
+	onPause: null,
+	onStop: null,
+	handler: null,
+
+	// "private" properties
+	_animSequence: null,
+	_startTime: null,
+	_endTime: null,
+	_lastFrame: null,
+	_timer: null,
+	_percent: 0,
+	_active: false,
+	_paused: false,
+	_startRepeatCount: 0,
+
+	// public methods
+	play: function(gotoStart) {
+		if( gotoStart ) {
+			clearTimeout(this._timer);
+			this._active = false;
+			this._paused = false;
+			this._percent = 0;
+		} else if( this._active && !this._paused ) {
+			return;
+		}
+
+		this._startTime = new Date().valueOf();
+		if( this._paused ) {
+			this._startTime -= (this.duration * this._percent / 100);
+		}
+		this._endTime = this._startTime + this.duration;
+		this._lastFrame = this._startTime;
+
+		var e = new dojo.animation.AnimationEvent(this, null, this.curve.getValue(this._percent),
+			this._startTime, this._startTime, this._endTime, this.duration, this._percent, 0);
+
+		this._active = true;
+		this._paused = false;
+
+		if( this._percent == 0 ) {
+			if(!this._startRepeatCount) {
+				this._startRepeatCount = this.repeatCount;
+			}
+			e.type = "begin";
+			if(typeof this.handler == "function") { this.handler(e); }
+			if(typeof this.onBegin == "function") { this.onBegin(e); }
+		}
+
+		e.type = "play";
+		if(typeof this.handler == "function") { this.handler(e); }
+		if(typeof this.onPlay == "function") { this.onPlay(e); }
+
+		if(this._animSequence) { this._animSequence._setCurrent(this); }
+
+		this._cycle();
+	},
+
+	pause: function() {
+		clearTimeout(this._timer);
+		if( !this._active ) { return; }
+		this._paused = true;
+		var e = new dojo.animation.AnimationEvent(this, "pause", this.curve.getValue(this._percent),
+			this._startTime, new Date().valueOf(), this._endTime, this.duration, this._percent, 0);
+		if(typeof this.handler == "function") { this.handler(e); }
+		if(typeof this.onPause == "function") { this.onPause(e); }
+	},
+
+	playPause: function() {
+		if( !this._active || this._paused ) {
+			this.play();
+		} else {
+			this.pause();
+		}
+	},
+
+	gotoPercent: function(pct, andPlay) {
+		clearTimeout(this._timer);
+		this._active = true;
+		this._paused = true;
+		this._percent = pct;
+		if( andPlay ) { this.play(); }
+	},
+
+	stop: function(gotoEnd) {
+		clearTimeout(this._timer);
+		var step = this._percent / 100;
+		if( gotoEnd ) {
+			step = 1;
+		}
+		var e = new dojo.animation.AnimationEvent(this, "stop", this.curve.getValue(step),
+			this._startTime, new Date().valueOf(), this._endTime, this.duration, this._percent);
+		if(typeof this.handler == "function") { this.handler(e); }
+		if(typeof this.onStop == "function") { this.onStop(e); }
+		this._active = false;
+		this._paused = false;
+	},
+
+	status: function() {
+		if( this._active ) {
+			return this._paused ? "paused" : "playing";
+		} else {
+			return "stopped";
+		}
+	},
+
+	// "private" methods
+	_cycle: function() {
+		clearTimeout(this._timer);
+		if( this._active ) {
+			var curr = new Date().valueOf();
+			var step = (curr - this._startTime) / (this._endTime - this._startTime);
+			var fps = 1000 / (curr - this._lastFrame);
+			this._lastFrame = curr;
+
+			if( step >= 1 ) {
+				step = 1;
+				this._percent = 100;
+			} else {
+				this._percent = step * 100;
+			}
+			
+			// Perform accelleration
+			if(this.accel && this.accel.getValue) {
+				step = this.accel.getValue(step);
+			}
+
+			var e = new dojo.animation.AnimationEvent(this, "animate", this.curve.getValue(step),
+				this._startTime, curr, this._endTime, this.duration, this._percent, Math.round(fps));
+
+			if(typeof this.handler == "function") { this.handler(e); }
+			if(typeof this.onAnimate == "function") { this.onAnimate(e); }
+
+			if( step < 1 ) {
+				this._timer = setTimeout(dojo.lang.hitch(this, "_cycle"), this.rate);
+			} else {
+				e.type = "end";
+				this._active = false;
+				if(typeof this.handler == "function") { this.handler(e); }
+				if(typeof this.onEnd == "function") { this.onEnd(e); }
+
+				if( this.repeatCount > 0 ) {
+					this.repeatCount--;
+					this.play(true);
+				} else if( this.repeatCount == -1 ) {
+					this.play(true);
+				} else {
+					if(this._startRepeatCount) {
+						this.repeatCount = this._startRepeatCount;
+						this._startRepeatCount = 0;
+					}
+					if( this._animSequence ) {
+						this._animSequence._playNext();
+					}
+				}
+			}
+		}
+	}
+});

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/AnimationEvent.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/AnimationEvent.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/AnimationEvent.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/AnimationEvent.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,40 @@
+/*
+	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.animation.AnimationEvent");
+
+dojo.require("dojo.lang");
+
+dojo.animation.AnimationEvent = function(anim, type, coords, sTime, cTime, eTime, dur, pct, fps) {
+	this.type = type; // "animate", "begin", "end", "play", "pause", "stop"
+	this.animation = anim;
+
+	this.coords = coords;
+	this.x = coords[0];
+	this.y = coords[1];
+	this.z = coords[2];
+
+	this.startTime = sTime;
+	this.currentTime = cTime;
+	this.endTime = eTime;
+
+	this.duration = dur;
+	this.percent = pct;
+	this.fps = fps;
+};
+dojo.lang.extend(dojo.animation.AnimationEvent, {
+	coordsAsInts: function() {
+		var cints = new Array(this.coords.length);
+		for(var i = 0; i < this.coords.length; i++) {
+			cints[i] = Math.round(this.coords[i]);
+		}
+		return cints;
+	}
+});

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/AnimationSequence.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/AnimationSequence.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/AnimationSequence.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/AnimationSequence.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,136 @@
+/*
+	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.animation.AnimationSequence");
+dojo.require("dojo.animation.AnimationEvent");
+dojo.require("dojo.animation.Animation");
+
+dojo.animation.AnimationSequence = function(repeatCount){
+	this._anims = [];
+	this.repeatCount = repeatCount || 0;
+}
+
+dojo.lang.extend(dojo.animation.AnimationSequence, {
+	repeateCount: 0,
+
+	_anims: [],
+	_currAnim: -1,
+
+	onBegin: null,
+	onEnd: null,
+	onNext: null,
+	handler: null,
+
+	add: function() {
+		for(var i = 0; i < arguments.length; i++) {
+			this._anims.push(arguments[i]);
+			arguments[i]._animSequence = this;
+		}
+	},
+
+	remove: function(anim) {
+		for(var i = 0; i < this._anims.length; i++) {
+			if( this._anims[i] == anim ) {
+				this._anims[i]._animSequence = null;
+				this._anims.splice(i, 1);
+				break;
+			}
+		}
+	},
+
+	removeAll: function() {
+		for(var i = 0; i < this._anims.length; i++) {
+			this._anims[i]._animSequence = null;
+		}
+		this._anims = [];
+		this._currAnim = -1;
+	},
+
+	clear: function() {
+		this.removeAll();
+	},
+
+	play: function(gotoStart) {
+		if( this._anims.length == 0 ) { return; }
+		if( gotoStart || !this._anims[this._currAnim] ) {
+			this._currAnim = 0;
+		}
+		if( this._anims[this._currAnim] ) {
+			if( this._currAnim == 0 ) {
+				var e = {type: "begin", animation: this._anims[this._currAnim]};
+				if(typeof this.handler == "function") { this.handler(e); }
+				if(typeof this.onBegin == "function") { this.onBegin(e); }
+			}
+			this._anims[this._currAnim].play(gotoStart);
+		}
+	},
+
+	pause: function() {
+		if( this._anims[this._currAnim] ) {
+			this._anims[this._currAnim].pause();
+		}
+	},
+
+	playPause: function() {
+		if( this._anims.length == 0 ) { return; }
+		if( this._currAnim == -1 ) { this._currAnim = 0; }
+		if( this._anims[this._currAnim] ) {
+			this._anims[this._currAnim].playPause();
+		}
+	},
+
+	stop: function() {
+		if( this._anims[this._currAnim] ) {
+			this._anims[this._currAnim].stop();
+		}
+	},
+
+	status: function() {
+		if( this._anims[this._currAnim] ) {
+			return this._anims[this._currAnim].status();
+		} else {
+			return "stopped";
+		}
+	},
+
+	_setCurrent: function(anim) {
+		for(var i = 0; i < this._anims.length; i++) {
+			if( this._anims[i] == anim ) {
+				this._currAnim = i;
+				break;
+			}
+		}
+	},
+
+	_playNext: function() {
+		if( this._currAnim == -1 || this._anims.length == 0 ) { return; }
+		this._currAnim++;
+		if( this._anims[this._currAnim] ) {
+			var e = {type: "next", animation: this._anims[this._currAnim]};
+			if(typeof this.handler == "function") { this.handler(e); }
+			if(typeof this.onNext == "function") { this.onNext(e); }
+			this._anims[this._currAnim].play(true);
+		} else {
+			var e = {type: "end", animation: this._anims[this._anims.length-1]};
+			if(typeof this.handler == "function") { this.handler(e); }
+			if(typeof this.onEnd == "function") { this.onEnd(e); }
+			if(this.repeatCount > 0) {
+				this._currAnim = 0;
+				this.repeatCount--;
+				this._anims[this._currAnim].play(true);
+			} else if(this.repeatCount == -1) {
+				this._currAnim = 0;
+				this._anims[this._currAnim].play(true);
+			} else {
+				this._currAnim = -1;
+			}
+		}
+	}
+});

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/Timer.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/Timer.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/Timer.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/Timer.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,39 @@
+/*
+	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.animation.Timer");
+dojo.require("dojo.lang.func");
+
+dojo.animation.Timer = function(intvl){
+	var timer = null;
+	this.isRunning = false;
+	this.interval = intvl;
+
+	this.onTick = function(){};
+	this.onStart = null;
+	this.onStop = null;
+
+	this.setInterval = function(ms){
+		if (this.isRunning) window.clearInterval(timer);
+		this.interval = ms;
+		if (this.isRunning) timer = window.setInterval(dojo.lang.hitch(this, "onTick"), this.interval);
+	};
+
+	this.start = function(){
+		if (typeof this.onStart == "function") this.onStart();
+		this.isRunning = true;
+		timer = window.setInterval(this.onTick, this.interval);
+	};
+	this.stop = function(){
+		if (typeof this.onStop == "function") this.onStop();
+		this.isRunning = false;
+		window.clearInterval(timer);
+	};
+};

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/__package__.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/__package__.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/__package__.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/animation/__package__.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,18 @@
+/*
+	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.kwCompoundRequire({
+	common: [
+		"dojo.animation.AnimationEvent",
+		"dojo.animation.Animation",
+		"dojo.animation.AnimationSequence"
+	]
+});
+dojo.provide("dojo.animation.*");

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/behavior.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/behavior.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/behavior.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/behavior.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,248 @@
+/*
+	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.behavior");
+dojo.require("dojo.event.*");
+
+dojo.require("dojo.experimental");
+dojo.experimental("dojo.behavior");
+
+dojo.behavior = new function(){
+	function arrIn(obj, name){
+		if(!obj[name]){ obj[name] = []; }
+		return obj[name];
+	}
+
+	function forIn(obj, scope, func){
+		var tmpObj = {};
+		for(var x in obj){
+			if(typeof tmpObj[x] == "undefined"){
+				if(!func){
+					scope(obj[x], x);
+				}else{
+					func.call(scope, obj[x], x);
+				}
+			}
+		}
+	}
+
+	// FIXME: need a better test so we don't exclude nightly Safari's!
+	this.behaviors = {};
+	this.add = function(behaviorObj){
+		/*	behavior objects are specified in the following format:
+		 *
+		 *	{ 
+		 *	 	"#id": {
+		 *			"found": function(element){
+		 *				// ...
+		 *			},
+		 *
+		 *			"onblah": {targetObj: foo, targetFunc: "bar"},
+		 *
+		 *			"onblarg": "/foo/bar/baz/blarg",
+		 *
+		 *			"onevent": function(evt){
+		 *			},
+		 *
+		 *			"onotherevent: function(evt){
+		 *				// ...
+		 *			}
+		 *		},
+		 *
+		 *		"#id2": {
+		 *			// ...
+		 *		},
+		 *
+		 *		"#id3": function(element){
+		 *			// ...
+		 *		},
+		 *
+		 *		// publish the match on a topic
+		 *		"#id4": "/found/topic/name",
+		 *
+		 *		// match all direct descendants
+		 *		"#id4 > *": function(element){
+		 *			// ...
+		 *		},
+		 *
+		 *		// match the first child node that's an element
+		 *		"#id4 > @firstElement": { ... },
+		 *
+		 *		// match the last child node that's an element
+		 *		"#id4 > @lastElement":  { ... },
+		 *
+		 *		// all elements of type tagname
+		 *		"tagname": {
+		 *			// ...
+		 *		},
+		 *
+		 *		// maps to roughly:
+		 *		//	dojo.lang.forEach(body.getElementsByTagName("tagname1"), function(node){
+		 *		//		dojo.lang.forEach(node.getElementsByTagName("tagname2"), function(node2){
+		 *		//			dojo.lang.forEach(node2.getElementsByTagName("tagname3", function(node3){
+		 *		//				// apply rules
+		 *		//			});
+		 *		//		});
+		 *		//	});
+		 *		"tagname1 tagname2 tagname3": {
+		 *			// ...
+		 *		},
+		 *
+		 *		".classname": {
+		 *			// ...
+		 *		},
+		 *
+		 *		"tagname.classname": {
+		 *			// ...
+		 *		},
+		 *	}
+		 *
+		 *	The "found" method is a generalized handler that's called as soon
+		 *	as the node matches the selector. Rules for values that follow also
+		 *	apply to the "found" key.
+		 *	
+		 *	The "on*" handlers are attached with dojo.event.connect(). If the
+		 *	value is not a function but is rather an object, it's assumed to be
+		 *	the "other half" of a dojo.event.kwConnect() argument object. It
+		 *	may contain any/all properties of such a connection modifier save
+		 *	for the sourceObj and sourceFunc properties which are filled in by
+		 *	the system automatically. If a string is instead encountered, the
+		 *	node publishes the specified event on the topic contained in the
+		 *	string value.
+		 *
+		 *	If the value corresponding to the ID key is a function and not a
+		 *	list, it's treated as though it was the value of "found".
+		 *
+		 */
+
+		var tmpObj = {};
+		forIn(behaviorObj, this, function(behavior, name){
+			var tBehavior = arrIn(this.behaviors, name);
+			if((dojo.lang.isString(behavior))||(dojo.lang.isFunction(behavior))){
+				behavior = { found: behavior };
+			}
+			forIn(behavior, function(rule, ruleName){
+				arrIn(tBehavior, ruleName).push(rule);
+			});
+		});
+	}
+
+	this.apply = function(){
+		dojo.profile.start("dojo.behavior.apply");
+		var r = dojo.render.html;
+		// note, we apply one way for fast queries and one way for slow
+		// iteration. So be it.
+		var safariGoodEnough = (!r.safari);
+		if(r.safari){
+			// Anything over release #420 should work the fast way
+			var uas = r.UA.split("AppleWebKit/")[1];
+			if(parseInt(uas.match(/[0-9.]{3,}/)) >= 420){
+				safariGoodEnough = true;
+			}
+		}
+		if((dj_undef("behaviorFastParse", djConfig) ? (safariGoodEnough) : djConfig["behaviorFastParse"])){
+			this.applyFast();
+		}else{
+			this.applySlow();
+		}
+		dojo.profile.end("dojo.behavior.apply");
+	}
+
+	this.matchCache = {};
+
+	this.elementsById = function(id, handleRemoved){
+		var removed = [];
+		var added = [];
+		arrIn(this.matchCache, id);
+		if(handleRemoved){
+			var nodes = this.matchCache[id];
+			for(var x=0; x<nodes.length; x++){
+				if(nodes[x].id != ""){
+					removed.push(nodes[x]);
+					nodes.splice(x, 1);
+					x--;
+				}
+			}
+		}
+		var tElem = dojo.byId(id);
+		while(tElem){
+			if(!tElem["idcached"]){
+				added.push(tElem);
+			}
+			tElem.id = "";
+			tElem = dojo.byId(id);
+		}
+		this.matchCache[id] = this.matchCache[id].concat(added);
+		dojo.lang.forEach(this.matchCache[id], function(node){
+			node.id = id;
+			node.idcached = true;
+		});
+		return { "removed": removed, "added": added, "match": this.matchCache[id] };
+	}
+
+	this.applyToNode = function(node, action, ruleSetName){
+		if(typeof action == "string"){
+			dojo.event.topic.registerPublisher(action, node, ruleSetName);
+		}else if(typeof action == "function"){
+			if(ruleSetName == "found"){
+				action(node);
+			}else{
+				dojo.event.connect(node, ruleSetName, action);
+			}
+		}else{
+			action.srcObj = node;
+			action.srcFunc = ruleSetName;
+			dojo.event.kwConnect(action);
+		}
+	}
+
+	this.applyFast = function(){
+		dojo.profile.start("dojo.behavior.applyFast");
+		// fast DOM queries...wheeee!
+		forIn(this.behaviors, function(tBehavior, id){
+			var elems = dojo.behavior.elementsById(id);
+			dojo.lang.forEach(elems.added, 
+				function(elem){
+					forIn(tBehavior, function(ruleSet, ruleSetName){
+						if(dojo.lang.isArray(ruleSet)){
+							dojo.lang.forEach(ruleSet, function(action){
+								dojo.behavior.applyToNode(elem, action, ruleSetName);
+							});
+						}
+					});
+				}
+			);
+		});
+		dojo.profile.end("dojo.behavior.applyFast");
+	}
+	
+	this.applySlow = function(){
+		// iterate. Ugg.
+		dojo.profile.start("dojo.behavior.applySlow");
+		var all = document.getElementsByTagName("*");
+		var allLen = all.length;
+		for(var x=0; x<allLen; x++){
+			var elem = all[x];
+			if((elem.id)&&(!elem["behaviorAdded"])&&(this.behaviors[elem.id])){
+				elem["behaviorAdded"] = true;
+				forIn(this.behaviors[elem.id], function(ruleSet, ruleSetName){
+					if(dojo.lang.isArray(ruleSet)){
+						dojo.lang.forEach(ruleSet, function(action){
+							dojo.behavior.applyToNode(elem, action, ruleSetName);
+						});
+					}
+				});
+			}
+		}
+		dojo.profile.end("dojo.behavior.applySlow");
+	}
+}
+
+dojo.addOnLoad(dojo.behavior, "apply");

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/bootstrap1.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/bootstrap1.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/bootstrap1.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/bootstrap1.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,339 @@
+/**
+* @file bootstrap1.js
+*
+* summary: First file that is loaded that 'bootstraps' the entire dojo library suite.
+* note:  Must run before hostenv_*.js file.
+*
+* @author  Copyright 2004 Mark D. Anderson (mda@discerning.com)
+* TODOC: should the copyright be changed to Dojo Foundation?
+* @license Licensed under the Academic Free License 2.1 http://www.opensource.org/licenses/afl-2.1.php
+*
+* $Id: bootstrap1.js 4342 2006-06-11 23:03:30Z alex $
+*/
+
+// TODOC: HOW TO DOC THE BELOW?
+// @global: djConfig
+// summary:  
+//		Application code can set the global 'djConfig' prior to loading
+//		the library to override certain global settings for how dojo works.  
+// description:  The variables that can be set are as follows:
+//			- isDebug: false
+//			- allowQueryConfig: false
+//			- baseScriptUri: ""
+//			- baseRelativePath: ""
+//			- libraryScriptUri: ""
+//			- iePreventClobber: false
+//			- ieClobberMinimal: true
+//			- preventBackButtonFix: true
+//			- searchIds: []
+//			- parseWidgets: true
+// TODOC: HOW TO DOC THESE VARIABLES?
+// TODOC: IS THIS A COMPLETE LIST?
+// note:
+//		'djConfig' does not exist under 'dojo.*' so that it can be set before the 
+//		'dojo' variable exists.  
+// note:
+//		Setting any of these variables *after* the library has loaded does nothing at all. 
+// TODOC: is this still true?  Release notes for 0.3 indicated they could be set after load.
+//
+
+
+
+//TODOC:  HOW TO DOC THIS?
+// @global: dj_global
+// summary: 
+//		an alias for the top-level global object in the host environment
+//		(e.g., the window object in a browser).
+// description:  
+//		Refer to 'dj_global' rather than referring to window to ensure your
+//		code runs correctly in contexts other than web browsers (eg: Rhino on a server).
+var dj_global = this;
+
+
+
+function dj_undef(/*String*/ name, /*Object?*/ object){
+	//summary: Returns true if 'name' is defined on 'object' (or globally if 'object' is null).
+	//description: Note that 'defined' and 'exists' are not the same concept.
+	if(object==null){ object = dj_global; }
+	// exception if object is not an Object
+	return (typeof object[name] == "undefined");	// Boolean
+}
+
+
+// make sure djConfig is defined
+if(dj_undef("djConfig")){ 
+	var djConfig = {}; 
+}
+
+
+//TODOC:  HOW TO DOC THIS?
+// dojo is the root variable of (almost all) our public symbols -- make sure it is defined.
+if(dj_undef("dojo")){ 
+	var dojo = {}; 
+}
+
+//TODOC:  HOW TO DOC THIS?
+dojo.version = {
+	// summary: version number of this instance of dojo.
+	major: 0, minor: 3, patch: 1, flag: "",
+	revision: Number("$Rev: 4342 $".match(/[0-9]+/)[0]),
+	toString: function(){
+		with(dojo.version){
+			return major + "." + minor + "." + patch + flag + " (" + revision + ")";	// String
+		}
+	}
+}
+
+dojo.evalProp = function(/*String*/ name, /*Object*/ object, /*Boolean?*/ create){
+	// summary: Returns 'object[name]'.  If not defined and 'create' is true, will return a new Object.
+	// description: 
+	//		Returns null if 'object[name]' is not defined and 'create' is not true.
+	// 		Note: 'defined' and 'exists' are not the same concept.	
+	return (object && !dj_undef(name, object) ? object[name] : (create ? (object[name]={}) : undefined));	// mixed
+}
+
+
+dojo.parseObjPath = function(/*String*/ path, /*Object?*/ context, /*Boolean?*/ create){
+	// summary: Parse string path to an object, and return corresponding object reference and property name.
+	// description: 
+	//		Returns an object with two properties, 'obj' and 'prop'.  
+	//		'obj[prop]' is the reference indicated by 'path'.
+	// path: Path to an object, in the form "A.B.C".
+	// context: Object to use as root of path.  Defaults to 'dj_global'.
+	// create: If true, Objects will be created at any point along the 'path' that is undefined.
+	var object = (context != null ? context : dj_global);
+	var names = path.split('.');
+	var prop = names.pop();
+	for (var i=0,l=names.length;i<l && object;i++){
+		object = dojo.evalProp(names[i], object, create);
+	}
+	return {obj: object, prop: prop};	// Object: {obj: Object, prop: String}
+}
+
+
+dojo.evalObjPath = function(/*String*/ path, /*Boolean?*/ create){
+	// summary: Return the value of object at 'path' in the global scope, without using 'eval()'.
+	// path: Path to an object, in the form "A.B.C".
+	// create: If true, Objects will be created at any point along the 'path' that is undefined.
+	if(typeof path != "string"){ 
+		return dj_global; 
+	}
+	// fast path for no periods
+	if(path.indexOf('.') == -1){
+		return dojo.evalProp(path, dj_global, create);		// mixed
+	}
+
+	//MOW: old 'with' syntax was confusing and would throw an error if parseObjPath returned null.
+	var ref = dojo.parseObjPath(path, dj_global, create);
+	if(ref){
+		return dojo.evalProp(ref.prop, ref.obj, create);	// mixed
+	}
+	return null;
+}
+
+// ****************************************************************
+// global public utils
+// TODOC: DO WE WANT TO NOTE THAT THESE ARE GLOBAL PUBLIC UTILS?
+// ****************************************************************
+
+dojo.errorToString = function(/*Error*/ exception){
+	// summary: Return an exception's 'message', 'description' or text.
+
+	// TODO: overriding Error.prototype.toString won't accomplish this?
+ 	// 		... since natively generated Error objects do not always reflect such things?
+	if(!dj_undef("message", exception)){
+		return exception.message;		// String
+	}else if(!dj_undef("description", exception)){
+		return exception.description;	// String
+	}else{
+		return exception;				// Error
+	}
+}
+
+
+dojo.raise = function(/*String*/ message, /*Error?*/ exception){
+	// summary: Throw an error message, appending text of 'exception' if provided.
+	// note: Also prints a message to the user using 'dojo.hostenv.println'.
+	if(exception){
+		message = message + ": "+dojo.errorToString(exception);
+	}
+
+	// print the message to the user if hostenv.println is defined
+	try {	dojo.hostenv.println("FATAL: "+message); } catch (e) {}
+
+	throw Error(message);
+}
+
+//Stub functions so things don't break.
+//TODOC:  HOW TO DOC THESE?
+dojo.debug = function(){}
+dojo.debugShallow = function(obj){}
+dojo.profile = { start: function(){}, end: function(){}, stop: function(){}, dump: function(){} };
+
+
+function dj_eval(/*String*/ scriptFragment){ 
+	// summary: Perform an evaluation in the global scope.  Use this rather than calling 'eval()' directly.
+	// description: Placed in a separate function to minimize size of trapped evaluation context.
+	// note:
+	//	 - JSC eval() takes an optional second argument which can be 'unsafe'.
+	//	 - Mozilla/SpiderMonkey eval() takes an optional second argument which is the
+	//  	 scope object for new symbols.
+	return dj_global.eval ? dj_global.eval(scriptFragment) : eval(scriptFragment); 	// mixed
+}
+
+
+
+dojo.unimplemented = function(/*String*/ funcname, /*String?*/ extra){
+	// summary: Throw an exception because some function is not implemented.
+	// extra: Text to append to the exception message.
+	var message = "'" + funcname + "' not implemented";
+	if (extra != null) { message += " " + extra; }
+	dojo.raise(message);
+}
+
+
+dojo.deprecated = function(/*String*/ behaviour, /*String?*/ extra, /*String?*/ removal){
+	// summary: Log a debug message to indicate that a behavior has been deprecated.
+	// extra: Text to append to the message.
+	// removal: Text to indicate when in the future the behavior will be removed.
+	var message = "DEPRECATED: " + behaviour;
+	if(extra){ message += " " + extra; }
+	if(removal){ message += " -- will be removed in version: " + removal; }
+	dojo.debug(message);
+}
+
+
+
+dojo.inherits = function(/*Function*/ subclass, /*Function*/ superclass){
+	// summary: Set up inheritance between two classes.
+	if(typeof superclass != 'function'){ 
+		dojo.raise("dojo.inherits: superclass argument ["+superclass+"] must be a function (subclass: [" + subclass + "']");
+	}
+	subclass.prototype = new superclass();
+	subclass.prototype.constructor = subclass;
+	subclass.superclass = superclass.prototype;
+	// DEPRICATED: super is a reserved word, use 'superclass'
+	subclass['super'] = superclass.prototype;
+}
+
+dojo.render = (function(){
+	//TODOC: HOW TO DOC THIS?
+	// summary: Details rendering support, OS and browser of the current environment.
+	// TODOC: is this something many folks will interact with?  If so, we should doc the structure created...
+	function vscaffold(prefs, names){
+		var tmp = {
+			capable: false,
+			support: {
+				builtin: false,
+				plugin: false
+			},
+			prefixes: prefs
+		};
+		for(var prop in names){
+			tmp[prop] = false;
+		}
+		return tmp;
+	}
+
+	return {
+		name: "",
+		ver: dojo.version,
+		os: { win: false, linux: false, osx: false },
+		html: vscaffold(["html"], ["ie", "opera", "khtml", "safari", "moz"]),
+		svg: vscaffold(["svg"], ["corel", "adobe", "batik"]),
+		vml: vscaffold(["vml"], ["ie"]),
+		swf: vscaffold(["Swf", "Flash", "Mm"], ["mm"]),
+		swt: vscaffold(["Swt"], ["ibm"])
+	};
+})();
+
+// ****************************************************************
+// dojo.hostenv methods that must be defined in hostenv_*.js
+// ****************************************************************
+
+/**
+ * The interface definining the interaction with the EcmaScript host environment.
+*/
+
+/*
+ * None of these methods should ever be called directly by library users.
+ * Instead public methods such as loadModule should be called instead.
+ */
+dojo.hostenv = (function(){
+	// TODOC:  HOW TO DOC THIS?
+	// summary: Provides encapsulation of behavior that changes across different 'host environments' 
+	//			(different browsers, server via Rhino, etc).
+	// description: None of these methods should ever be called directly by library users.
+	//				Use public methods such as 'loadModule' instead.
+	
+	// default configuration options
+	var config = {
+		isDebug: false,
+		allowQueryConfig: false,
+		baseScriptUri: "",
+		baseRelativePath: "",
+		libraryScriptUri: "",
+		iePreventClobber: false,
+		ieClobberMinimal: true,
+		preventBackButtonFix: true,
+		searchIds: [],
+		parseWidgets: true
+	};
+
+	if (typeof djConfig == "undefined") { djConfig = config; }
+	else {
+		for (var option in config) {
+			if (typeof djConfig[option] == "undefined") {
+				djConfig[option] = config[option];
+			}
+		}
+	}
+
+	return {
+		name_: '(unset)',
+		version_: '(unset)',
+
+
+		getName: function(){ 
+			// sumary: Return the name of the host environment.
+			return this.name_; 	// String
+		},
+
+
+		getVersion: function(){ 
+			// summary: Return the version of the hostenv.
+			return this.version_; // String
+		},
+
+		getText: function(/*String*/ uri){
+			// summary:	Read the plain/text contents at the specified 'uri'.
+			// description: 
+			//			If 'getText()' is not implemented, then it is necessary to override 
+			//			'loadUri()' with an implementation that doesn't rely on it.
+
+			dojo.unimplemented('getText', "uri=" + uri);
+		}
+	};
+})();
+
+
+dojo.hostenv.getBaseScriptUri = function(){
+	// summary: Return the base script uri that other scripts are found relative to.
+	// TODOC: HUH?  This comment means nothing to me.  What other scripts? Is this the path to other dojo libraries?
+	//		MAYBE:  Return the base uri to scripts in the dojo library.	 ???
+	// return: Empty string or a path ending in '/'.
+	if(djConfig.baseScriptUri.length){ 
+		return djConfig.baseScriptUri;
+	}
+
+	// MOW: Why not:
+	//			uri = djConfig.libraryScriptUri || djConfig.baseRelativePath
+	//		??? Why 'new String(...)'
+	var uri = new String(djConfig.libraryScriptUri||djConfig.baseRelativePath);
+	if (!uri) { dojo.raise("Nothing returned by getLibraryScriptUri(): " + uri); }
+
+	// MOW: uri seems to not be actually used.  Seems to be hard-coding to djConfig.baseRelativePath... ???
+	var lastslash = uri.lastIndexOf('/');		// MOW ???
+	djConfig.baseScriptUri = djConfig.baseRelativePath;
+	return djConfig.baseScriptUri;	// String
+}

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/bootstrap2.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/bootstrap2.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/bootstrap2.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/bootstrap2.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,174 @@
+/*
+	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
+*/
+
+//Semicolon is for when this file is integrated with a custom build on one line
+//with some other file's contents. Sometimes that makes things not get defined
+//properly, particularly with the using the closure below to do all the work.
+;(function(){
+	//Don't do this work if dojo.js has already done it.
+	if(typeof dj_usingBootstrap != "undefined"){
+		return;
+	}
+
+	var isRhino = false;
+	var isSpidermonkey = false;
+	var isDashboard = false;
+	if((typeof this["load"] == "function")&&((typeof this["Packages"] == "function")||(typeof this["Packages"] == "object"))){
+		isRhino = true;
+	}else if(typeof this["load"] == "function"){
+		isSpidermonkey  = true;
+	}else if(window.widget){
+		isDashboard = true;
+	}
+
+	var tmps = [];
+	if((this["djConfig"])&&((djConfig["isDebug"])||(djConfig["debugAtAllCosts"]))){
+		tmps.push("debug.js");
+	}
+
+	if((this["djConfig"])&&(djConfig["debugAtAllCosts"])&&(!isRhino)&&(!isDashboard)){
+		tmps.push("browser_debug.js");
+	}
+
+	//Support compatibility packages. Right now this only allows setting one
+	//compatibility package. Might need to revisit later down the line to support
+	//more than one.
+	if((this["djConfig"])&&(djConfig["compat"])){
+		tmps.push("compat/" + djConfig["compat"] + ".js");
+	}
+
+	var loaderRoot = djConfig["baseScriptUri"];
+	if((this["djConfig"])&&(djConfig["baseLoaderUri"])){
+		loaderRoot = djConfig["baseLoaderUri"];
+	}
+
+	for(var x=0; x < tmps.length; x++){
+		var spath = loaderRoot+"src/"+tmps[x];
+		if(isRhino||isSpidermonkey){
+			load(spath);
+		} else {
+			try {
+				document.write("<scr"+"ipt type='text/javascript' src='"+spath+"'></scr"+"ipt>");
+			} catch (e) {
+				var script = document.createElement("script");
+				script.src = spath;
+				document.getElementsByTagName("head")[0].appendChild(script);
+			}
+		}
+	}
+})();
+
+// Localization routines
+
+/**
+ * The locale to look for string bundles if none are defined for your locale.  Translations for all strings
+ * should be provided in this locale.
+ */
+//TODO: this really belongs in translation metadata, not in code
+dojo.fallback_locale = 'en';
+
+/**
+ * Returns canonical form of locale, as used by Dojo.  All variants are case-insensitive and are separated by '-'
+ * as specified in RFC 3066
+ */
+dojo.normalizeLocale = function(locale) {
+	return locale ? locale.toLowerCase() : dojo.locale;
+};
+
+/**
+ * requireLocalization() is for loading translated bundles provided within a package in the namespace.
+ * Contents are typically strings, but may be any name/value pair, represented in JSON format.
+ * A bundle is structured in a program as follows:
+ *
+ * <package>/
+ *  nls/
+ *   de/
+ *    mybundle.js
+ *   de-at/
+ *    mybundle.js
+ *   en/
+ *    mybundle.js
+ *   en-us/
+ *    mybundle.js
+ *   en-gb/
+ *    mybundle.js
+ *   es/
+ *    mybundle.js
+ *  ...etc
+ *
+ * where package is part of the namespace as used by dojo.require().  Each directory is named for a
+ * locale as specified by RFC 3066, (http://www.ietf.org/rfc/rfc3066.txt), normalized in lowercase.
+ *
+ * For a given locale, string bundles will be loaded for that locale and all general locales above it, as well
+ * as a system-specified fallback.  For example, "de_at" will also load "de" and "en".  Lookups will traverse
+ * the locales in this order.  A build step can preload the bundles to avoid data redundancy and extra network hits.
+ *
+ * @param modulename package in which the bundle is found
+ * @param bundlename bundle name, typically the filename without the '.js' suffix
+ * @param locale the locale to load (optional)  By default, the browser's user locale as defined
+ *	in dojo.locale
+ */
+dojo.requireLocalization = function(modulename, bundlename, locale /*optional*/){
+
+	dojo.debug("EXPERIMENTAL: dojo.requireLocalization"); //dojo.experimental
+
+	var syms = dojo.hostenv.getModuleSymbols(modulename);
+	var modpath = syms.concat("nls").join("/");
+
+	locale = dojo.normalizeLocale(locale);
+
+	var elements = locale.split('-');
+	var searchlist = [];
+	for(var i = elements.length; i > 0; i--){
+		searchlist.push(elements.slice(0, i).join('-'));
+	}
+	if(searchlist[searchlist.length-1] != dojo.fallback_locale){
+		searchlist.push(dojo.fallback_locale);
+	}
+
+	var bundlepackage = [modulename, "_nls", bundlename].join(".");
+	var bundle = dojo.hostenv.startPackage(bundlepackage);
+	dojo.hostenv.loaded_modules_[bundlepackage] = bundle;
+	
+	var inherit = false;
+	for(var i = searchlist.length - 1; i >= 0; i--){
+		var loc = searchlist[i];
+		var pkg = [bundlepackage, loc].join(".");
+		var loaded = false;
+		if(!dojo.hostenv.findModule(pkg)){
+			// Mark loaded whether it's found or not, so that further load attempts will not be made
+			dojo.hostenv.loaded_modules_[pkg] = null;
+
+			var filespec = [modpath, loc, bundlename].join("/") + '.js';
+			loaded = dojo.hostenv.loadPath(filespec, null, function(hash) {
+ 				bundle[loc] = hash;
+ 				if(inherit){
+					// Use mixins approach to copy string references from inherit bundle, but skip overrides.
+					for(var x in inherit){
+						if(!bundle[loc][x]){
+							bundle[loc][x] = inherit[x];
+						}
+					}
+ 				}
+/*
+				// Use prototype to point to other bundle, then copy in result from loadPath
+				bundle[loc] = new function(){};
+				if(inherit){ bundle[loc].prototype = inherit; }
+				for(var i in hash){ bundle[loc][i] = hash[i]; }
+*/
+			});
+		}else{
+			loaded = true;
+		}
+		if(loaded && bundle[loc]){
+			inherit = bundle[loc];
+		}
+	}
+};

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/browser_debug.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/browser_debug.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/browser_debug.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/browser_debug.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,162 @@
+/*
+	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.hostenv.loadedUris.push("../src/bootstrap1.js");
+dojo.hostenv.loadedUris.push("../src/loader.js");
+dojo.hostenv.loadedUris.push("../src/hostenv_browser.js");
+dojo.hostenv.loadedUris.push("../src/bootstrap2.js");
+
+function removeComments(contents){
+	contents = new String((!contents) ? "" : contents);
+	// clobber all comments
+	contents = contents.replace( /^(.*?)\/\/(.*)$/mg , "$1");
+	contents = contents.replace( /(\n)/mg , "__DOJONEWLINE");
+	contents = contents.replace( /\/\*(.*?)\*\//g , "");
+	return contents.replace( /__DOJONEWLINE/mg , "\n");
+}
+
+dojo.hostenv.getRequiresAndProvides = function(contents){
+	// FIXME: should probably memoize this!
+	if(!contents){ return []; }
+	
+
+	// check to see if we need to load anything else first. Ugg.
+	var deps = [];
+	var tmp;
+	RegExp.lastIndex = 0;
+	var testExp = /dojo.(hostenv.loadModule|hosetnv.require|require|requireIf|kwCompoundRequire|hostenv.conditionalLoadModule|hostenv.startPackage|provide)\([\w\W]*?\)/mg;
+	while((tmp = testExp.exec(contents)) != null){
+		deps.push(tmp[0]);
+	}
+	return deps;
+}
+
+dojo.hostenv.getDelayRequiresAndProvides = function(contents){
+	// FIXME: should probably memoize this!
+	if(!contents){ return []; }
+
+	// check to see if we need to load anything else first. Ugg.
+	var deps = [];
+	var tmp;
+	RegExp.lastIndex = 0;
+	var testExp = /dojo.(requireAfterIf)\([\w\W]*?\)/mg;
+	while((tmp = testExp.exec(contents)) != null){
+		deps.push(tmp[0]);
+	}
+	return deps;
+}
+
+/*
+dojo.getNonExistantDescendants = function(objpath){
+	var ret = [];
+	// fast path for no periods
+	if(typeof objpath != "string"){ return dj_global; }
+	if(objpath.indexOf('.') == -1){
+		if(dj_undef(objpath, dj_global)){
+			ret.push[objpath];
+		}
+		return ret;
+	}
+
+	var syms = objpath.split(/\./);
+	var obj = dj_global;
+	for(var i=0;i<syms.length;++i){
+		if(dj_undef(syms[i], obj)){
+			for(var j=i; j<syms.length; j++){
+				ret.push(syms.slice(0, j+1).join("."));
+			}
+			break;
+		}
+	}
+	return ret;
+}
+*/
+
+dojo.clobberLastObject = function(objpath){
+	if(objpath.indexOf('.') == -1){
+		if(!dj_undef(objpath, dj_global)){
+			delete dj_global[objpath];
+		}
+		return true;
+	}
+
+	var syms = objpath.split(/\./);
+	var base = dojo.evalObjPath(syms.slice(0, -1).join("."), false);
+	var child = syms[syms.length-1];
+	if(!dj_undef(child, base)){
+		// alert(objpath);
+		delete base[child];
+		return true;
+	}
+	return false;
+}
+
+var removals = [];
+
+function zip(arr){
+	var ret = [];
+	var seen = {};
+	for(var x=0; x<arr.length; x++){
+		if(!seen[arr[x]]){
+			ret.push(arr[x]);
+			seen[arr[x]] = true;
+		}
+	}
+	return ret;
+}
+
+// over-write dj_eval to prevent actual loading of subsequent files
+var old_dj_eval = dj_eval;
+dj_eval = function(){ return true; }
+dojo.hostenv.oldLoadUri = dojo.hostenv.loadUri;
+dojo.hostenv.loadUri = function(uri){
+	if(dojo.hostenv.loadedUris[uri]){
+		return true; // fixes endless recursion opera trac 471
+	}
+	try{
+		var text = this.getText(uri, null, true);
+		var requires = dojo.hostenv.getRequiresAndProvides(text);
+		eval(requires.join(";"));
+		dojo.hostenv.loadedUris.push(uri);
+		dojo.hostenv.loadedUris[uri] = true;
+		var delayRequires = dojo.hostenv.getDelayRequiresAndProvides(text);
+		eval(delayRequires.join(";"));
+	}catch(e){ 
+		alert(e);
+	}
+	return true;
+}
+
+dojo.hostenv.writeIncludes = function(){
+	for(var x=removals.length-1; x>=0; x--){
+		dojo.clobberLastObject(removals[x]);
+	}
+	var depList = [];
+	var seen = {};
+	for(var x=0; x<dojo.hostenv.loadedUris.length; x++){
+		var curi = dojo.hostenv.loadedUris[x];
+		// dojo.debug(curi);
+		if(!seen[curi]){
+			seen[curi] = true;
+			depList.push(curi);
+		}
+	}
+
+	dojo.hostenv._global_omit_module_check = true;
+	for(var x=4; x<depList.length; x++){
+		document.write("<script type='text/javascript' src='"+depList[x]+"'></script>");
+	}
+	document.write("<script type='text/javascript'>dojo.hostenv._global_omit_module_check = false;</script>");
+
+	// turn off debugAtAllCosts, so that dojo.require() calls inside of ContentPane hrefs
+	// work correctly
+	dj_eval = old_dj_eval;
+	dojo.hostenv.loadUri = dojo.hostenv.oldLoadUri;
+}

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/ArrayList.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/ArrayList.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/ArrayList.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/ArrayList.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,146 @@
+/*
+	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.collections.ArrayList");
+dojo.require("dojo.collections.Collections");
+
+dojo.collections.ArrayList=function(/* array? */arr){
+	//	summary
+	//	Returns a new object of type dojo.collections.ArrayList
+	var items=[];
+	if(arr) items=items.concat(arr);
+	this.count=items.length;
+	this.add=function(/* object */obj){
+		//	summary
+		//	Add an element to the collection.
+		items.push(obj);
+		this.count=items.length;
+	};
+	this.addRange=function(/* array */a){
+		//	summary
+		//	Add a range of objects to the ArrayList
+		if(a.getIterator){
+			var e=a.getIterator();
+			while(!e.atEnd()){
+				this.add(e.get());
+			}
+			this.count=items.length;
+		}else{
+			for(var i=0; i<a.length; i++){
+				items.push(a[i]);
+			}
+			this.count=items.length;
+		}
+	};
+	this.clear=function(){
+		//	summary
+		//	Clear all elements out of the collection, and reset the count.
+		items.splice(0, items.length);
+		this.count=0;
+	};
+	this.clone=function(){
+		//	summary
+		//	Clone the array list
+		return new dojo.collections.ArrayList(items);	//	dojo.collections.ArrayList
+	};
+	this.contains=function(/* object */obj){
+		//	summary
+		//	Check to see if the passed object is a member in the ArrayList
+		for(var i=0; i < items.length; i++){
+			if(items[i] == obj) {
+				return true;	//	bool
+			}
+		}
+		return false;	//	bool
+	};
+	this.forEach=function(/* function */ fn, /* object? */ scope){
+		//	summary
+		//	functional iterator, following the mozilla spec.
+		var s=scope||dj_global;
+		if(Array.forEach){
+			Array.forEach(items, fn, s);
+		}else{
+			for(var i=0; i<items.length; i++){
+				fn.call(s, items[i], i, items);
+			}
+		}
+	};
+	this.getIterator=function(){
+		//	summary
+		//	Get an Iterator for this object
+		return new dojo.collections.Iterator(items);	//	dojo.collections.Iterator
+	};
+	this.indexOf=function(/* object */obj){
+		//	summary
+		//	Return the numeric index of the passed object; will return -1 if not found.
+		for(var i=0; i < items.length; i++){
+			if(items[i] == obj) {
+				return i;	//	int
+			}
+		}
+		return -1;	// int
+	};
+	this.insert=function(/* int */ i, /* object */ obj){
+		//	summary
+		//	Insert the passed object at index i
+		items.splice(i,0,obj);
+		this.count=items.length;
+	};
+	this.item=function(/* int */ i){
+		//	summary
+		//	return the element at index i
+		return items[i];	//	object
+	};
+	this.remove=function(/* object */obj){
+		//	summary
+		//	Look for the passed object, and if found, remove it from the internal array.
+		var i=this.indexOf(obj);
+		if(i >=0) {
+			items.splice(i,1);
+		}
+		this.count=items.length;
+	};
+	this.removeAt=function(/* int */ i){
+		//	summary
+		//	return an array with function applied to all elements
+		items.splice(i,1);
+		this.count=items.length;
+	};
+	this.reverse=function(){
+		//	summary
+		//	Reverse the internal array
+		items.reverse();
+	};
+	this.sort=function(/* function? */ fn){
+		//	summary
+		//	sort the internal array
+		if(fn){
+			items.sort(fn);
+		}else{
+			items.sort();
+		}
+	};
+	this.setByIndex=function(/* int */ i, /* object */ obj){
+		//	summary
+		//	Set an element in the array by the passed index.
+		items[i]=obj;
+		this.count=items.length;
+	};
+	this.toArray=function(){
+		//	summary
+		//	Return a new array with all of the items of the internal array concatenated.
+		return [].concat(items);
+	}
+	this.toString=function(/* string */ delim){
+		//	summary
+		//	implementation of toString, follows [].toString();
+		return items.join((delim||","));
+	};
+};

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/BinaryTree.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/BinaryTree.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/BinaryTree.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/BinaryTree.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,203 @@
+/*
+	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.collections.BinaryTree");
+dojo.require("dojo.collections.Collections");
+dojo.require("dojo.experimental");
+
+dojo.experimental("dojo.collections.BinaryTree");
+
+dojo.collections.BinaryTree=function(data){
+	function node(data, rnode, lnode){
+		this.value=data||null;
+		this.right=rnode||null;
+		this.left=lnode||null;
+		this.clone=function(){
+			var c=new node();
+			if (this.value.value) c.value=this.value.clone();
+			else c.value=this.value;
+			if (this.left) c.left=this.left.clone();
+			if (this.right) c.right=this.right.clone();
+		}
+		this.compare=function(n){
+			if (this.value > n.value) return 1;
+			if (this.value < n.value) return -1;
+			return 0;
+		}
+		this.compareData=function(d){
+			if (this.value > d) return 1;
+			if (this.value < d) return -1;
+			return 0;
+		}
+	}
+
+	function inorderTraversalBuildup(current, a){
+		if (current){
+			inorderTraversalBuildup(current.left, a);
+			a.add(current);
+			inorderTraversalBuildup(current.right, a);
+		}
+	}
+
+	function preorderTraversal(current, sep){
+		var s="";
+		if (current){
+			s=current.value.toString() + sep;
+			s += preorderTraversal(current.left, sep);
+			s += preorderTraversal(current.right, sep);
+		}
+		return s;
+	}
+	function inorderTraversal(current, sep){
+		var s="";
+		if (current){
+			s=inorderTraversal(current.left, sep);
+			s += current.value.toString() + sep;
+			s += inorderTraversal(current.right, sep);
+		}
+		return s;
+	}
+	function postorderTraversal(current, sep){
+		var s="";
+		if (current){
+			s=postorderTraversal(current.left, sep);
+			s += postorderTraversal(current.right, sep);
+			s += current.value.toString() + sep;
+		}
+		return s;
+	}
+	
+	function searchHelper(current, data){
+		if (!current) return null;
+		var i=current.compareData(data);
+		if (i==0) return current;
+		if (i>0) return searchHelper(current.left, data);
+		else return searchHelper(current.right, data);
+	}
+
+	this.add=function(data){
+		var n=new node(data);
+		var i;
+		var current=root;
+		var parent=null;
+		while (current){
+			i=current.compare(n);
+			if (i == 0) return;
+			parent=current;
+			if (i > 0) current=current.left;
+			else current=current.right;
+		}
+		this.count++;
+		if (!parent) root=n;
+		else {
+			i=parent.compare(n);
+			if (i > 0) parent.left=n;
+			else parent.right=n;
+		}
+	};
+	this.clear=function(){
+		root=null;
+		this.count=0;
+	};
+	this.clone=function(){
+		var c=new dojo.collections.BinaryTree();
+		c.root=root.clone();
+		c.count=this.count;
+		return c;
+	};
+	this.contains=function(data){
+		return this.search(data) != null;
+	};
+	this.deleteData=function(data){
+		var current=root;
+		var parent=null;
+		var i=current.compareData(data);
+		while (i != 0 && current != null){
+			if (i > 0){
+				parent=current;
+				current=current.left;
+			} else if (i < 0) {
+				parent=current;
+				current=current.right;
+			}
+			i=current.compareData(data);
+		}
+		if (!current) return;
+		this.count--;
+		if (!current.right) {
+			if (!parent) root=current.left;
+			else {
+				i=parent.compare(current);
+				if (i > 0) parent.left=current.left;
+				else if (i < 0) parent.right=current.left;
+			}
+		} else if (!current.right.left){
+			if (!parent) root=current.right;
+			else {
+				i=parent.compare(current);
+				if (i > 0) parent.left=current.right;
+				else if (i < 0) parent.right=current.right;
+			}
+		} else {
+			var leftmost=current.right.left;
+			var lmParent=current.right;
+			while (leftmost.left != null){
+				lmParent=leftmost;
+				leftmost=leftmost.left;
+			}
+			lmParent.left=leftmost.right;
+			leftmost.left=current.left;
+			leftmost.right=current.right;
+			if (!parent) root=leftmost;
+			else {
+				i=parent.compare(current);
+				if (i > 0) parent.left=leftmost;
+				else if (i < 0) parent.right=leftmost;
+			}
+		}
+	};
+	this.getIterator=function(){
+		var a=[];
+		inorderTraversalBuildup(root, a);
+		return new dojo.collections.Iterator(a);
+	};
+	this.search=function(data){
+		return searchHelper(root, data);
+	};
+	this.toString=function(order, sep){
+		if (!order) var order=dojo.collections.BinaryTree.TraversalMethods.Inorder;
+		if (!sep) var sep=" ";
+		var s="";
+		switch (order){
+			case dojo.collections.BinaryTree.TraversalMethods.Preorder:
+				s=preorderTraversal(root, sep);
+				break;
+			case dojo.collections.BinaryTree.TraversalMethods.Inorder:
+				s=inorderTraversal(root, sep);
+				break;
+			case dojo.collections.BinaryTree.TraversalMethods.Postorder:
+				s=postorderTraversal(root, sep);
+				break;
+		};
+		if (s.length == 0) return "";
+		else return s.substring(0, s.length - sep.length);
+	};
+
+	this.count=0;
+	var root=this.root=null;
+	if (data) {
+		this.add(data);
+	}
+}
+dojo.collections.BinaryTree.TraversalMethods={
+	Preorder : 0,
+	Inorder : 1,
+	Postorder : 2
+};

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Collections.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Collections.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Collections.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Collections.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,125 @@
+/*
+	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.collections.Collections");
+
+dojo.collections={Collections:true};
+dojo.collections.DictionaryEntry=function(/* string */k, /* object */v){
+	//	summary
+	//	return an object of type dojo.collections.DictionaryEntry
+	this.key=k;
+	this.value=v;
+	this.valueOf=function(){ 
+		return this.value; 	//	object
+	};
+	this.toString=function(){ 
+		return String(this.value);	//	string 
+	};
+}
+
+/*	Iterators
+ *	The collections.Iterators (Iterator and DictionaryIterator) are built to
+ *	work with the Collections included in this namespace.  However, they *can*
+ *	be used with arrays and objects, respectively, should one choose to do so.
+ */
+dojo.collections.Iterator=function(/* array */arr){
+	//	summary
+	//	return an object of type dojo.collections.Iterator
+	var a=arr;
+	var position=0;
+	this.element=a[position]||null;
+	this.atEnd=function(){
+		//	summary
+		//	Test to see if the internal cursor has reached the end of the internal collection.
+		return (position>=a.length);	//	bool
+	};
+	this.get=function(){
+		//	summary
+		//	Test to see if the internal cursor has reached the end of the internal collection.
+		if(this.atEnd()){
+			return null;		//	object
+		}
+		this.element=a[position++];
+		return this.element;	//	object
+	};
+	this.map=function(/* function */fn, /* object? */scope){
+		//	summary
+		//	Functional iteration with optional scope.
+		var s=scope||dj_global;
+		if(Array.map){
+			return Array.map(a,fn,s);	//	array
+		}else{
+			var arr=[];
+			for(var i=0; i<a.length; i++){
+				arr.push(fn.call(s,a[i]));
+			}
+			return arr;		//	array
+		}
+	};
+	this.reset=function(){
+		//	summary
+		//	reset the internal cursor.
+		position=0;
+		this.element=a[position];
+	};
+}
+
+/*	Notes:
+ *	The DictionaryIterator no longer supports a key and value property;
+ *	the reality is that you can use this to iterate over a JS object
+ *	being used as a hashtable.
+ */
+dojo.collections.DictionaryIterator=function(/* object */obj){
+	//	summary
+	//	return an object of type dojo.collections.DictionaryIterator
+	var a=[];	//	Create an indexing array
+	var testObject={};
+	for(var p in obj){
+		if(!testObject[p]){
+			a.push(obj[p]);	//	fill it up
+		}
+	}
+	var position=0;
+	this.element=a[position]||null;
+	this.atEnd=function(){
+		//	summary
+		//	Test to see if the internal cursor has reached the end of the internal collection.
+		return (position>=a.length);	//	bool
+	};
+	this.get=function(){
+		//	summary
+		//	Test to see if the internal cursor has reached the end of the internal collection.
+		if(this.atEnd()){
+			return null;		//	object
+		}
+		this.element=a[position++];
+		return this.element;	//	object
+	};
+	this.map=function(/* function */fn, /* object? */scope){
+		//	summary
+		//	Functional iteration with optional scope.
+		var s=scope||dj_global;
+		if(Array.map){
+			return Array.map(a,fn,s);	//	array
+		}else{
+			var arr=[];
+			for(var i=0; i<a.length; i++){
+				arr.push(fn.call(s,a[i]));
+			}
+			return arr;		//	array
+		}
+	};
+	this.reset=function() { 
+		//	summary
+		//	reset the internal cursor.
+		position=0; 
+		this.element=a[position];
+	};
+};

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Dictionary.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Dictionary.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Dictionary.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Dictionary.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,129 @@
+/*
+	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.collections.Dictionary");
+dojo.require("dojo.collections.Collections");
+
+dojo.collections.Dictionary=function(/* dojo.collections.Dictionary? */dictionary){
+	//	summary
+	//	Returns an object of type dojo.collections.Dictionary
+	var items={};
+	this.count=0;
+
+	//	comparator for property addition and access.
+	var testObject={};
+
+	this.add=function(/* string */k, /* object */v){
+		//	summary
+		//	Add a new item to the Dictionary.
+		var b=(k in items);
+		items[k]=new dojo.collections.DictionaryEntry(k,v);
+		if(!b){
+			this.count++;
+		}
+	};
+	this.clear=function(){
+		//	summary
+		//	Clears the internal dictionary.
+		items={};
+		this.count=0;
+	};
+	this.clone=function(){
+		//	summary
+		//	Returns a new instance of dojo.collections.Dictionary; note the the dictionary is a clone but items might not be.
+		return new dojo.collections.Dictionary(this);	//	dojo.collections.Dictionary
+	};
+	this.contains=this.containsKey=function(/* string */k){
+		//	summary
+		//	Check to see if the dictionary has an entry at key "k".
+		if(testObject[k]){
+			return false;			// bool
+		}
+		return (items[k]!=null);	//	bool
+	};
+	this.containsValue=function(/* object */v){
+		//	summary
+		//	Check to see if the dictionary has an entry with value "v".
+		var e=this.getIterator();
+		while(e.get()){
+			if(e.element.value==v){
+				return true;	//	bool
+			}
+		}
+		return false;	//	bool
+	};
+	this.entry=function(/* string */k){
+		//	summary
+		//	Accessor method; similar to dojo.collections.Dictionary.item but returns the actual Entry object.
+		return items[k];	//	dojo.collections.DictionaryEntry
+	};
+	this.forEach=function(/* function */ fn, /* object? */ scope){
+		//	summary
+		//	functional iterator, following the mozilla spec.
+		var a=[];	//	Create an indexing array
+		for(var p in items) {
+			if(!testObject[p]){
+				a.push(items[p]);	//	fill it up
+			}
+		}
+		var s=scope||dj_global;
+		if(Array.forEach){
+			Array.forEach(a, fn, s);
+		}else{
+			for(var i=0; i<a.length; i++){
+				fn.call(s, a[i], i, a);
+			}
+		}
+	};
+	this.getKeyList=function(){
+		//	summary
+		//	Returns an array of the keys in the dictionary.
+		return (this.getIterator()).map(function(entry){ 
+			return entry.key; 
+		});	//	array
+	};
+	this.getValueList=function(){
+		//	summary
+		//	Returns an array of the values in the dictionary.
+		return (this.getIterator()).map(function(entry){ 
+			return entry.value; 
+		});	//	array
+	};
+	this.item=function(/* string */k){
+		//	summary
+		//	Accessor method.
+		if(k in items){
+			return items[k].valueOf();	//	object
+		}
+		return undefined;	//	object
+	};
+	this.getIterator=function(){
+		//	summary
+		//	Gets a dojo.collections.DictionaryIterator for iteration purposes.
+		return new dojo.collections.DictionaryIterator(items);	//	dojo.collections.DictionaryIterator
+	};
+	this.remove=function(/* string */k){
+		//	summary
+		//	Removes the item at k from the internal collection.
+		if(k in items && !testObject[k]){
+			delete items[k];
+			this.count--;
+			return true;	//	bool
+		}
+		return false;	//	bool
+	};
+
+	if (dictionary){
+		var e=dictionary.getIterator();
+		while(e.get()) {
+			 this.add(e.element.key, e.element.value);
+		}
+	}
+};

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Graph.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Graph.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Graph.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Graph.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,153 @@
+/*
+	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.collections.Graph");
+dojo.require("dojo.collections.Collections");
+
+dojo.experimental("dojo.collections.Graph");
+
+dojo.collections.Graph=function(nodes){
+	function node(key, data, neighbors) {
+		this.key=key;
+		this.data=data;
+		this.neighbors=neighbors||new adjacencyList();
+		this.addDirected=function(){
+			if (arguments[0].constructor==edgeToNeighbor){
+				this.neighbors.add(arguments[0]);
+			}else{
+				var n=arguments[0];
+				var cost=arguments[1]||0;
+				this.neighbors.add(new edgeToNeighbor(n, cost));
+			}
+		}
+	}
+	function nodeList(){
+		var d=new dojo.collections.Dictionary();
+		function nodelistiterator(){
+			var o=[] ;	//	Create an indexing array
+			var e=d.getIterator();
+			while(e.get()){
+				o[o.length]=e.element;
+			}
+
+			var position=0;
+			this.element=o[position]||null;
+			this.atEnd=function(){
+				return (position>=o.length);
+			}
+			this.get=function(){
+				if(this.atEnd()){
+					return null;		//	object
+				}
+				this.element=o[position++];
+				return this.element;	//	object
+			};
+			this.map=function(/* function */fn, /* object? */scope){
+				var s=scope||dj_global;
+				if(Array.map){
+					return Array.map(o,fn,s);	//	array
+				}else{
+					var arr=[];
+					for(var i=0; i<o.length; i++){
+						arr.push(fn.call(s,o[i]));
+					}
+					return arr;		//	array
+				}
+			};
+			this.reset=function(){
+				position=0;
+				this.element=o[position];
+			};
+		}
+		
+		this.add=function(node){
+			d.add(node.key, node);
+		};
+		this.clear=function(){
+			d.clear();
+		};
+		this.containsKey=function(key){
+			return d.containsKey(key);
+		};
+		this.getIterator=function(){
+			return new nodelistiterator(this);
+		};
+		this.item=function(key){
+			return d.item(key);
+		};
+		this.remove=function(node){
+			d.remove(node.key);
+		};
+	}
+	function edgeToNeighbor(node, cost){
+		this.neighbor=node;
+		this.cost=cost;
+	}
+	function adjacencyList(){
+		var d=[];
+		this.add=function(o){
+			d.push(o);
+		};
+		this.item=function(i){
+			return d[i];
+		};
+		this.getIterator=function(){
+			return new dojo.collections.Iterator([].concat(d));
+		};
+	}
+
+	this.nodes=nodes||new nodeList();
+	this.count=this.nodes.count;
+	this.clear=function(){
+		this.nodes.clear();
+		this.count=0;
+	};
+	this.addNode=function(){
+		var n=arguments[0];
+		if(arguments.length > 1){
+			n=new node(arguments[0],arguments[1]);
+		}
+		if(!this.nodes.containsKey(n.key)){
+			this.nodes.add(n);
+			this.count++;
+		}
+	};
+	this.addDirectedEdge=function(uKey, vKey, cost){
+		var uNode,vNode;
+		if(uKey.constructor!= node){
+			uNode=this.nodes.item(uKey);
+			vNode=this.nodes.item(vKey);
+		}else{
+			uNode=uKey;
+			vNode=vKey;
+		}
+		var c=cost||0;
+		uNode.addDirected(vNode,c);
+	};
+	this.addUndirectedEdge=function(uKey, vKey, cost){
+		var uNode, vNode;
+		if(uKey.constructor!=node){
+			uNode=this.nodes.item(uKey);
+			vNode=this.nodes.item(vKey);
+		}else{
+			uNode=uKey;
+			vNode=vKey;
+		}
+		var c=cost||0;
+		uNode.addDirected(vNode,c);
+		vNode.addDirected(uNode,c);
+	};
+	this.contains=function(n){
+		return this.nodes.containsKey(n.key);
+	};
+	this.containsKey=function(k){
+		return this.nodes.containsKey(k);
+	};
+}

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Queue.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Queue.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Queue.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Queue.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,87 @@
+/*
+	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.collections.Queue");
+dojo.require("dojo.collections.Collections");
+
+dojo.collections.Queue=function(/* array? */arr){
+	//	summary
+	//	return an object of type dojo.collections.Queue
+	var q=[];
+	if (arr){
+		q=q.concat(arr);
+	}
+	this.count=q.length;
+	this.clear=function(){
+		//	summary
+		//	clears the internal collection
+		q=[];
+		this.count=q.length;
+	};
+	this.clone=function(){
+		//	summary
+		//	creates a new Queue based on this one
+		return new dojo.collections.Queue(q);	//	dojo.collections.Queue
+	};
+	this.contains=function(/* object */ o){
+		//	summary
+		//	Check to see if the passed object is an element in this queue
+		for(var i=0; i<q.length; i++){
+			if (q[i]==o){
+				return true;	//	bool
+			}
+		}
+		return false;	//	bool
+	};
+	this.copyTo=function(/* array */ arr, /* int */ i){
+		//	summary
+		//	Copy the contents of this queue into the passed array at index i.
+		arr.splice(i,0,q);
+	};
+	this.dequeue=function(){
+		//	summary
+		//	shift the first element off the queue and return it
+		var r=q.shift();
+		this.count=q.length;
+		return r;	//	object
+	};
+	this.enqueue=function(/* object */ o){
+		//	summary
+		//	put the passed object at the end of the queue
+		this.count=q.push(o);
+	};
+	this.forEach=function(/* function */ fn, /* object? */ scope){
+		//	summary
+		//	functional iterator, following the mozilla spec.
+		var s=scope||dj_global;
+		if(Array.forEach){
+			Array.forEach(q, fn, s);
+		}else{
+			for(var i=0; i<q.length; i++){
+				fn.call(s, q[i], i, q);
+			}
+		}
+	};
+	this.getIterator=function(){
+		//	summary
+		//	get an Iterator based on this queue.
+		return new dojo.collections.Iterator(q);	//	dojo.collections.Iterator
+	};
+	this.peek=function(){
+		//	summary
+		//	get the next element in the queue without altering the queue.
+		return q[0];
+	};
+	this.toArray=function(){
+		//	summary
+		//	return an array based on the internal array of the queue.
+		return [].concat(q);
+	};
+};

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Set.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Set.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Set.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/collections/Set.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,84 @@
+/*
+	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.collections.Set");
+dojo.require("dojo.collections.Collections");
+dojo.require("dojo.collections.ArrayList");
+
+//	straight up sets are based on arrays or array-based collections.
+dojo.collections.Set = new function(){
+	this.union = function(setA, setB){
+		if (setA.constructor == Array) var setA = new dojo.collections.ArrayList(setA);
+		if (setB.constructor == Array) var setB = new dojo.collections.ArrayList(setB);
+		if (!setA.toArray || !setB.toArray) dojo.raise("Set operations can only be performed on array-based collections.");
+		var result = new dojo.collections.ArrayList(setA.toArray());
+		var e = setB.getIterator();
+		while(!e.atEnd()){
+			var item=e.get();
+			if(!result.contains(item)){
+				result.add(item);
+			}
+		}
+		return result;
+	};
+	this.intersection = function(setA, setB){
+		if (setA.constructor == Array) var setA = new dojo.collections.ArrayList(setA);
+		if (setB.constructor == Array) var setB = new dojo.collections.ArrayList(setB);
+		if (!setA.toArray || !setB.toArray) dojo.raise("Set operations can only be performed on array-based collections.");
+		var result = new dojo.collections.ArrayList();
+		var e = setB.getIterator();
+		while(!e.atEnd()){
+			var item=e.get();
+			if(setA.contains(item)){
+				result.add(item);
+			}
+		}
+		return result;
+	};
+	//	returns everything in setA that is not in setB.
+	this.difference = function(setA, setB){
+		if (setA.constructor == Array) var setA = new dojo.collections.ArrayList(setA);
+		if (setB.constructor == Array) var setB = new dojo.collections.ArrayList(setB);
+		if (!setA.toArray || !setB.toArray) dojo.raise("Set operations can only be performed on array-based collections.");
+		var result = new dojo.collections.ArrayList();
+		var e=setA.getIterator();
+		while(!e.atEnd()){
+			var item=e.get();
+			if(!setB.contains(item)){
+				result.add(item);
+			}
+		}
+		return result;
+	};
+	this.isSubSet = function(setA, setB) {
+		if (setA.constructor == Array) var setA = new dojo.collections.ArrayList(setA);
+		if (setB.constructor == Array) var setB = new dojo.collections.ArrayList(setB);
+		if (!setA.toArray || !setB.toArray) dojo.raise("Set operations can only be performed on array-based collections.");
+		var e = setA.getIterator();
+		while(!e.atEnd()){
+			if(!setB.contains(e.get())){
+				return false;
+			}
+		}
+		return true;
+	};
+	this.isSuperSet = function(setA, setB){
+		if (setA.constructor == Array) var setA = new dojo.collections.ArrayList(setA);
+		if (setB.constructor == Array) var setB = new dojo.collections.ArrayList(setB);
+		if (!setA.toArray || !setB.toArray) dojo.raise("Set operations can only be performed on array-based collections.");
+		var e = setB.getIterator();
+		while(!e.atEnd()){
+			if(!setA.contains(e.get())){
+				return false;
+			}
+		}
+		return true;
+	};
+}();



Mime
View raw message