From xap-commits-return-205-apmail-incubator-xap-commits-archive=incubator.apache.org@incubator.apache.org Fri Aug 04 04:30:12 2006 Return-Path: Delivered-To: apmail-incubator-xap-commits-archive@locus.apache.org Received: (qmail 3843 invoked from network); 4 Aug 2006 04:30:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Aug 2006 04:30:12 -0000 Received: (qmail 73085 invoked by uid 500); 4 Aug 2006 04:30:11 -0000 Delivered-To: apmail-incubator-xap-commits-archive@incubator.apache.org Received: (qmail 73062 invoked by uid 500); 4 Aug 2006 04:30:11 -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 73052 invoked by uid 99); 4 Aug 2006 04:30:11 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2006 21:30:11 -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; Thu, 03 Aug 2006 21:30:10 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 57D271A981A; Thu, 3 Aug 2006 21:29:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r428616 - in /incubator/xap/trunk: WebContent/examples/ WebContent/examples/dojo/ src/xap/bridges/dojo/ src/xap/taghandling/ Date: Fri, 04 Aug 2006 04:29:48 -0000 To: xap-commits@incubator.apache.org From: mturyn@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060804042950.57D271A981A@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: mturyn Date: Thu Aug 3 21:29:45 2006 New Revision: 428616 URL: http://svn.apache.org/viewvc?rev=428616&view=rev Log: Continued shifting of methods into the superclass, with the result that the DatePicker and ColorPalette bridges are very small now. Examples improved: now get data from the Dojo widgets. To do this, ColorPalette peer augmented with a working onColorSet method---default is a do-nothing stub. Modified: incubator/xap/trunk/WebContent/examples/dojo/colorPicker.xal incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js incubator/xap/trunk/WebContent/examples/dojo/datePicker.html incubator/xap/trunk/WebContent/examples/dojo/datePicker.xal incubator/xap/trunk/WebContent/examples/dojo/datePickerHandler.js incubator/xap/trunk/WebContent/examples/index.html incubator/xap/trunk/src/xap/bridges/dojo/DojoColorPaletteBridge.js incubator/xap/trunk/src/xap/bridges/dojo/DojoDatePickerBridge.js incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js incubator/xap/trunk/src/xap/taghandling/plugin.xml Modified: incubator/xap/trunk/WebContent/examples/dojo/colorPicker.xal URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/colorPicker.xal?rev=428616&r1=428615&r2=428616&view=diff ============================================================================== --- incubator/xap/trunk/WebContent/examples/dojo/colorPicker.xal (original) +++ incubator/xap/trunk/WebContent/examples/dojo/colorPicker.xal Thu Aug 3 21:29:45 2006 @@ -14,11 +14,12 @@ Modified: incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js?rev=428616&r1=428615&r2=428616&view=diff ============================================================================== --- incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js (original) +++ incubator/xap/trunk/WebContent/examples/dojo/colorPickerHandler.js Thu Aug 3 21:29:45 2006 @@ -9,54 +9,15 @@ "" ]; -colorPickerHandler.prototype.onPicked = function () { -xap.util.Utils.interrogate(arguments) ; -srcNode = arguments[0] ; - var attributes = srcNode.attributes; +colorPickerHandler.prototype.onPick = function( clientEvent){ + var uiDoc = clientEvent.session.getDocumentContainer().getUiDocument(); + var dpEl = uiDoc.getElementById("theColorPicker"); - var i0 = Math.floor(3*Math.random() ); - var i1 = (i0+1)%3 ; - var i2 = (i0+2)%3 ; + var bridge = clientEvent.session.getUiDocumentHandler().getHandlerForElement( dpEl ); - var resultString = "

