incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r428226 - /incubator/xap/trunk/src/xap/Xap.js
Date Thu, 03 Aug 2006 04:09:41 GMT
Author: mturyn
Date: Wed Aug  2 21:09:40 2006
New Revision: 428226

URL: http://svn.apache.org/viewvc?rev=428226&view=rev
Log:
New class set-up routines had mistakenly been pruned off; restored.

Modified:
    incubator/xap/trunk/src/xap/Xap.js

Modified: incubator/xap/trunk/src/xap/Xap.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/Xap.js?rev=428226&r1=428225&r2=428226&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/Xap.js (original)
+++ incubator/xap/trunk/src/xap/Xap.js Wed Aug  2 21:09:40 2006
@@ -441,3 +441,31 @@
 
 }
 
+Xap.resolveConstructor = function(aString){
+	var scoper = dj_global ;
+	var arr  = aString.split(".") ;
+	for( var kk=0; kk< arr.length - 1; ++kk ){
+		scoper = scoper[arr[kk]] ;
+	}
+	return  scoper[arr[arr.length-1]] ;
+}
+
+
+/**
+ * Handles common class set-up routines, assumes constructors for subclass and superclass
already exist:
+**/ 
+Xap.setupClassAsSubclassOf = function(subclassName,superclassName,sub,sup){
+	var subclassConstructor = Xap.resolveConstructor( subclassName ) ;
+	var superclassConstructor = Xap.resolveConstructor( superclassName ) ;	
+	
+	if(superclassName){
+		Xap.require(superclassName) ;
+	}
+	dojo.inherits(subclassConstructor, superclassConstructor) ;
+	subclassConstructor.prototype.toString = function(){
+		return subclassName ;	
+	}
+	subclassConstructor.prototype.superclass = 	superclassConstructor.prototype ;
+	subclassConstructor.s_log = xap.util.LogFactory.getLog( subclassName ) ;
+}
+



Mime
View raw message