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:44:50 UTC
svn commit: r470202 - in /incubator/xap/trunk/src/xap:
bridges/dojo/GridPanelBridge.js taghandling/plugin.xml
Author: jmargaris
Date: Wed Nov 1 18:44:49 2006
New Revision: 470202
URL: http://svn.apache.org/viewvc?view=rev&rev=470202
Log:
added gridPanel and samples
Added:
incubator/xap/trunk/src/xap/bridges/dojo/GridPanelBridge.js (with props)
Modified:
incubator/xap/trunk/src/xap/taghandling/plugin.xml
Added: incubator/xap/trunk/src/xap/bridges/dojo/GridPanelBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/GridPanelBridge.js?view=auto&rev=470202
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/GridPanelBridge.js (added)
+++ incubator/xap/trunk/src/xap/bridges/dojo/GridPanelBridge.js Wed Nov 1 18:44:49 2006
@@ -0,0 +1,114 @@
+/*
+ * 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 GridPanel peer.
+ */
+
+
+
+Xap.provide("xap.bridges.dojo.GridPanelBridge");
+
+Xap.require("xap.bridges.dojo.DojoWidgetBridge");
+Xap.require("xap.widgets.dojo.GridPanel");
+
+
+ /**
+ * @fileoverview
+ *
+ * A bridge class with dojo toolkit box panel peer.
+ */
+
+xap.bridges.dojo.GridPanelBridge= function() {
+ xap.bridges.dojo.DojoWidgetBridge.call(this);
+}
+
+
+Xap.setupClassAsSubclassOf(
+ "xap.bridges.dojo.GridPanelBridge",
+ "xap.bridges.dojo.DojoWidgetBridge"
+);
+
+
+
+xap.bridges.dojo.GridPanelBridge.prototype.getPeerString = function(){
+ return "GridPanel" ;
+}
+
+
+xap.bridges.dojo.GridPanelBridge.prototype.addChild = function( childHandler ){
+ var constraints = {
+ _columnSpan:1,
+ _rowSpan:1,
+ _vAlign:'center',
+ _hAlign:'center',
+ _vGrabSpace:false,
+ _hGrabSpace:false
+ };
+
+ var element = childHandler.getElement();
+ var columnSpan= element.getAttribute("columnSpan");
+ if (columnSpan){
+ constraints._columnSpan = parseInt(columnSpan);
+ }
+
+ var rowSpan = element.getAttribute("rowSpan");
+ if (rowSpan){
+ constraints._rowSpan = parseInt(rowSpan);
+ }
+
+ var hAlign = element.getAttribute("hAlign");
+ if (hAlign){
+ constraints._hAlign = hAlign;
+ }
+
+ var vAlign = element.getAttribute("vAlign");
+ if (vAlign){
+ constraints._vAlign = vAlign;
+ }
+
+ var childPeer = this.getDojoWidgetPeer(childHandler);
+ if (childPeer){
+ this.getPeer().addChild(childPeer,constraints);
+ }
+}
+
+/**
+ *
+ *
+ * Attribute definitions
+ *
+ */
+
+
+xap.bridges.dojo.GridPanelBridge.prototype.getNewAllowedAttributes = function(){
+ return ["columns","evenlySpace"];
+}
+
+xap.bridges.dojo.GridPanelBridge.prototype.setColumnsAttribute = function(value){
+ this.getPeer().setColumns(parseInt(value));
+}
+
+xap.bridges.dojo.GridPanelBridge.prototype.setEvenlySpaceAttribute = function(value){
+ //TODO
+}
+
+
+
+
Propchange: incubator/xap/trunk/src/xap/bridges/dojo/GridPanelBridge.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?view=diff&rev=470202&r1=470201&r2=470202
==============================================================================
--- incubator/xap/trunk/src/xap/taghandling/plugin.xml (original)
+++ incubator/xap/trunk/src/xap/taghandling/plugin.xml Wed Nov 1 18:44:49 2006
@@ -67,6 +67,8 @@
<mapping class="xap.bridges.dojo.SecondSplitChildBridge" name="right"/>
<mapping class="xap.bridges.dojo.ScrollPaneBridge" name="scrollPane"/>
+ <mapping class="xap.bridges.dojo.DesktopPaneBridge" name="desktopPane"/>
+ <mapping class="xap.bridges.dojo.DesktopPaneBridge" name="rootPane"/>
<mapping class="xap.bridges.dojo.TableBridge" name="table"/>
<mapping class="xap.bridges.dojo.TabPaneBridge" name="tabPane"/>
@@ -92,6 +94,7 @@
<mapping class="xap.bridges.dojo.WindowBridge" name="window"/>
<mapping class="xap.bridges.dojo.HorizontalFlowPaneBridge" name="horizontalFlowPane"/>
+ <mapping class="xap.bridges.dojo.GridPanelBridge" name="gridPanel"/>