You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2006/08/02 21:57:12 UTC

svn commit: r428166 - in /incubator/xap/trunk/src/xap/bridges: basic/DatePickerBridge.js basic/DomNodeBridge.js dojo/DojoWidgetBridge.js

Author: mturyn
Date: Wed Aug  2 14:57:11 2006
New Revision: 428166

URL: http://svn.apache.org/viewvc?rev=428166&view=rev
Log:
Replaced boilerplate setup lines with a single function call wrappering and extending dojo.inherits().

Modified:
    incubator/xap/trunk/src/xap/bridges/basic/DatePickerBridge.js
    incubator/xap/trunk/src/xap/bridges/basic/DomNodeBridge.js
    incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js

Modified: incubator/xap/trunk/src/xap/bridges/basic/DatePickerBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/basic/DatePickerBridge.js?rev=428166&r1=428165&r2=428166&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/basic/DatePickerBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/basic/DatePickerBridge.js Wed Aug  2 14:57:11 2006
@@ -40,13 +40,12 @@
 	xap.bridges.basic.AbstractBlackBoxWidgetBridge.call(this);
 };
 
+Xap.setupClassAsSubclassOf(
+	"xap.bridges.basic.DatePickerBridge",
+	"xap.bridges.basic.AbstractBlackBoxWidgetBridge"
+);
+
 
-xap.bridges.basic.DatePickerBridge.prototype = new xap.bridges.basic.AbstractBlackBoxWidgetBridge;
-xap.bridges.basic.DatePickerBridge.prototype.constructor = xap.bridges.basic.DatePickerBridge;
-xap.bridges.basic.DatePickerBridge.s_log = xap.util.LogFactory.getLog("xap.bridges.basic.DatePickerBridge");
-xap.bridges.basic.DatePickerBridge.prototype.toString = function () {
-	return "xap.bridges.basic.DatePickerBridge";
-};
 
 
 xap.bridges.basic.DatePickerBridge.prototype._peer = null ;
@@ -57,9 +56,9 @@
 
 // The superclass method is fine for this, almost as if it were originally here and had
 // been moved up there when refactoring.
-	originalDiv = this.getOriginalDomNode() ;
+	var originalDiv = this.getOriginalDomNode() ;
 
-	this._creationProperties.widgetContainerId =this._creationProperties.widgetId ;
+	//this._creationProperties.widgetContainerId =this._creationProperties.widgetId ;
 	
 	var peer = dojo.widget.createWidget("DatePicker", this._creationProperties,originalDiv);
 

Modified: incubator/xap/trunk/src/xap/bridges/basic/DomNodeBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/basic/DomNodeBridge.js?rev=428166&r1=428165&r2=428166&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/basic/DomNodeBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/basic/DomNodeBridge.js Wed Aug  2 14:57:11 2006
@@ -37,43 +37,16 @@
 	xap.taghandling.AbstractTagImpl.call( this );
 }
 
-xap.bridges.basic.DomNodeBridge.prototype = new xap.taghandling.AbstractTagImpl;
+Xap.setupClassAsSubclassOf(
+	"xap.bridges.basic.DomNodeBridge",
+	"xap.bridges.basic.AbstractBlackBoxWidgetBridge"
+);
 
-xap.bridges.basic.DomNodeBridge.s_log = xap.util.LogFactory.getLog( "xap.bridges.basic.DomNodeBridge" );
-
-xap.bridges.basic.DomNodeBridge.prototype.toString = function() {
-	return "xap.bridges.basic.DomNodeBridge";
-}
-
-/**
- * All bridges to DwtControls should go through these steps:
- * 
- * 1: Create the peer object
- * 2: Handle all the initial attributes
- * 3: Recursively parse the inititial children
- * 
- * It's not clear if we need zShow everwhere. (probably not)
- * Also the workflow here is a bit strange in that when you create
- * DwtControls you create them with a parent. Typically with most component
- * frameworks the parent is responsible for adding the child control
- * when the parent gets the onChildAdded() event. But with the Zimbra
- * hierarchy the child adds itself to the parent in it's createPeer(),
- * before onChildAdded() is ever called.
- * 
- * One effect of this is that instead of hooking up the hierarchy 
- * from tail to head we do it from head to tail.
- */
-xap.bridges.basic.DomNodeBridge.prototype.init = function() {
-	this.createPeer();
-	this.parseInitialAttributes( this.getElement() );
-	this.parseInitialChildren( this.getElement() );
-	xap.taghandling.AbstractTagImpl.prototype.init.call( this );
-}
 
 /**
  * Creates the peer component that this bridge controls.
  */
-xap.bridges.basic.DomNodeBridge.prototype.createPeer = function() {
+xap.bridges.basic.DomNodeBridge.prototype.obtainPeer = function() {
 	var parent = this.getElement().getParent();
 	var handler = this.getUiContentHandler().getHandlerForElement( parent );
 	var parentPeer = handler.getPeer();

Modified: incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js?rev=428166&r1=428165&r2=428166&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js Wed Aug  2 14:57:11 2006
@@ -42,16 +42,12 @@
 	xap.bridges.basic.AbstractBlackBoxWidgetBridge.call( this );
 }
 
-xap.bridges.dojo.DojoWidgetBridge.prototype = new xap.bridges.basic.AbstractBlackBoxWidgetBridge;
+Xap.setupClassAsSubclassOf(
+	"xap.bridges.dojo.DojoWidgetBridge",
+	"xap.bridges.basic.AbstractBlackBoxWidgetBridge"
+);
 
-xap.bridges.dojo.DojoWidgetBridge.prototype.constructor = xap.bridges.dojo.DojoWidgetBridge ;
 
-xap.bridges.dojo.DojoWidgetBridge.s_log = xap.util.LogFactory.getLog( "xap.bridges.dojo.DojoWidgetBridge" );
-
-
-xap.bridges.dojo.DojoWidgetBridge.prototype.toString = function() {
-	return "xap.bridges.dojo.DojoWidgetBridge";
-}
 
 
 /**