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 jm...@apache.org on 2006/11/02 02:45:26 UTC

svn commit: r470203 - in /incubator/xap/trunk/src/xap: bridges/dojo/DesktopPaneBridge.js widgets/dojo/SoloPanel.js

Author: jmargaris
Date: Wed Nov  1 18:45:25 2006
New Revision: 470203

URL: http://svn.apache.org/viewvc?view=rev&rev=470203
Log:
added desktopPane/rootPane bridge and SoloPanel that takes
one child at 100% space

Added:
    incubator/xap/trunk/src/xap/bridges/dojo/DesktopPaneBridge.js   (with props)
Modified:
    incubator/xap/trunk/src/xap/widgets/dojo/SoloPanel.js

Added: incubator/xap/trunk/src/xap/bridges/dojo/DesktopPaneBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/DesktopPaneBridge.js?view=auto&rev=470203
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/DesktopPaneBridge.js (added)
+++ incubator/xap/trunk/src/xap/bridges/dojo/DesktopPaneBridge.js Wed Nov  1 18:45:25 2006
@@ -0,0 +1,76 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+ 
+ /**
+ * @fileoverview
+ * 
+ * A bridge class that controls a dojo TabContainer peer.
+ */
+
+Xap.provide("xap.bridges.dojo.DesktopPaneBridge"); 
+
+Xap.require("xap.bridges.dojo.DojoWidgetBridge");
+Xap.require("xap.widgets.dojo.SoloPanel"); 
+Xap.require('dojo.widget.FloatingPane');
+
+
+ 
+ /**
+ * @fileoverview
+ * 
+ * A bridge class with dojo toolkit box panel peer.
+ */
+ 
+xap.bridges.dojo.DesktopPaneBridge= function() {
+	xap.bridges.dojo.DojoWidgetBridge.call(this);
+}
+
+
+Xap.setupClassAsSubclassOf(
+				"xap.bridges.dojo.DesktopPaneBridge",
+				"xap.bridges.dojo.DojoWidgetBridge"						
+);
+
+
+
+xap.bridges.dojo.DesktopPaneBridge.prototype.getPeerString = function(){
+    return "SoloPanel" ;
+}
+
+ 
+/**
+ * 
+ * 
+ * Attribute definitions
+ * 
+ */ 
+ 
+ 
+/**
+ * No new dynamic attributes
+ */
+xap.bridges.dojo.DesktopPaneBridge.prototype.getNewAllowedAttributes = function(){
+	return [];
+}
+
+xap.bridges.dojo.DesktopPaneBridge.prototype.addChild = function(childHandler, index){
+	var childPeer = childHandler.getPeer();
+	if (childPeer instanceof dojo.widget.html.FloatingPane){
+		childPeer._isWindow = true;
+	}
+	this.superclass.addChild.call(this,childHandler,index);
+}
\ No newline at end of file

Propchange: incubator/xap/trunk/src/xap/bridges/dojo/DesktopPaneBridge.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/xap/trunk/src/xap/widgets/dojo/SoloPanel.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/SoloPanel.js?view=diff&rev=470203&r1=470202&r2=470203
==============================================================================
--- incubator/xap/trunk/src/xap/widgets/dojo/SoloPanel.js (original)
+++ incubator/xap/trunk/src/xap/widgets/dojo/SoloPanel.js Wed Nov  1 18:45:25 2006
@@ -15,8 +15,7 @@
  *
  */
  
- //IMPORTANT move this to some shared area
-dojo.widget.manager.registerWidgetPackage("xap.widgets.dojo");
+
 
 Xap.provide("xap.widgets.dojo.SoloPanel");
 
@@ -28,6 +27,8 @@
 dojo.require("dojo.event");
 Xap.require('xap.widgets.dojo.FreePanel');
 
+ //IMPORTANT move this to some shared area
+dojo.widget.manager.registerWidgetPackage("xap.widgets.dojo");
 dojo.widget.tags.addParseTreeHandler("dojo:SoloPanel");
 
 /**
@@ -44,9 +45,14 @@
 	widgetType: "SoloPanel",
 	
 	addChild: function(child, overrideContainerNode, pos, ref, insertIndex){
-		child.domNode.style.width = "100%";
-		child.domNode.style.height = "100%";
-		child.domNode.style.position = "absolute";
+		
+		//if the child is not a window size the child at 100%
+		//would this be better as another argument to addChild?
+		if (!child._isWindow){
+			child.domNode.style.position = "absolute";
+			child.domNode.style.position.height="100%";
+			child.domNode.style.position.width="100%";
+		}
 		xap.widgets.dojo.SoloPanel.superclass.addChild.call(this,child, overrideContainerNode, pos, ref, insertIndex);
 	}
 }