incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmarga...@apache.org
Subject svn commit: r515389 - in /incubator/xap/trunk/codebase/src/xap: bridges/basic/AbstractWidgetBridge.js bridges/dojo/HorizontalSeparatorBridge.js data/DataFramework.js data/controller/Binding.js data/controller/BindingResolver.js
Date Wed, 07 Mar 2007 00:21:16 GMT
Author: jmargaris
Date: Tue Mar  6 16:21:15 2007
New Revision: 515389

URL: http://svn.apache.org/viewvc?view=rev&rev=515389
Log:
cleanup suggested by Michael M

Modified:
    incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js
    incubator/xap/trunk/codebase/src/xap/bridges/dojo/HorizontalSeparatorBridge.js
    incubator/xap/trunk/codebase/src/xap/data/DataFramework.js
    incubator/xap/trunk/codebase/src/xap/data/controller/Binding.js
    incubator/xap/trunk/codebase/src/xap/data/controller/BindingResolver.js

Modified: incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js?view=diff&rev=515389&r1=515388&r2=515389
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js (original)
+++ incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js Tue Mar  6
16:21:15 2007
@@ -691,11 +691,12 @@
 	}
 }
 
-xap.bridges.basic.AbstractWidgetBridge.prototype.setPopupAttribute = function(popupId){
+xap.bridges.basic.AbstractWidgetBridge.prototype.setPopupAttribute = function(popupId) {
+	
+	// prevents circular dependency on PopupMenuBridge from breaking the build
+	var require = "xap.bridges.dojo.PopupMenuBridge";
+	Xap.require(require); 
 	
-	Xap.require("xap.bridges.dojo.PopupMenuBridge"); //needed for popup attribute
-	//safer to do it here than at file top, that caused problems for some reason,
-	//includes in popupMenuBridge most likely
 	
 	//TODO fire onContextMenu event and let them consume it?
 	//TODO if they have OLD popup need to unregister it!!!
@@ -705,8 +706,10 @@
 		return;
 	}
 	var handler = this.getUiContentHandler().getHandlerForElement(popupElement);
-	if (handler && handler instanceof xap.bridges.dojo.PopupMenuBridge){
-		handler.bindDomNode(this.getRootDomNode());
+	if (handler && xap.bridges.dojo.PopupMenuBridge) {
+		if(handler instanceof xap.bridges.dojo.PopupMenuBridge)  {
+			handler.bindDomNode(this.getRootDomNode());
+		}
 	}
 }
 

Modified: incubator/xap/trunk/codebase/src/xap/bridges/dojo/HorizontalSeparatorBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/bridges/dojo/HorizontalSeparatorBridge.js?view=diff&rev=515389&r1=515388&r2=515389
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/bridges/dojo/HorizontalSeparatorBridge.js (original)
+++ incubator/xap/trunk/codebase/src/xap/bridges/dojo/HorizontalSeparatorBridge.js Tue Mar
 6 16:21:15 2007
@@ -25,7 +25,7 @@
 
 Xap.provide("xap.bridges.dojo.HorizontalSeparatorBridge"); 
 
-Xap.require("dojo.widget.MenuBar2");
+Xap.require("dojo.widget.Menu2");
 Xap.require("xap.session.ClientEvent"); 
 Xap.require("xap.bridges.dojo.DojoWidgetBridge"); 
 

Modified: incubator/xap/trunk/codebase/src/xap/data/DataFramework.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/data/DataFramework.js?view=diff&rev=515389&r1=515388&r2=515389
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/data/DataFramework.js (original)
+++ incubator/xap/trunk/codebase/src/xap/data/DataFramework.js Tue Mar  6 16:21:15 2007
@@ -20,6 +20,7 @@
 Xap.provide("xap.data.DataFramework");
 
 Xap.require("xap.data.controller.Binding") ;
+Xap.require("xap.data.controller.BindingResolver") ;
 Xap.require("xap.session.Container") ;
 Xap.require("xap.data.controller.BindingType") ;
 Xap.require("xap.resolver.ResolutionInfo");
@@ -175,6 +176,7 @@
 	/* Binding */
 	var binding = xap.data.controller.Binding.createIteratorBinding(
 								this._bindingResolver.getContextStack(),
+								this.getDataSourceContainer(),
 								select,
 								bindString,
 								this._session, 
@@ -188,7 +190,7 @@
 
 xap.data.DataFramework.prototype.bind = function( stringOrBinding){
 	if ( typeof stringOrBinding == "string"){
-		var binding =  this._bindingResolver.createBindingFromParameterString(stringOrBinding);
+		var binding =  this._bindingResolver.createBindingFromParameterString(stringOrBinding,
this.getDataSourceContainer(), this.getFormatterContainer());
 		return this.bindBinding(binding);	
 	}
 	else{

Modified: incubator/xap/trunk/codebase/src/xap/data/controller/Binding.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/data/controller/Binding.js?view=diff&rev=515389&r1=515388&r2=515389
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/data/controller/Binding.js (original)
+++ incubator/xap/trunk/codebase/src/xap/data/controller/Binding.js Tue Mar  6 16:21:15 2007
@@ -20,7 +20,6 @@
 Xap.provide("xap.data.controller.Binding");
 
 Xap.require("xap.util.TypeUtils");
-Xap.require("xap.data.DataFramework");
 Xap.require("xap.data.controller.BindingType");
 Xap.require("xap.data.controller.AttributeValueLocation");
 Xap.require("xap.util.ArrayHelper");
@@ -54,14 +53,18 @@
 	return binding;	
 }
 
+
+/**
+ *
+ **/
 xap.data.controller.Binding.createIteratorBinding = 
-		function(contextStack, select, name, session, bindingType, defaultValue){
+		function(contextStack, dataSourceContainer, select, name, session, bindingType, defaultValue)
{
 	var binding = new xap.data.controller.Binding();	
 	binding._select = select;
 	binding._session = session;
 	binding._bindingType = bindingType;
 	if (name && name.length > 0) {
-		binding._source = xap.data.DataFramework.getDataService(session).getDataSourceContainer().get(name);
+		binding._source = dataSourceContainer.get(name);
 		if (!binding._source) {
 			// Find the ancestor iterator context with the
 			// specified name, since there was not data source with

Modified: incubator/xap/trunk/codebase/src/xap/data/controller/BindingResolver.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/data/controller/BindingResolver.js?view=diff&rev=515389&r1=515388&r2=515389
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/data/controller/BindingResolver.js (original)
+++ incubator/xap/trunk/codebase/src/xap/data/controller/BindingResolver.js Tue Mar  6 16:21:15
2007
@@ -18,11 +18,13 @@
  */
 
 Xap.provide("xap.data.controller.BindingResolver");
+
 Xap.require("xap.session.ClientSession");
-Xap.require("xap.data.DataFramework");
 Xap.require("xap.data.bridge.XmlDataTokens");
 Xap.require("xap.util.EscapeSyntaxParser") ;
 Xap.require("xap.data.controller.ContextStack") ;
+Xap.require("xap.data.controller.Binding") ;
+
 /**
  * The binding resolver contains helper methods which allow creation
  * of binding objects from binding declarations. This class also maintains
@@ -91,13 +93,14 @@
  * @return {Binding}
  * @throws EscapeSyntaxException, DataControllerException 
 **/
-xap.data.controller.BindingResolver.prototype.createBindingFromParameterString = function
(value) {
-	/*DataService*/
-	var dataService = xap.data.DataFramework.getDataService(this._session);
+xap.data.controller.BindingResolver.prototype.createBindingFromParameterString = function
(value, dataSourceContainer, formatterContainer) {
+
 	/*Formatter*/
 	var formatter = null;
+
 	/*BindingType*/
 	var bindType = xap.data.controller.BindingType.ONE_TIME;
+
 	/*String*/
 	var select = null;
 
@@ -154,7 +157,7 @@
 				}
 				if (xap.data.bridge.XmlDataTokens.FORMATTER == parameterName ) {
 					if (parameterValue != null) {
-						formatter = dataService.getFormatterContainer().get(parameterValue);
+						formatter = formatterContainer.get(parameterValue);
 					}
 				} else {
 					if (xap.data.bridge.XmlDataTokens.BINDING_TYPE == parameterName ) {
@@ -202,7 +205,7 @@
 		curToken += curChar ;
 	}
 	/*Binding*/
-	var binding = xap.data.controller.Binding.createIteratorBinding(this.getContextStack(),
select, dataSource, this._session, bindType, defaultValue);
+	var binding = xap.data.controller.Binding.createIteratorBinding(this.getContextStack(),
dataSourceContainer, select, dataSource, this._session, bindType, defaultValue);
 	if (formatter != null) {
 		binding.setFormatter(formatter);
 	}



Mime
View raw message