<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Dojo on Google Web Toolkit</title>
	<atom:link href="http://dwt.sourceforge.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://dwt.sourceforge.net/blog</link>
	<description>Dojo marrying Google Web Toolkit</description>
	<pubDate>Sat, 14 Nov 2009 18:47:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Moving to Git, GWT 1.7 and Dojo 1.3.2</title>
		<link>http://dwt.sourceforge.net/blog/2009/11/15/moving-to-git-gwt-17-and-dojo-132/</link>
		<comments>http://dwt.sourceforge.net/blog/2009/11/15/moving-to-git-gwt-17-and-dojo-132/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 18:47:25 +0000</pubDate>
		<dc:creator>Gaurav Vaish</dc:creator>
		
		<category><![CDATA[Updates]]></category>

		<category><![CDATA[Widget]]></category>

		<category><![CDATA[mastergaurav]]></category>

		<category><![CDATA[Button]]></category>

		<category><![CDATA[Dijit]]></category>

		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://dwt.sourceforge.net/blog/?p=9</guid>
		<description><![CDATA[Dwt has been updated to the following:

It now uses Git
Updated to GWT 1.7 with Eclipse plug-in (I currently use Galileo)
Updated to Dojo 1.3.2

Migrated completed a few minutes ago.
My current target is to implement the Dijit &#8220;Button&#8221; widget ASAP.
Wish me luck! 
]]></description>
			<content:encoded><![CDATA[<p>Dwt has been updated to the following:</p>
<ol>
<li>It now uses Git</li>
<li>Updated to GWT 1.7 with Eclipse plug-in (I currently use Galileo)</li>
<li>Updated to Dojo 1.3.2</li>
</ol>
<p>Migrated completed a few minutes ago.</p>
<p>My current target is to implement the Dijit &#8220;Button&#8221; widget ASAP.</p>
<p>Wish me luck! <img src='http://dwt.sourceforge.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://dwt.sourceforge.net/blog/2009/11/15/moving-to-git-gwt-17-and-dojo-132/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Phoenix</title>
		<link>http://dwt.sourceforge.net/blog/2008/10/16/the-phoenix/</link>
		<comments>http://dwt.sourceforge.net/blog/2008/10/16/the-phoenix/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 18:13:56 +0000</pubDate>
		<dc:creator>Gaurav Vaish</dc:creator>
		
		<category><![CDATA[Architecture]]></category>

		<category><![CDATA[Dijit]]></category>

		<category><![CDATA[Updates]]></category>

		<category><![CDATA[mastergaurav]]></category>

		<guid isPermaLink="false">http://dwt.sourceforge.net/blog/?p=8</guid>
		<description><![CDATA[No no&#8230; don&#8217;t think that Dwt is dead just because there seems no visible activity for last two months.
In fact, I just got so busy that there was hardly any time to look into Dwt. Can&#8217;t help, I&#8217;m not 100%-time into Dwt.
Anyway&#8230; that was recent past.
Ok&#8230; now coming to the rebirth of Dwt - that [...]]]></description>
			<content:encoded><![CDATA[<p>No no&#8230; don&#8217;t think that Dwt is dead just because there seems no visible activity for last two months.</p>
<p>In fact, I just got so busy that there was hardly any time to look into Dwt. Can&#8217;t help, I&#8217;m not 100%-time into Dwt.</p>
<p>Anyway&#8230; that was recent past.</p>
<p>Ok&#8230; now coming to the rebirth of Dwt - that I don&#8217;t think should happen again, at least in near future, here are the latest updates:</p>
<ol>
<li>Focus continues to have on the core design, for the moment, to ensure that we do not have half-cooked or uncooked design.</li>
<li>Refactoring of <a title="Dwt Widget" href="http://dwt.svn.sourceforge.net/viewvc/dwt/trunk/dwt/eclipse/src/com/edujinilabs/dwt/client/dijit/Widget.java?view=markup">dijit.Widget</a> class: It does not use several class-level fields to store styleClass, dir, lang etc. It uses a <code>HashMap&lt;String, Object&gt;</code>, and additionally provides get/set apart from getXXX and setXXX.</li>
<li>Added <code>JavaScriptObjectWrapper</code> class since interconversion from <code>JavaScriptObject</code> to Java-Object was troublesome area in quite a few scenarios. The benefits will be visible at several places.</li>
<li>Refactoring of <code>IJavaScriptFunction</code> interface to use <code>JavaScriptObjectWrapper</code> class.</li>
<li><code>TemplatedWidget</code> uses <code>HashMap&lt;String, List&lt;Element&gt;&gt; for dojoAttachPoints and HashMap&lt;String, HashMap&lt;Integer, List&lt;EventListener&gt;&gt;&gt;</code> as event-listeners store.</li>
<li><code>TemplatedWidget</code>, at least for now - until we get the magical wand, does not support dojoAttachEvent.</li>
<li>The immediate next step is get <code>TemplatedWidget</code> back in shape because after these changes, the code breaks. <img src='http://dwt.sourceforge.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Subsequently, implement the <code>replaceProperties</code> method.</li>
<li>And then, provide overloaded addEventListener methods as discussed in the previous entry.</li>
</ol>
<p>I would be committing the code sometime tomorrow. It&#8217;s been quite hectic recently.</p>
<p>Catch up with lot of action&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://dwt.sourceforge.net/blog/2008/10/16/the-phoenix/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Template Based Widgets in DWT</title>
		<link>http://dwt.sourceforge.net/blog/2008/08/29/template-based-widgets-in-dwt/</link>
		<comments>http://dwt.sourceforge.net/blog/2008/08/29/template-based-widgets-in-dwt/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 09:49:08 +0000</pubDate>
		<dc:creator>Gaurav Vaish</dc:creator>
		
		<category><![CDATA[Architecture]]></category>

		<category><![CDATA[Dijit]]></category>

		<category><![CDATA[Proposals]]></category>

		<category><![CDATA[Templated Widget]]></category>

		<guid isPermaLink="false">http://dwt.sourceforge.net/blog/?p=7</guid>
		<description><![CDATA[Download the PDF document (for better readability here).
The challenge:
There are several architectural and feature differences in JavaScript and Java.
Java is statically typed where as JavaScript is dynamically typed.
Java does not support function references where as JavaScript supports.
As such, it becomes very difficult to support template-based widgets in DWT, as is the case in Dojo Widget [...]]]></description>
			<content:encoded><![CDATA[<p style="font-size: 11px">Download the PDF document (for better readability <a title="Templated Based Widgets in DWT" href="http://dwt.sourceforge.net/docs/proposals/2008.08.29-Template.Based.Widgets.in.DWT.pdf">here</a>).</p>
<p style="background:#E0E0E0"><span style="font-size: 16px; font-family: Georgia;">The challenge:</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">There are several architectural and feature differences in JavaScript and Java.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">Java is statically typed where as JavaScript is dynamically typed.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">Java does not support function references where as JavaScript supports.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">As such, it becomes very difficult to support template-based widgets in DWT, as is the case in Dojo Widget System – Dijit.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">Added to it, Google Web Toolkit (GWT) differentiates JavaScriptObject inherited types v/s other Object-inherited types. Though finally non-JavaScriptObject types are compiled to JavaScript types, the hosted-mode (emulation layer) fails to recognize &#8220;dynamic&#8221; properties and result in errors.</span></p>
<p style="background:#E0E0E0"><span style="font-size: 16px; font-family: Georgia;">Proposed Solution:</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">Statically typed languages can be converted to dynamically typed language using collections like an array or a map (java.util.List and java.util.Map).</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">List provides an index-based access to the properties where as Map provides a name-based access.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">As such, what I propose is the following:</span></p>
<ul style="font-size: 11px">
<li>All properties would be stored in a combination of Map&lt;String, Object&gt;. This includes even simple items like the ID, widget-ID or other attributes. The key is the name of the property.</li>
<li>All dojoAttachPoint-s would be stored in Map&lt;String, Element&gt;. The key is the name of the attach-point.</li>
<li>All dojoAttachEvent-s would be stored in a slightly more elaborated Map&lt;String, Map&lt;String, List&lt;EventListener&gt;&gt;&gt;</li>
</ul>
<p style="background:#E0E0E0"><span style="font-size: 16px; font-family: Georgia;">Widget Properties:</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">All widget properties would be stored in a variable – say, properties – of the type Map&lt;String, Object&gt;.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">It will contain all properties that are required for the working of the widgets. As such, the class will not contain any fields other than what is required to manage the system.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">The Widget-inherited types may introduce custom fields as may be required.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">Access to the values would be made available through the methods get(String) and set(String, Object)</span></p>
<p style="background:#E0E0E0"><span style="font-size: 16px; font-family: Georgia;">Dojo Attach Point-s:</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">All attach points, as parsed from the templates, would be stored in a variable – say, attachPoints – of the type Map&lt;String, List&lt;Element&gt;&gt;.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">The basic question – why should the value be List&lt;Element&gt; rather than Element? The answer lies in the file dijit/_Templated.js (part of Dojo distribution).</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">The following is the code snippet from the file (lines 144 – 149, version 1.1.1):</span></p>
<pre style="background:#E0E0E0; border: 1px solid">while((point = points.shift())){
   if(dojo.isArray(this[point])){
      this[point].push(baseNode);
   }else{
      this[point]=baseNode;
   }
}</pre>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">As such, I decided to make it a List&lt;Element&gt;.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">The methods getAttachPoints(String), getAttachPoint(String) can be used access the attach-points programmatically.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">Methods addAttachPoint, setAttachPoints, removeAttachPoint and removeAttachPoints may be used for further programmatic manipulation <sup>[1]</sup>.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">I propose to keep all the methods public unless there is a pressing reason against it.</span></p>
<p style="background:#E0E0E0"><span style="font-size: 16px; font-family: Georgia;">Dojo Attach Event-s:</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">dojoAttachEvent-s is a trickier part since Java does not support method references. As such, dojoAttachEvent-s are not supported in the form as in Dojo.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">A widget-author can use the following methods to register attach-events programmatically:</span></p>
<ul style="font-size: 11px">
<li>registerAttachEvents(Map&lt;String, Map&lt;String, List(&lt;EventListener&gt;&gt;)</li>
<li>registerAttachEvents(Map&lt;String, Map&lt;int, List(&lt;EventListener&gt;&gt;&gt;)</li>
<li>registerAttachEvents(Map&lt;Element, Map&lt;String, List(&lt;EventListener&gt;&gt;&gt;)</li>
<li>registerAttachEvents(Map&lt;Element, Map&lt;int, List(&lt;EventListener&gt;&gt;&gt;)</li>
<li>addAttachEvent(String, String, EventListener)</li>
<li>addAttachEvent(Element, String, EventListener)</li>
<li>addAttachEvent(String, int, EventListener)</li>
<li>addAttachEvent(Element, int, EventListener)</li>
</ul>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">The Map&lt;String, Map&lt;String, EventListener&gt;&gt; comprises of the main key as attach-point-name and the sub-key as the DOM-event-name or the ID (as defined by GWT).</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">registerAttachEvents is a protected method and would be called during the build-up process. addAttachEvent is a public method for further manipulation.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">Overloaded methods removeAttachEvent can be used to remove the listeners <sup>[1]</sup>.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">The field – say, eventListeners – of type Map&lt;String, Map&lt;int, List&lt;EventListener&gt;&gt;&gt; would be used to manage all event listeners.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">Widgets may publish helper methods, say for example, addClickListener for Button or addChangeListener for TextBox or simply addListener for the ease of the developer.</span></p>
<p style="margin-left:0pt;text-align:justify"><sup><span style="font-size: 9px; font-family: Verdana;">[1]</span></sup><span style="font-size: 10pt; font-family: Verdana;">: Not sure if it is really required.</span></p>
<p style="background:#E0E0E0"><span style="font-size: 16px; font-family: Georgia;">Final Structure:</span></p>
<pre style="background:#E0E0E0;border:1px solid;">public class Widget
{
   private Map&lt;String, Object&gt; properties;

   public Object get(String name);

   public set(String name, Object value);

}

public class TemplatedWidget extends Widget
{
   private Map&lt;String, List&lt;Element&gt;&gt; attachPoints;
   private Map&lt;String, Map&lt;int, List&lt;EventListener&gt;&gt;&gt; eventListeners;

   public List&lt;Element&gt; getAttachPoints(String name);
   public Element getAttachPoint(String name);

   public void addAttachPoint(String name, Element element);
   public void addAAttachPoints(String name, List&lt;Element&gt; elements);

   protected void registerAttachEvents
      (Map&lt;String, Map&lt;String, List(&lt;EventListener&gt;&gt;);
   protected void registerAttachEvents
      (Map&lt;String, Map&lt;int, List(&lt;EventListener&gt;&gt;);

   protected void registerAttachEvents
      (Map&lt;Element, Map&lt;String, List(&lt;EventListener&gt;&gt;&gt;);
   protected void registerAttachEvents
      (Map&lt;Element, Map&lt;int, List(&lt;EventListener&gt;&gt;&gt;);

   public void addAttachEvent(String, String, EventListener);
   public void addAttachEvent(String, int, EventListener);
   public void addAttachEvent(Element, String, EventListener);
   public void addAttachEvent(Element, int, EventListener);

   public void removeAttachEvent(String, String, EventListener);
   public void removeAttachEvent(String, int, EventListener);
   public void removeAttachEvent(Element, String, EventListener);
   public void removeAttachEvent(Element, int, EventListener);
}</pre>
<p style="background:#E0E0E0"><span style="font-size: 16px; font-family: Georgia;">Feedback:</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">The DWT team looks forward to your inputs – critics and suggestions on the approach.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">Feel free to drop in a comment at <a href="http://dwt.sourceforge.net/blog">http://dwt.sourceforge.net/blog</a> or write a mail to <a href="mailto:dwt@edujini-labs.com">dwt@edujini-labs.com</a> or <a href="mailto:dwt-users@lists.sourceforge.net">dwt-users@lists.sourceforge.net</a>.</span></p>
<p style="margin-left:0pt;text-align:justify"><span style="font-size: 11px; font-family: Verdana;">Mailing-list URL: <a href="http://sourceforge.net/mailarchive/forum.php?forum_name=dwt-users">http://sourceforge.net/mailarchive/forum.php?forum_name=dwt-users</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://dwt.sourceforge.net/blog/2008/08/29/template-based-widgets-in-dwt/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Templated Widget Design</title>
		<link>http://dwt.sourceforge.net/blog/2008/08/29/templated-widget-design/</link>
		<comments>http://dwt.sourceforge.net/blog/2008/08/29/templated-widget-design/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 04:57:58 +0000</pubDate>
		<dc:creator>Gaurav Vaish</dc:creator>
		
		<category><![CDATA[Architecture]]></category>

		<category><![CDATA[Dijit]]></category>

		<category><![CDATA[Proposals]]></category>

		<category><![CDATA[Templated Widget]]></category>

		<category><![CDATA[Widgets]]></category>

		<guid isPermaLink="false">http://dwt.sourceforge.net/blog/?p=6</guid>
		<description><![CDATA[Yesterday, we accomplish a kind-of breakthrough. We were able to process the template for a template-based-widget and extract the dojoAttachPoint-s.
The tougher challenge for us is to work with dojoAttachEvent. At this point, I am not quite too sure if and how we will support it because Java does not support function-pointers whereas JavaScript does.
Yesterday, I [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, we accomplish a kind-of breakthrough. We were able to process the template for a template-based-widget and extract the <code>dojoAttachPoint</code>-s.</p>
<p>The tougher challenge for us is to work with <code>dojoAttachEvent</code>. At this point, I am not quite too sure if and how we will support it because Java does not support function-pointers whereas JavaScript does.</p>
<p>Yesterday, I did try out sinking some events and capturing them (<code>onBrowserEvent</code>). Worked fine in trivial case. I think it&#8217;s time to look at <code>EventListener</code> and define custom event listeners, and methods to add/remove/fire them.</p>
<p>I intend to pen-down a small architecture / design document today (hey, I&#8217;m traveling tonight and will be off action for next 4-5 days) highlighting the templated widgets.</p>
<p>And once the templated widget is done, creating further widgets would be straight forward and quite speedy.</p>
]]></content:encoded>
			<wfw:commentRss>http://dwt.sourceforge.net/blog/2008/08/29/templated-widget-design/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dwt Project Commences</title>
		<link>http://dwt.sourceforge.net/blog/2008/08/18/dwt-project-commences/</link>
		<comments>http://dwt.sourceforge.net/blog/2008/08/18/dwt-project-commences/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 13:26:49 +0000</pubDate>
		<dc:creator>Gaurav Vaish</dc:creator>
		
		<category><![CDATA[Dijit]]></category>

		<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://dwt.sourceforge.net/blog/?p=5</guid>
		<description><![CDATA[Dwt project finally takes off formally.
We today checked in a few classes in the dijit package (com.edujinilabs.dwt.client.dijit).
Browse SVN for Dwt Root or directly checkout the Eclipse project here.
We started with porting the dijit._Widget data-type, which is available as com.edujinilabs.dwt.client.dijit.Widget class.
The life so far seems interesting and we hope to publish an architecture and a roadmap [...]]]></description>
			<content:encoded><![CDATA[<p>Dwt project finally takes off formally.</p>
<p>We today checked in a few classes in the dijit package (com.edujinilabs.dwt.client.dijit).</p>
<p>Browse SVN for <a title="Dwt Root" href="http://dwt.svn.sourceforge.net/svnroot/dwt/">Dwt Root</a> or directly checkout the Eclipse project <a title="Dwt Eclipse Project Path" href="http://dwt.svn.sourceforge.net/svnroot/dwt/trunk/dwt/eclipse/">here</a>.</p>
<p>We started with porting the <code>dijit._Widget</code> data-type, which is available as <a title="Dwt Widget" href="http://dwt.svn.sourceforge.net/svnroot/dwt/trunk/dwt/eclipse/src/com/edujinilabs/dwt/client/dijit/Widget.java">com.edujinilabs.dwt.client.dijit.Widget</a> class.</p>
<p>The life so far seems interesting and we hope to publish an architecture and a roadmap document soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://dwt.sourceforge.net/blog/2008/08/18/dwt-project-commences/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
