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/08/30 02:41:49 UTC
svn commit: r438324 - in /incubator/xap/trunk/src/xap:
bridges/dojo/HorizontalPanelBridge.js bridges/dojo/VerticalPanelBridge.js
components/dojo/FreePanel.js components/dojo/HorizontalPanel.js
components/dojo/VerticalPanel.js taghandling/plugin.xml
Author: jmargaris
Date: Tue Aug 29 19:41:49 2006
New Revision: 438324
URL: http://svn.apache.org/viewvc?rev=438324&view=rev
Log:
added vertical and horizontal panel
Added:
incubator/xap/trunk/src/xap/bridges/dojo/HorizontalPanelBridge.js (with props)
incubator/xap/trunk/src/xap/bridges/dojo/VerticalPanelBridge.js (with props)
incubator/xap/trunk/src/xap/components/dojo/HorizontalPanel.js (with props)
incubator/xap/trunk/src/xap/components/dojo/VerticalPanel.js (with props)
Modified:
incubator/xap/trunk/src/xap/components/dojo/FreePanel.js
incubator/xap/trunk/src/xap/taghandling/plugin.xml
Added: incubator/xap/trunk/src/xap/bridges/dojo/HorizontalPanelBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/HorizontalPanelBridge.js?rev=438324&view=auto
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/HorizontalPanelBridge.js (added)
+++ incubator/xap/trunk/src/xap/bridges/dojo/HorizontalPanelBridge.js Tue Aug 29 19:41:49 2006
@@ -0,0 +1,84 @@
+/*
+ * 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.HorizontalPanelBridge");
+
+Xap.require("xap.bridges.dojo.DojoWidgetBridge");
+Xap.require("xap.components.dojo.HorizontalPanel");
+
+
+
+ /**
+ * @fileoverview
+ *
+ * A bridge class with dojo toolkit box panel peer.
+ */
+
+xap.bridges.dojo.HorizontalPanelBridge= function() {
+ xap.bridges.dojo.DojoWidgetBridge.call(this);
+}
+
+
+Xap.setupClassAsSubclassOf(
+ "xap.bridges.dojo.HorizontalPanelBridge",
+ "xap.bridges.dojo.DojoWidgetBridge"
+);
+
+
+
+xap.bridges.dojo.HorizontalPanelBridge.prototype.getPeerString = function(){
+ return "HorizontalPanel" ;
+}
+
+
+/** XML attribute set method for "width" */
+xap.bridges.dojo.HorizontalPanelBridge.prototype.setWidthAttribute = function(value){
+ this.getRootDomNode().style.width = value ;
+ this.getPeer().onResized();
+}
+
+/** XML attribute set method for "height" */
+xap.bridges.dojo.HorizontalPanelBridge.prototype.setHeightAttribute = function(value){
+ this.getRootDomNode().style.height = value ;
+ this.getPeer().onResized();
+}
+
+
+
+
+/**
+ *
+ *
+ * Attribute definitions
+ *
+ */
+
+
+/**
+ * No new dynamic attributes
+ */
+xap.bridges.dojo.HorizontalPanelBridge.prototype.getNewAllowedAttributes = function(){
+ return [];
+}
+
+
Propchange: incubator/xap/trunk/src/xap/bridges/dojo/HorizontalPanelBridge.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/xap/trunk/src/xap/bridges/dojo/VerticalPanelBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/VerticalPanelBridge.js?rev=438324&view=auto
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/VerticalPanelBridge.js (added)
+++ incubator/xap/trunk/src/xap/bridges/dojo/VerticalPanelBridge.js Tue Aug 29 19:41:49 2006
@@ -0,0 +1,84 @@
+/*
+ * 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.VerticalPanelBridge");
+
+Xap.require("xap.bridges.dojo.DojoWidgetBridge");
+Xap.require("xap.components.dojo.VerticalPanel");
+
+
+
+ /**
+ * @fileoverview
+ *
+ * A bridge class with dojo toolkit box panel peer.
+ */
+
+xap.bridges.dojo.VerticalPanelBridge= function() {
+ xap.bridges.dojo.DojoWidgetBridge.call(this);
+}
+
+
+Xap.setupClassAsSubclassOf(
+ "xap.bridges.dojo.VerticalPanelBridge",
+ "xap.bridges.dojo.DojoWidgetBridge"
+);
+
+
+
+xap.bridges.dojo.VerticalPanelBridge.prototype.getPeerString = function(){
+ return "VerticalPanel" ;
+}
+
+
+/** XML attribute set method for "width" */
+xap.bridges.dojo.VerticalPanelBridge.prototype.setWidthAttribute = function(value){
+ this.getRootDomNode().style.width = value ;
+ this.getPeer().onResized();
+}
+
+/** XML attribute set method for "height" */
+xap.bridges.dojo.VerticalPanelBridge.prototype.setHeightAttribute = function(value){
+ this.getRootDomNode().style.height = value ;
+ this.getPeer().onResized();
+}
+
+
+
+
+/**
+ *
+ *
+ * Attribute definitions
+ *
+ */
+
+
+/**
+ * No new dynamic attributes
+ */
+xap.bridges.dojo.VerticalPanelBridge.prototype.getNewAllowedAttributes = function(){
+ return [];
+}
+
+
Propchange: incubator/xap/trunk/src/xap/bridges/dojo/VerticalPanelBridge.js
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/xap/trunk/src/xap/components/dojo/FreePanel.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/components/dojo/FreePanel.js?rev=438324&r1=438323&r2=438324&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/components/dojo/FreePanel.js (original)
+++ incubator/xap/trunk/src/xap/components/dojo/FreePanel.js Tue Aug 29 19:41:49 2006
@@ -1,3 +1,4 @@
+//IMPORTANT move this to some shared area
dojo.widget.manager.registerWidgetPackage("xap.components.dojo");
Xap.provide("xap.components.dojo.FreePanel");
@@ -29,7 +30,7 @@
addChild: function(child, overrideContainerNode, pos, ref, insertIndex){
child.domNode.style.position = "absolute";
- dojo.widget.html.TabContainer.superclass.addChild.call(this,child, overrideContainerNode, pos, ref, insertIndex);
+ xap.components.dojo.FreePanel.superclass.addChild.call(this,child, overrideContainerNode, pos, ref, insertIndex);
}
}
);
Added: incubator/xap/trunk/src/xap/components/dojo/HorizontalPanel.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/components/dojo/HorizontalPanel.js?rev=438324&view=auto
==============================================================================
--- incubator/xap/trunk/src/xap/components/dojo/HorizontalPanel.js (added)
+++ incubator/xap/trunk/src/xap/components/dojo/HorizontalPanel.js Tue Aug 29 19:41:49 2006
@@ -0,0 +1,45 @@
+//IMPORTANT move this to some shared area
+dojo.widget.manager.registerWidgetPackage("xap.components.dojo");
+
+Xap.provide("xap.components.dojo.HorizontalPanel");
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.dom");
+dojo.require("dojo.html");
+dojo.require("dojo.style");
+dojo.require("dojo.event");
+
+dojo.widget.tags.addParseTreeHandler("dojo:HorizontalPanel");
+
+xap.components.dojo.HorizontalPanel = function(){
+ dojo.widget.HtmlWidget.call(this);
+}
+dojo.inherits(xap.components.dojo.HorizontalPanel, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(xap.components.dojo.HorizontalPanel, {
+ templateString: '<table cellPadding="0" cellSpacing="0"><tbody><tr></tr></tbody></table>',
+ templateCssPath: null ,
+ widgetType: "HorizontalPanel",
+ isContainer: true,
+
+ addChild: function(child, overrideContainerNode, pos, ref, insertIndex){
+ var row = this.domNode.childNodes[0].childNodes[0];
+ var cell = document.createElement("td");
+ row.appendChild(cell);
+ this.containerNode = cell;
+ xap.components.dojo.HorizontalPanel.superclass.addChild.call(this,child, overrideContainerNode, pos, ref, insertIndex);
+ },
+
+ removeChild: function(child) {
+
+ //when we remove the child we also have to remove the entire
+ //cell it was in
+ var containerCell= child.domNode.parentNode;
+ xap.components.dojo.HorizontalPanel.superclass.removeChild.call(this,child);
+ containerCell.parentNode.removeChild(containerCell);
+ },
+}
+);
+
+
Propchange: incubator/xap/trunk/src/xap/components/dojo/HorizontalPanel.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/xap/trunk/src/xap/components/dojo/VerticalPanel.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/components/dojo/VerticalPanel.js?rev=438324&view=auto
==============================================================================
--- incubator/xap/trunk/src/xap/components/dojo/VerticalPanel.js (added)
+++ incubator/xap/trunk/src/xap/components/dojo/VerticalPanel.js Tue Aug 29 19:41:49 2006
@@ -0,0 +1,46 @@
+//IMPORTANT move this to some shared area
+dojo.widget.manager.registerWidgetPackage("xap.components.dojo");
+
+Xap.provide("xap.components.dojo.VerticalPanel");
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.dom");
+dojo.require("dojo.html");
+dojo.require("dojo.style");
+dojo.require("dojo.event");
+
+dojo.widget.tags.addParseTreeHandler("dojo:VerticalPanel");
+
+xap.components.dojo.VerticalPanel = function(){
+ dojo.widget.HtmlWidget.call(this);
+}
+dojo.inherits(xap.components.dojo.VerticalPanel, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(xap.components.dojo.VerticalPanel, {
+ templateString: '<table cellPadding="0" cellSpacing="0"><tbody></tbody></table>',
+ templateCssPath: null ,
+ widgetType: "VerticalPanel",
+ isContainer: true,
+
+ addChild: function(child, overrideContainerNode, pos, ref, insertIndex){
+ var row = document.createElement("tr");
+ var cell = document.createElement("td");
+ row.appendChild(cell);
+ this.domNode.childNodes[0].appendChild(row);
+ this.containerNode = cell;
+ xap.components.dojo.VerticalPanel.superclass.addChild.call(this,child, overrideContainerNode, pos, ref, insertIndex);
+ },
+
+ removeChild: function(child) {
+
+ //when we remove the child we also have to remove the entire
+ //row it was in
+ var containerRow = child.domNode.parentNode.parentNode;
+ xap.components.dojo.VerticalPanel.superclass.removeChild.call(this,child);
+ containerRow.parentNode.removeChild(containerRow);
+ },
+}
+);
+
+
Propchange: incubator/xap/trunk/src/xap/components/dojo/VerticalPanel.js
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/xap/trunk/src/xap/taghandling/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/taghandling/plugin.xml?rev=438324&r1=438323&r2=438324&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/taghandling/plugin.xml (original)
+++ incubator/xap/trunk/src/xap/taghandling/plugin.xml Tue Aug 29 19:41:49 2006
@@ -31,6 +31,8 @@
<mapping class="xap.bridges.dojo.TabPaneBridge" name="tabPane"/>
<mapping class="xap.bridges.dojo.TabBridge" name="tab"/>
<mapping class="xap.bridges.dojo.FreePanelBridge" name="freePanel"/>
+ <mapping class="xap.bridges.dojo.VerticalPanelBridge" name="verticalPanel"/>
+ <mapping class="xap.bridges.dojo.HorizontalPanelBridge" name="horizontalPanel"/>
<mapping class="xap.bridges.basic.DomNodeBridge" name="dom"/>
<mapping class="xap.bridges.dojo.DojoDatePickerBridge" name="datePicker"/>