"+colorPickerHandler.colours[i0] - +"An MCO call got the attributes of the XAP button: " ; - if(!attributes){ - resultString += "
" ; - } else { - for (var ii = 0; ii " ; - resultString +=":"+ colorPickerHandler.colours[i2] - +attributes[ii].nodeValue+"
" ; - } - } - xap.showStatus() ; - var ticker = document.getElementById("xapStat") ; - ticker.innerHTML = ticker.innerHTML + resultString ; - -} - - -colorPickerHandler.prototype.onPick = function( event){ - - var uiDoc = event.session.getDocumentContainer().getUiDocument(); - - var srcObj = uiDoc.getElementById(event.id) ; - - var palette = event.source._attributeChangeListeners[0]._peer ; - - var report = report = xap.util.Utils.fullDump(palette,1,true); - report = report.replace(/&/gm, "&") - report = report.replace(//gm, ">") - report = report.replace(/\n/mg,"
") ; - report = report.replace(/ /mg," ") ; - - var ticker = document.getElementById("dump") ; + var palette = bridge.getPeer() ; + alert("Picked RGB: "+palette._color) ; - ticker.innerHTML += "

Color: "+ report ; } Modified: incubator/xap/trunk/WebContent/examples/dojo/datePicker.html URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/datePicker.html?rev=428616&r1=428615&r2=428616&view=diff ============================================================================== --- incubator/xap/trunk/WebContent/examples/dojo/datePicker.html (original) +++ incubator/xap/trunk/WebContent/examples/dojo/datePicker.html Thu Aug 3 21:29:45 2006 @@ -28,8 +28,9 @@ "xap.session.ClientSession", "xap.taghandling.AbstractTagImpl", "xap.bridges.basic.AbstractBlackBoxWidgetBridge", + "xap.bridges.dojo.DojoWidgetBridge", "xap.bridges.dojo.DojoDatePickerBridge", -"src.dojo/src/widget.html.DatePicker" + "xap.session.EventHandler" ) ; Modified: incubator/xap/trunk/WebContent/examples/dojo/datePicker.xal URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/datePicker.xal?rev=428616&r1=428615&r2=428616&view=diff ============================================================================== --- incubator/xap/trunk/WebContent/examples/dojo/datePicker.xal (original) +++ incubator/xap/trunk/WebContent/examples/dojo/datePicker.xal Thu Aug 3 21:29:45 2006 @@ -11,7 +11,8 @@ - Modified: incubator/xap/trunk/WebContent/examples/dojo/datePickerHandler.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dojo/datePickerHandler.js?rev=428616&r1=428615&r2=428616&view=diff ============================================================================== --- incubator/xap/trunk/WebContent/examples/dojo/datePickerHandler.js (original) +++ incubator/xap/trunk/WebContent/examples/dojo/datePickerHandler.js Thu Aug 3 21:29:45 2006 @@ -8,6 +8,18 @@ "", "" ]; + + +datePickerHandler.prototype.onSetDate = function(clientEvent){ + var uiDoc = clientEvent.session.getDocumentContainer().getUiDocument(); + var dpEl = uiDoc.getElementById("theDatePicker"); + + var dp_0 = clientEvent.session.getUiDocumentHandler().getHandlerForElement(dpEl ); + + alert(dp_0.getPeer().date) ; +} + + datePickerHandler.prototype.onClick = function (srcNode) { //xap.util.Utils.interrogate(srcNode) ; Modified: incubator/xap/trunk/WebContent/examples/index.html URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/index.html?rev=428616&r1=428615&r2=428616&view=diff ============================================================================== --- incubator/xap/trunk/WebContent/examples/index.html (original) +++ incubator/xap/trunk/WebContent/examples/index.html Thu Aug 3 21:29:45 2006 @@ -23,7 +23,8 @@
  • Dojo example 1

  • Wrapped dom example 0
  • -
  • Wrapped DatePicker, treated as a black box.
  • +
  • Wrapped DatePicker, with most code in DojoWidget superclass.
  • +
  • Wrapped ColorPalette, with most code in DojoWidget superclass.
  • Modified: incubator/xap/trunk/src/xap/bridges/dojo/DojoColorPaletteBridge.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/DojoColorPaletteBridge.js?rev=428616&r1=428615&r2=428616&view=diff ============================================================================== --- incubator/xap/trunk/src/xap/bridges/dojo/DojoColorPaletteBridge.js (original) +++ incubator/xap/trunk/src/xap/bridges/dojo/DojoColorPaletteBridge.js Thu Aug 3 21:29:45 2006 @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Apache Software Foundation. * @@ -23,14 +22,14 @@ /** * @fileoverview * - * A wrapper for a Dojo DojoColorPalette, treated as a black box. + * A wrapper for a Dojo ColorPalette, treated as a black box. */ /** - * Creates a xap.bridges.basic.DojoColorPaletteBridge. + * Creates a xap.bridges.dojo.DojoColorPaletteBridge. * * - * @class xap.bridges.basic.DojoColorPaletteBridge is the bridge between an XML element - * representing a control and a subclass of DojoColorPalette. This class + * @class xap.bridges.dojo.DojoColorPaletteBridge is the bridge between an XML element + * representing a control and a subclass of ColorPalette. This class * is typically not used directly but is extended by other classes * for its subclasses. * @@ -51,24 +50,30 @@ xap.bridges.dojo.DojoColorPaletteBridge.prototype._peer = null ; - - +xap.bridges.dojo.DojoColorPaletteBridge.prototype.getPeerString = function(){ + return "ColorPalette" ; +} xap.bridges.dojo.DojoColorPaletteBridge.prototype.attributeSet = function(){ //TO_DO anything useful here? format-string? }; -xap.bridges.dojo.DojoColorPaletteBridge.prototype.getPeerString = function(){ - return "ColorPalette" ; -} - xap.bridges.dojo.DojoColorPaletteBridge.prototype.getPeerOnCommandEvent = function(){ return "onColorSelect" ; } -xap.bridges.dojo.DojoColorPaletteBridge.prototype.getRootDomNode= function(){ - return this._peer.domNode ; +// The peer is a bit deficient: +xap.bridges.dojo.DojoColorPaletteBridge.prototype.setPeer = function(aWidget){ + this.superclass.setPeer.call(this,aWidget) ; + aWidget.onColorSelect = function(aColor){ + aWidget._color = aColor ; + } } + + + + + Modified: incubator/xap/trunk/src/xap/bridges/dojo/DojoDatePickerBridge.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/DojoDatePickerBridge.js?rev=428616&r1=428615&r2=428616&view=diff ============================================================================== --- incubator/xap/trunk/src/xap/bridges/dojo/DojoDatePickerBridge.js (original) +++ incubator/xap/trunk/src/xap/bridges/dojo/DojoDatePickerBridge.js Thu Aug 3 21:29:45 2006 @@ -62,8 +62,10 @@ xap.bridges.dojo.DojoDatePickerBridge.prototype.getPeerOnCommandEvent = function(){ - return "onSelectDate" ; + return "onSetDate" ; } + + // Just testing that the superclass event-mapper doesn't destroy any explicitly-defined Modified: incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js?rev=428616&r1=428615&r2=428616&view=diff ============================================================================== --- incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js (original) +++ incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js Thu Aug 3 21:29:45 2006 @@ -15,7 +15,7 @@ * */ - Xap.require("xap.bridges.basic.AbstractBlackBoxWidgetBridge"); +Xap.require("xap.bridges.basic.AbstractBlackBoxWidgetBridge"); Xap.provide("xap.bridges.dojo.DojoWidgetBridge"); /** Modified: incubator/xap/trunk/src/xap/taghandling/plugin.xml URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/taghandling/plugin.xml?rev=428616&r1=428615&r2=428616&view=diff ============================================================================== --- incubator/xap/trunk/src/xap/taghandling/plugin.xml (original) +++ incubator/xap/trunk/src/xap/taghandling/plugin.xml Thu Aug 3 21:29:45 2006 @@ -30,6 +30,7 @@ +