From xap-commits-return-422-apmail-incubator-xap-commits-archive=incubator.apache.org@incubator.apache.org Sun Sep 03 22:46:48 2006 Return-Path: Delivered-To: apmail-incubator-xap-commits-archive@locus.apache.org Received: (qmail 54351 invoked from network); 3 Sep 2006 22:46:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Sep 2006 22:46:48 -0000 Received: (qmail 47961 invoked by uid 500); 3 Sep 2006 22:46:48 -0000 Delivered-To: apmail-incubator-xap-commits-archive@incubator.apache.org Received: (qmail 47942 invoked by uid 500); 3 Sep 2006 22:46:48 -0000 Mailing-List: contact xap-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: xap-dev@incubator.apache.org Delivered-To: mailing list xap-commits@incubator.apache.org Received: (qmail 47933 invoked by uid 99); 3 Sep 2006 22:46:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Sep 2006 15:46:48 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Sep 2006 15:46:47 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 22D5E1A981A; Sun, 3 Sep 2006 15:46:27 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r439865 - in /incubator/xap/trunk/src/xap/widgets/dojo: ./ BorderPanel.js FreePanel.js HorizontalPanel.js PasswordField.js TextArea.js TextField.js VerticalPanel.js Date: Sun, 03 Sep 2006 22:46:26 -0000 To: xap-commits@incubator.apache.org From: jmargaris@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060903224627.22D5E1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jmargaris Date: Sun Sep 3 15:46:26 2006 New Revision: 439865 URL: http://svn.apache.org/viewvc?view=rev&rev=439865 Log: dojo widgets moved from components to widget folder Added: incubator/xap/trunk/src/xap/widgets/dojo/ incubator/xap/trunk/src/xap/widgets/dojo/BorderPanel.js (with props) incubator/xap/trunk/src/xap/widgets/dojo/FreePanel.js (with props) incubator/xap/trunk/src/xap/widgets/dojo/HorizontalPanel.js (with props) incubator/xap/trunk/src/xap/widgets/dojo/PasswordField.js (with props) incubator/xap/trunk/src/xap/widgets/dojo/TextArea.js (with props) incubator/xap/trunk/src/xap/widgets/dojo/TextField.js (with props) incubator/xap/trunk/src/xap/widgets/dojo/VerticalPanel.js (with props) Added: incubator/xap/trunk/src/xap/widgets/dojo/BorderPanel.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/BorderPanel.js?view=auto&rev=439865 ============================================================================== --- incubator/xap/trunk/src/xap/widgets/dojo/BorderPanel.js (added) +++ incubator/xap/trunk/src/xap/widgets/dojo/BorderPanel.js Sun Sep 3 15:46:26 2006 @@ -0,0 +1,97 @@ +//IMPORTANT move this to some shared area +dojo.widget.manager.registerWidgetPackage("xap.widgets.dojo"); + +Xap.provide("xap.widgets.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:BorderPanel"); + +xap.widgets.dojo.BorderPanel = function(){ + dojo.widget.HtmlWidget.call(this); +} + +dojo.inherits(xap.widgets.dojo.BorderPanel,dojo.widget.HtmlWidget); + +dojo.lang.extend(xap.widgets.dojo.BorderPanel, { + templateString: ''+ + '' + + ''+ + '' + + '
', + + templateCssPath: null , + widgetType: "BorderPanel", + isContainer: true, + + addChild: function(child, position){ + + var adjustWidth = false; + var adjustHeight = false; + if (position=="north"){ + this.containerNode = this.north; + adjustWidth = true; + } + else if (position=="south"){ + this.containerNode = this.south; + adjustWidth = true; + } + else if (position=="east"){ + this.containerNode = this.east; + adjustHeight = true; + } + else if (position=="west"){ + this.containerNode = this.west; + adjustHeight = true; + } + else{ + this.containerNode = this.center; + adjustWidth = true; + adjustHeight = true; + } + + //if we already have child nodes that's bad! + if (this.containerNode.childNodes.length!=0){ + return; + } + + + //IMPORTANT should we do this in a setTimeout() after + //we give the table a chance to layout first? probably + if (adjustWidth){ + child.domNode.style.width="100%"; + } + if (adjustHeight){ + child.domNode.style.height="100%"; + } + xap.widgets.dojo.BorderPanel.superclass.addChild.call(this,child); + }, + + removeChild: function(child) { + var containerNode = child.domNode.parentNode; + xap.widgets.dojo.BorderPanel.superclass.removeChild.call(this,child); + resetNode(containerNode); + }, + + resetNode : function(containerNode){ + var nodeStyle = containerNode.style; + if (containerNode==this.north || containerNode==this.south){ + nodeStyle.width=""; + nodeStyle.height="1px"; + } + else if (containerNode==this.east || containerNode==this.west){ + nodeStyle.width="1px"; + nodeStyle.height=""; + } + else{ + nodeStyle.width= "99%"; + nodeStyle.height = "99%"; + } + } +} +); \ No newline at end of file Propchange: incubator/xap/trunk/src/xap/widgets/dojo/BorderPanel.js ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/xap/trunk/src/xap/widgets/dojo/FreePanel.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/FreePanel.js?view=auto&rev=439865 ============================================================================== --- incubator/xap/trunk/src/xap/widgets/dojo/FreePanel.js (added) +++ incubator/xap/trunk/src/xap/widgets/dojo/FreePanel.js Sun Sep 3 15:46:26 2006 @@ -0,0 +1,38 @@ +//IMPORTANT move this to some shared area +dojo.widget.manager.registerWidgetPackage("xap.widgets.dojo"); + +Xap.provide("xap.widgets.dojo.FreePanel"); + +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:FreePanel"); + +xap.widgets.dojo.FreePanel = function(){ + dojo.widget.HtmlWidget.call(this); +} +dojo.inherits(xap.widgets.dojo.FreePanel, dojo.widget.HtmlWidget); + +dojo.lang.extend(xap.widgets.dojo.FreePanel, { + + //setting display:block on a div should work but doesn't. + //If you set absolute position on a div then it creates a block in the box + //model but then the div is absolute which we don't want. + //so we put stuff in a table which DOES define a block in the box model + templateString: '
', + templateCssPath: null , + widgetType: "FreePanel", + isContainer: true, + + addChild: function(child, overrideContainerNode, pos, ref, insertIndex){ + child.domNode.style.position = "absolute"; + xap.widgets.dojo.FreePanel.superclass.addChild.call(this,child, overrideContainerNode, pos, ref, insertIndex); + } +} +); + + Propchange: incubator/xap/trunk/src/xap/widgets/dojo/FreePanel.js ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/xap/trunk/src/xap/widgets/dojo/HorizontalPanel.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/HorizontalPanel.js?view=auto&rev=439865 ============================================================================== --- incubator/xap/trunk/src/xap/widgets/dojo/HorizontalPanel.js (added) +++ incubator/xap/trunk/src/xap/widgets/dojo/HorizontalPanel.js Sun Sep 3 15:46:26 2006 @@ -0,0 +1,88 @@ +//IMPORTANT move this to some shared area +dojo.widget.manager.registerWidgetPackage("xap.widgets.dojo"); + +Xap.provide("xap.widgets.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.widgets.dojo.HorizontalPanel = function(){ + dojo.widget.HtmlWidget.call(this); +} +dojo.inherits(xap.widgets.dojo.HorizontalPanel, dojo.widget.HtmlWidget); + +dojo.lang.extend(xap.widgets.dojo.HorizontalPanel, { + templateString: '' + +'
', + templateCssPath: null , + widgetType: "HorizontalPanel", + isContainer: true, + align : "start", + + addChild: function(child, overrideContainerNode, pos, ref, insertIndex){ + var row = this.endCell.parentNode; + var cell = document.createElement("td"); + + + if (this.align=="center"){ + cell.setAttribute("valign", "center"); + } + else if (this.align=="start"){ + cell.setAttribute("valign", "top"); + } + else if (this.align=="end"){ + cell.setAttribute("valign", "bottom"); + } + else if (this.align=="stretch"){ + child.domNode.style.height="100%"; + } + + //if we are inserting in the middle, insert before some row + //bumped up one to account for the start spacer row + if (insertIndex && insertIndex>=0 && insertIndex', + templateCssPath: null , + widgetType: "PasswordField", + isContainer: false, + + //hook for attach event + onblur: function(){ + }, + + setText: function( text ){ + this.domNode.value = text; + }, + + getText: function(){ + return this.domNode.value; + } +} +); \ No newline at end of file Propchange: incubator/xap/trunk/src/xap/widgets/dojo/PasswordField.js ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/xap/trunk/src/xap/widgets/dojo/TextArea.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/TextArea.js?view=auto&rev=439865 ============================================================================== --- incubator/xap/trunk/src/xap/widgets/dojo/TextArea.js (added) +++ incubator/xap/trunk/src/xap/widgets/dojo/TextArea.js Sun Sep 3 15:46:26 2006 @@ -0,0 +1,39 @@ +//IMPORTANT move this to some shared area +dojo.widget.manager.registerWidgetPackage("xap.widgets.dojo"); + +Xap.provide("xap.widgets.dojo.TextArea"); + +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:TextArea"); + +xap.widgets.dojo.TextArea = function(){ + dojo.widget.HtmlWidget.call(this); +} +dojo.inherits(xap.widgets.dojo.TextArea, dojo.widget.HtmlWidget); + +dojo.lang.extend(xap.widgets.dojo.TextArea, { + + templateString: '', + templateCssPath: null , + widgetType: "TextArea", + isContainer: false, + + //hook for attach event + onblur: function(){ + }, + + setText: function( text ){ + this.domNode.value = text; + }, + + getText: function(){ + return this.domNode.value; + } +} +); \ No newline at end of file Propchange: incubator/xap/trunk/src/xap/widgets/dojo/TextArea.js ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/xap/trunk/src/xap/widgets/dojo/TextField.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/TextField.js?view=auto&rev=439865 ============================================================================== --- incubator/xap/trunk/src/xap/widgets/dojo/TextField.js (added) +++ incubator/xap/trunk/src/xap/widgets/dojo/TextField.js Sun Sep 3 15:46:26 2006 @@ -0,0 +1,39 @@ +//IMPORTANT move this to some shared area +dojo.widget.manager.registerWidgetPackage("xap.widgets.dojo"); + +Xap.provide("xap.widgets.dojo.TextField"); + +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:TextField"); + +xap.widgets.dojo.TextField = function(){ + dojo.widget.HtmlWidget.call(this); +} +dojo.inherits(xap.widgets.dojo.TextField, dojo.widget.HtmlWidget); + +dojo.lang.extend(xap.widgets.dojo.TextField, { + + templateString: '', + templateCssPath: null , + widgetType: "TextField", + isContainer: false, + + //hook for attach event + onblur: function(){ + }, + + setText: function( text ){ + this.domNode.value = text; + }, + + getText: function(){ + return this.domNode.value; + } +} +); \ No newline at end of file Propchange: incubator/xap/trunk/src/xap/widgets/dojo/TextField.js ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/xap/trunk/src/xap/widgets/dojo/VerticalPanel.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/VerticalPanel.js?view=auto&rev=439865 ============================================================================== --- incubator/xap/trunk/src/xap/widgets/dojo/VerticalPanel.js (added) +++ incubator/xap/trunk/src/xap/widgets/dojo/VerticalPanel.js Sun Sep 3 15:46:26 2006 @@ -0,0 +1,97 @@ +//IMPORTANT move this to some shared area +dojo.widget.manager.registerWidgetPackage("xap.widgets.dojo"); + +Xap.provide("xap.widgets.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.widgets.dojo.VerticalPanel = function(){ + dojo.widget.HtmlWidget.call(this); +} +dojo.inherits(xap.widgets.dojo.VerticalPanel, dojo.widget.HtmlWidget); + +dojo.lang.extend(xap.widgets.dojo.VerticalPanel, { + templateString: '' + + '' + +'
', + templateCssPath: null , + widgetType: "VerticalPanel", + isContainer: true, + align: "center", //start, center, end, stretch + + addChild: function(child, overrideContainerNode, pos, ref, insertIndex){ + //TODO if they have something like height=50% + //we should set that on the table cell? + var row = document.createElement("tr"); + var cell = document.createElement("td"); + if (this.align=="center"){ + cell.setAttribute("align", "center"); + } + else if (this.align=="start"){ + cell.setAttribute("align", "left"); + } + else if (this.align=="end"){ + cell.setAttribute("align", "right"); + } + + //if they set the width again after this it won't really work + //TODO this can happen now when they have width=x because + //of the order of operations we add the child to the parent + //BEFORE we go through the initial attributes + else if (this.align=="stretch"){ + child.domNode.style.width="100%"; + } + row.appendChild(cell); + + var tBody = this.tbody; + + //if we are inserting in the middle, insert before some row + //bumped up one to account for the start spacer row + if (insertIndex && insertIndex>=0 && insertIndex