<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>xul &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/xul/</link>
	<description>Feed of posts on WordPress.com tagged "xul"</description>
	<pubDate>Tue, 01 Dec 2009 04:19:06 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Reference content from chrome in Mozilla Firefox]]></title>
<link>http://maohao.wordpress.com/2009/11/28/reference-content-from-chrome-in-mozilla-firefox/</link>
<pubDate>Sat, 28 Nov 2009 23:10:58 +0000</pubDate>
<dc:creator>maohao</dc:creator>
<guid>http://maohao.wordpress.com/2009/11/28/reference-content-from-chrome-in-mozilla-firefox/</guid>
<description><![CDATA[This is a snippet of text from Working with windows in chrome code: In case of &lt;browser type="con]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This is a snippet of text from <a href="https://developer.mozilla.org/en/Working_with_windows_in_chrome_code">Working with windows in chrome code</a>:</p>
<p>In case of <code>&#60;browser type="content-primary" /&#62;</code>, you can use the <a rel="internal" href="https://developer.mozilla.org/en/DOM/window.content">content</a> shortcut property to access the <code>Window</code> object of the content document. You can use <code>content.document</code> in a <code>browser.xul</code> overlay to access the web page in the selected tab in a Firefox window. For example:</p>
<blockquote><p>//alerts selected text in the main content<br />
alert(content.window.getSelection());<br />
// alerts the title of the document displayed in the content-primary widget<br />
alert(content.document.title);</p></blockquote>
<p>There is no shortcut for accessing document in the sidebar. You need to use</p>
<blockquote><p>document.getElementById(&#8220;sidebar&#8221;).contentDocument</p></blockquote>
<p>or</p>
<blockquote><p>.contentWindow</p></blockquote>
<p>,</p>
<p>like when <a href="https://developer.mozilla.org/en/Working_with_windows_in_chrome_code#Accessing%20content%20documents">Accessing content documents </a></p>
<p>Works in Firefox 3.5.5.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Refreshing XUL-Resources in running Firefox-Session]]></title>
<link>http://andreaseternach.wordpress.com/2009/11/26/refreshing-xul-resources-in-running-firefox-session/</link>
<pubDate>Thu, 26 Nov 2009 17:24:52 +0000</pubDate>
<dc:creator>andreaseternach</dc:creator>
<guid>http://andreaseternach.wordpress.com/2009/11/26/refreshing-xul-resources-in-running-firefox-session/</guid>
<description><![CDATA[Today i played around a little bit with XUL. After updating my first XUL-Side multiple times i got v]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Today i played around a little bit with XUL. After updating my first XUL-Side multiple times i got very annoyed of the builtin caching &#8211; Whenever i changed my XUL-File i had to restart firefox. Otherwise the file was not reloaded.</p>
<p>After searching the web, i found a way to disable the cache (<a href="http://www.firefox-browser.de/wiki/About:config_(Einstellungen)">German Firefox-Wiki-Entry</a>)</p>
<ol>
<li>Open <a href="config">about:config</a> in your firefox.</li>
<li>Right click and select &#8220;New -&#62; Boolean&#8221;.</li>
<li>Add a variable &#8220;nglayout.debug.disable_xul_cache&#8221;.</li>
<li>Change its value to true via double click.</li>
<li>Restart firefox.</li>
</ol>
<p>Now the cache for XUL-Resources is disabled. That means whenever you refresh an XUL-File (e.g. when pressing F5) the new version of the file is loaded.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Trudging on through 0.2]]></title>
<link>http://buddhatron.wordpress.com/2009/11/22/80/</link>
<pubDate>Sun, 22 Nov 2009 07:01:03 +0000</pubDate>
<dc:creator>buddhatron</dc:creator>
<guid>http://buddhatron.wordpress.com/2009/11/22/80/</guid>
<description><![CDATA[Check it out world &#8212; an on time release (although this blog post isn&#8217;t)! There isn]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Check it out world &#8212; an on time <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=499516" target="_blank">release</a> (although this blog post isn&#8217;t)!</p>
<p>There isn&#8217;t much new, but I plan to make up for it with some pretty cool stuff for 0.3.<br />
So after the first release, the feedback I got suggested less UI, so that was what I tried to work towards in terms of achievement.</p>
<p>This release seems very scrawny in comparison to the amazing progress being accomplished by other students of my class, mainly the <a href="http://processingjs.org/">Processing.js</a> <a href="https://wiki.mozilla.org/Education/Projects/ProcessingForTheWeb">crew</a>. But check it out&#8211;here are some of the goals I have set up for my 0.3 milestone:</p>
<ol>
<li>Code a function to disable next/prev button if current message is last/first</li>
<li>Code a function to allow seeing a short</li>
<li>Code a function to allow skipping spam using navigation</li>
<li>Test extension&#8217;s display flow on a netbook</li>
<li>Navigation buttons that look nice</li>
<li>Consult other netbook users and seek review on basic UI left available</li>
</ol>
<p>This release point is the result of one four-hour and one three-hour sessions in my office, where all I need to test front end code between edits is a lightning quick firing up of Thunderbird. These two days of work resulted in a total of +7 -2 lines of code, but I find victory in the fact that that is 7 hours of material I don&#8217;t have to learn again. I moved forward from understanding how to add elements to nodes (in layman&#8217;s terms: to insert a new control with its own attributes and programmability into item groups used in the base code of Thunderbird) and got comfortable with a new set of different controls and attributes.<br />
My first aim was to get rid of the top toolbar to free up a good chunk of vertical space for the message content portion, so my plan of attack was to ask if element removal is possible in the #extdev channel. I was hooked up with two attributes to choose from, removeelement and hidden.<br />
Removeelement sounded like a bucket of fun, so I gave that a try on the whole mail-toolbox toolbox. That actually ended up being kinda volatile, as the fs window would no longer recognize any selected message, and simply show a blank white inner space. So I dug one level deeper into the node and removed the two toolbar elements individually, one at a time, and found that it was the top [File, Edit, View, etc...] that shouldn&#8217;t be removed. Ever.<br />
But even with one toolbar taken down, it still doesn&#8217;t look seamless. So the out-in-the-open answer became hidden. mail-toolbox hidden=&#8221;true&#8221;, that is. Great success!</p>
<p>Next thing to do was add a Prev &#38; Next button for navigating through emails with the mouse. It took me about almost two hours and several different placements to get the feng shui just right and make sure that they wouldn&#8217;t warp or displace themselves like this:<br />
<img src="http://i49.tinypic.com/10ynaxc.png" alt="s1" width="333" height="104" /><br />
<img src="http://i49.tinypic.com/awxd0j.png" alt="s2" width="342" height="104" /></p>
<p><img src="http://i49.tinypic.com/6gg7eq.png" alt="w1" width="241" height="139" /><br />
<img src="http://i45.tinypic.com/nppab4.png" alt="w2" width="233" height="125" /><br />
but the two young buttons seem satisfied in their new home behind a spacer. Their auto-fitting with the vertical space was fixed by simply removing the align=&#8221;end&#8221; attribute I put in. Now they just need funky arrow icons to express their adolescent creativity, and stuff.</p>
<p>Oh yeah and I fixed the minimum version of Thunderbird problem. I set it to 2.9.*, since it seems the safest bet any 3.0pre build.</p>
<p>Also along this road I tried some other attributes that ended up not being necessary, but still cool tools to understand. The first is observes, which I noticed was on a most of the toolbox items, and insertbefore/insertafter. observes is like a radio to a broadcast tower, a broadcaster, sending the signal to adhere to any changed default attributes in the broadcaster. There&#8217;s a better explanation <a href="http://www.ar-ent.net/dar/arlib32/out/html/man/xul/broadob.html">here</a>. And have a <a href="http://oss.org.cn/ossdocs/mozilla/xul/xultu/elemref/ref_XULElement.html" target="_blank">XUL element reference</a> also for good measure.</p>
<p>And along this road a few more cool feature ideas popped into my head;<br />
People might like to be able to see or know if the next or previous message is junk and would prefer to skip it.<br />
Perhaps add an easy way to zoom the size of text, both in and out to accommodate many different display settings.<br />
A drop down list of message folders (inbox, sent, deleted, etc), with folder change going to the latest non-junk message, but I&#8217;m not dead set on keeping this idea if testers don&#8217;t feel it necessary.</p>
<p>Will keep you updated.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Firefox Add-On: DOM Inspector]]></title>
<link>http://ermsitgirl.wordpress.com/2009/11/05/dom-inspector/</link>
<pubDate>Wed, 04 Nov 2009 23:44:25 +0000</pubDate>
<dc:creator>zellis</dc:creator>
<guid>http://ermsitgirl.wordpress.com/2009/11/05/dom-inspector/</guid>
<description><![CDATA[Well, it is no state secret that I am a Firefox fan. It is definite the best Web Browser. This is su]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Well, it is no state secret that I am a <a href="http://www.mozilla.com/?from=sfx&#38;uid=295711&#38;t=443" target="_tab">Firefox</a> fan. It is definite the best Web Browser. </p>
<p>This is such a handy tool for Web developers, especially if you make Themes and Extensions (Add-Ons). You can install it from <a href="https://addons.mozilla.org/en-US/firefox/addon/6622" target="_tab">here</a>. One can inspect in a two page pane the DOM (Document Object Model) of any Web page or XUL (XML User Interface Language &#8211; pronounced zool ) window. In other words the structure and the properties of a page or window.</p>
<p>Screenshot:<br />
<a href="http://ermsitgirl.wordpress.com/files/2009/11/dominspector.jpg" target="_tab"><img src="http://ermsitgirl.wordpress.com/files/2009/11/dominspector.jpg?w=300" alt="DOM Inspector" title="DOM Inspector" width="300" height="225" class="alignnone size-medium wp-image-1111" /></a></p>
<p><strong>DOM &#8211; Document Object Model</strong><br />
This is the API (application programming interface)  for valid HTML and well-formed XML documents. In other  all the tags,e.g.&#60;html&#62; ,&#60;div&#62;, &#60;script&#62;, etc. So the DOM specifies how XML and HTML documents are represented as objects, which enables us to use them in object oriented programs.</p>
<p><strong>XUL &#8211; XML User Interface Language</strong><br />
This is is Mozilla&#8217;s XML-based language that lets you build applications. Although it is not a an official standard, it relies on the existing Web Standards like CSS, Javascript and DOM. This make it quite easy for Web developers to learn. Read more <a target="_tab">here</a> at Mozilla&#8217;s XUL site.</p>
<p>Another Add-On you can also consider is <a href="http://xpath.alephzarro.com/" target="_tab">XPather</a>.</p>
<p>Happy Coding <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[.NET Framework Assistant, automatic plugin installation and PluginChecker]]></title>
<link>http://dafizilla.wordpress.com/2009/10/18/net-framework-assistant-automatic-plugin-installation-and-pluginchecker/</link>
<pubDate>Sun, 18 Oct 2009 13:21:07 +0000</pubDate>
<dc:creator>dafi</dc:creator>
<guid>http://dafizilla.wordpress.com/2009/10/18/net-framework-assistant-automatic-plugin-installation-and-pluginchecker/</guid>
<description><![CDATA[In these days the net is populated by blog posts about the .NET Framework Assistant plugin for Firef]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In these days the net is populated by blog posts about the .NET Framework Assistant plugin for Firefox, its disabling and the fact Firefox does not warn user when a plugin installs itself without explicit permission.</p>
<p>Well, this is a old problem at least for me, indeed  I discovered it some time ago when my Firefox crashed (apparently) without reason, discovering after a couple of days that Microsoft Office 2003 plugin fought with Foxit Reader and Google update plugins.</p>
<p>The problem was that I never installed Office plugin!</p>
<p><a rel="attachment wp-att-850" href="http://dafizilla.wordpress.com/2009/10/18/net-framework-assistant-automatic-plugin-installation-and-pluginchecker/plugins/"><img class="aligncenter size-full wp-image-850" title="plugins" src="http://dafizilla.wordpress.com/files/2009/10/plugins.jpg" alt="plugins" width="487" height="427" /></a></p>
<p>Disabling Office plugin Firefox stopped to crash.</p>
<p>After that experience I decided to write a simple (very simple) extension that at every Firefox startup checks if there are new plugins installed.</p>
<p><a rel="attachment wp-att-851" href="http://dafizilla.wordpress.com/2009/10/18/net-framework-assistant-automatic-plugin-installation-and-pluginchecker/pluginchecker/"><img class="aligncenter size-full wp-image-851" title="pluginchecker" src="http://dafizilla.wordpress.com/files/2009/10/pluginchecker.jpg" alt="pluginchecker" width="391" height="195" /></a>Nothing so cool, only a quick and dirty solution implemented in a few of hours.</p>
<p>Waiting Mozilla implements a better solution than mine you can install PluginChecker.</p>
<p>If you expect to find  PluginChecker  innovative or the &#8220;I-can-live-without-it&#8221; extension you are on the wrong place, if you expect a not intrusive and simple solution to unattended plugins installation than you can take a look at it.</p>
<p>You can download <a href="http://sourceforge.net/projects/dafizilla/files/pluginchecker/v0.1/pluginchecker-0.1.xpi/download">PluginChecker</a> from SourceForge.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[PHP5 - TDOM: Creando archivos XML usando DOM y PHP]]></title>
<link>http://phenobarbital.wordpress.com/2009/09/18/php5-tdom-creando-archivos-xml-usando-dom-y-php/</link>
<pubDate>Sat, 19 Sep 2009 04:16:49 +0000</pubDate>
<dc:creator>phenobarbital</dc:creator>
<guid>http://phenobarbital.wordpress.com/2009/09/18/php5-tdom-creando-archivos-xml-usando-dom-y-php/</guid>
<description><![CDATA[En este post presento TDOM (Tomato:Document Object Model), una librería que permite simplificar el p]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>En este post presento TDOM (Tomato:Document Object Model), una librería que permite simplificar el proceso de leer, analizar, modificar o crear archivos XML-based de distintos tipos usando una API simplificada y utilitaria.</p>
<p>Aunque esta librería tiene ya bastante tiempo conmigo (a menos más de un año desde que la hice); un &#8220;re-factoring&#8221; para hacerla más compatible con PHP &#62; 5.3 y la posibilidad de tener una interfaz basada en &#8220;plugins&#8221; que permiten extender sus capacidades agregando nuevos tipos de documentos XML y además de crearle un proyecto libre en Google Code; es lo que me hace escribir el articulo.</p>
<ul>
<li>La página oficial del proyecto en Google Code está acá: [<a href="http://code.google.com/p/tdom/" target="_blank">TDOM Google Code</a>]</li>
<li>La página para phpclasses.org <a href="http://www.phpclasses.org/browse/package/5690.html" target="_blank">está acá</a>.</li>
</ul>
<p>El proyecto nace bajo licencia GPL v.3 y está en fase alpha, versión 0.1.2; permite crear documentos y archivos en:</p>
<ul>
<li>XML</li>
<li>DocBook</li>
<li>SVG</li>
<li>(x)HTML estricto</li>
<li>Interfaces XUL remote</li>
</ul>
<p>Espera incorporar próximamente (ya estoy programando en ello):</p>
<ul>
<li>XMPP (Paquetes del protocolo XMPP que usan Jabber/Gtalk)</li>
<li>RSS (Sindicación de manera fácil)</li>
<li>RDF (Resource Description es base de muchos tipos de archivos, como FOAF: relaciones amigo-amigo descritas semánticamente usando RDF)</li>
<li>ATOM</li>
<li>ODF</li>
</ul>
<p>TDOM forma parte de la capa de creación y vistas de Tomates Framework, que se encuentra en un proceso final de adaptación y re-invención; lo importante de TDOM es que permite crear interfaces XUL, combinado con Jquery+REST sería el primer framework completamente operativo sobre PHP (el otro es Cyclone en perl) que permitiría crear aplicaciones XUL:Remote (que correrían como una aplicación desktop usando XULRunner) en implementar completamente Interfaces XUL de Mozilla.</p>
<h2><a name="Creating_a_XUL_interface">Creando una Interface XUL<br />
</a></h2>
<p><a name="Creating_a_XUL_interface">Está claro que el código dentro de poco será más simplificado cuando todos los widgets UI (toolbars, menu, tabbers, botones) estén incorporados en la clase; pero este es un ejemplo escribiendo solo PHP:<br />
</a></p>
<pre><a name="Creating_a_XUL_interface">$xml = $dom-&#62;type('xul');
#un tabbox
$tabbox = $xml-&#62;create('tabbox');
$tabbox-&#62;orient('vertical')-&#62;flex('1');
$tabs = $tabbox-&#62;create('tabs');
$tabpanel = $tabbox-&#62;create('tabpanels');
$tabpanel-&#62;flex('1');
#adjunto las pestañas:
$tabs-&#62;create('tab')-&#62;label('Google');
$tabs-&#62;create('tab')-&#62;label('PHP.net');
$tabs-&#62;create('tab')-&#62;label('DEVEL');
#y el contenido de las pestañas
$tabpanel-&#62;create('browser')-&#62;src('http://www.google.co.ve/');
$tabpanel-&#62;create('browser')-&#62;src('http://www.php.net/');
$tabpanel-&#62;create('browser')-&#62;src('http://www.devel.com.ve/');
$xml-&#62;title('Prueba de XUL');
$dom-&#62;render(); </a></pre>
<p><a name="Creating_a_XUL_interface">Output: </a></p>
<pre><a name="Creating_a_XUL_interface">&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;?xml-stylesheet type="text/css" href="chrome://global/skin/"?&#62;
&#60;window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="xulWindow" persist="screenX screenY width height sizemode" xmlns:html="http://www.w3.org/1999/xhtml" title="Prueba de XUL"&#62;
  &#60;tabbox orient="vertical" flex="1"&#62;
    &#60;tabs&#62;
      &#60;tab label="Google"/&#62;
      &#60;tab label="PHP.net"/&#62;
      &#60;tab label="DEVEL"/&#62;
    &#60;/tabs&#62;
    &#60;tabpanels flex="1"&#62;
      &#60;browser src="http://www.google.co.ve/"/&#62;
      &#60;browser src="http://www.php.net/"/&#62;
      &#60;browser src="http://www.devel.com.ve/"/&#62;
    &#60;/tabpanels&#62;
  &#60;/tabbox&#62;
&#60;/window&#62;
</a></pre>
<p><a name="Creating_a_XUL_interface"></a></p>
<p><a name="Creating_a_XUL_interface">Proximamente subiré una demo de como se ve esta interfaz XUL.</a></p>
<h2><a name="Creating_an_(x)HTML_strict">Creando un archivo (x)HTML estricto</a></h2>
<p><a name="Creating_an_(x)HTML_strict">Un ejemplo de como el código puede ser simplificado, es tener todo un cuerpo XHMTL 1.0 estricto teniendo solo 3 líneas de código; esto gracias a que todas las etiquetas son necesarias para la descripción de un archivo según la norma de la W3c; estas 3 líneas:<br />
</a></p>
<pre class="prettyprint"><a name="Creating_an_(x)HTML_strict"><span class="pln">$html </span><span class="pun">=</span><span class="pln"> $dom</span><span class="pun">-&#62;</span><span class="pln">type</span><span class="pun">(</span><span class="str">'html'</span><span class="pun">);</span><span class="pln"> </span><span class="pun"></span><span class="pln">
$html</span><span class="pun">-&#62;</span><span class="pln">setTitle</span><span class="pun">(</span><span class="str">'.: Titulo de la Pagina Web :.'</span><span class="pun">);</span><span class="pln">
$dom</span><span class="pun">-&#62;</span><span class="pln">render</span><span class="pun">();</span></a></pre>
<p><a name="Creating_an_(x)HTML_strict">Generan todo este bloque de código que es sintácticamente válido con XHTML 1.0 estricto; lo interesante es que podemos cargarle contenido al BODY con TDOM y este será normalizado para ser XHTML 1.0 estricto; básta de aplicaciones inválidas.<br />
</a></p>
<pre class="prettyprint"><a name="Creating_an_(x)HTML_strict"><span class="pun">&#60;?</span><span class="pln">xml version</span><span class="pun">=</span><span class="str">"1.0"</span><span class="pln"> encoding</span><span class="pun">=</span><span class="str">"utf-8"</span><span class="pun">?&#62;</span><span class="pln">
</span><span class="dec">&#60;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://localhost/proyectos/tomates/tomates/include/tdom/tomates/tdom/include/xhtml1-strict.dtd"&#62;</span><span class="pln">
</span><span class="tag">&#60;html</span><span class="pln"> </span><span class="atn">xmlns</span><span class="pun">=</span><span class="atv">"http://www.w3.org/1999/xhtml"</span><span class="tag">&#62;</span><span class="pln">
  </span><span class="tag">&#60;head&#62;</span><span class="pln">
    </span><span class="tag">&#60;title&#62;</span><span class="pln">.: Titulo de la Pagina Web :.</span><span class="tag">&#60;/title&#62;</span><span class="pln">
    </span><span class="tag">&#60;base</span><span class="pln"> </span><span class="atn">href</span><span class="pun">=</span><span class="atv">"http://localhost/proyectos/tomates/"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
</span><span class="com">&#60;!--Aqui comienzan las etiquetas meta--&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"author"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">""</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"generator"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"Tomates Framework"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"description"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">""</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">http-equiv</span><span class="pun">=</span><span class="atv">"Content-Type"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"application/xhtml+xml; charset=utf-8"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">http-equiv</span><span class="pun">=</span><span class="atv">"Content-Script-Type"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">http-equiv</span><span class="pun">=</span><span class="atv">"Content-Style-Type"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"text/css"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"robots"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"all"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">http-equiv</span><span class="pun">=</span><span class="atv">"Content-Language"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"en_US"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"keywords"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">""</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"Revised"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">": Sep 18 2009"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
</span><span class="com">&#60;!--Aqui terminan las etiquetas meta--&#62;</span><span class="pln">
    </span><span class="tag">&#60;link</span><span class="pln"> </span><span class="atn">rel</span><span class="pun">=</span><span class="atv">"shortcut icon"</span><span class="pln"> </span><span class="atn">href</span><span class="pun">=</span><span class="atv">"http://localhost/proyectos/tomates/application/assets/images/favicon.ico"</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"image/x-icon"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;link</span><span class="pln"> </span><span class="atn">rel</span><span class="pun">=</span><span class="atv">"start"</span><span class="pln"> </span><span class="atn">href</span><span class="pun">=</span><span class="atv">"http://localhost/proyectos/tomates/"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;link</span><span class="pln"> </span><span class="atn">rel</span><span class="pun">=</span><span class="atv">"index"</span><span class="pln"> </span><span class="atn">href</span><span class="pun">=</span><span class="atv">"http://localhost/proyectos/tomates/"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
  </span><span class="tag">&#60;/head&#62;</span><span class="pln">
  </span><span class="tag">&#60;body&#62;&#60;/body&#62;</span><span class="pln">
</span><span class="tag">&#60;/html&#62;</span></a></pre>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:1229px;width:1px;height:1px;">
<h2><a name="Creating_an_(x)HTML_strict">Creating an (x)HTML strict</a></h2>
<p><a name="Creating_an_(x)HTML_strict">Code: </a></p>
<pre class="prettyprint"><a name="Creating_an_(x)HTML_strict"><span class="pln">                $html </span><span class="pun">=</span><span class="pln"> $dom</span><span class="pun">-&#62;</span><span class="pln">type</span><span class="pun">(</span><span class="str">'html'</span><span class="pun">);</span><span class="pln">
                $html</span><span class="pun">-&#62;</span><span class="pln">createHead</span><span class="pun">();</span><span class="pln">
                $html</span><span class="pun">-&#62;</span><span class="pln">setTitle</span><span class="pun">(</span><span class="str">'.: Titulo de la Pagina Web :.'</span><span class="pun">);</span><span class="pln">
                $dom</span><span class="pun">-&#62;</span><span class="pln">render</span><span class="pun">();</span></a></pre>
<p><a name="Creating_an_(x)HTML_strict">Output: </a></p>
<pre class="prettyprint"><a name="Creating_an_(x)HTML_strict"><span class="pun">&#60;?</span><span class="pln">xml version</span><span class="pun">=</span><span class="str">"1.0"</span><span class="pln"> encoding</span><span class="pun">=</span><span class="str">"utf-8"</span><span class="pun">?&#62;</span><span class="pln">
</span><span class="dec">&#60;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://localhost/proyectos/tomates/tomates/include/tdom/tomates/tdom/include/xhtml1-strict.dtd"&#62;</span><span class="pln">
</span><span class="tag">&#60;html</span><span class="pln"> </span><span class="atn">xmlns</span><span class="pun">=</span><span class="atv">"http://www.w3.org/1999/xhtml"</span><span class="tag">&#62;</span><span class="pln">
  </span><span class="tag">&#60;head&#62;</span><span class="pln">
    </span><span class="tag">&#60;title&#62;</span><span class="pln">.: Titulo de la Pagina Web :.</span><span class="tag">&#60;/title&#62;</span><span class="pln">
    </span><span class="tag">&#60;base</span><span class="pln"> </span><span class="atn">href</span><span class="pun">=</span><span class="atv">"http://localhost/proyectos/tomates/"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
</span><span class="com">&#60;!--Aqui comienzan las etiquetas meta--&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"author"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">""</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"generator"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"Tomates Framework"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"description"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">""</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">http-equiv</span><span class="pun">=</span><span class="atv">"Content-Type"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"application/xhtml+xml; charset=utf-8"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">http-equiv</span><span class="pun">=</span><span class="atv">"Content-Script-Type"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">http-equiv</span><span class="pun">=</span><span class="atv">"Content-Style-Type"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"text/css"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"robots"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"all"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">http-equiv</span><span class="pun">=</span><span class="atv">"Content-Language"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">"en_US"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"keywords"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">""</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;meta</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"Revised"</span><span class="pln"> </span><span class="atn">content</span><span class="pun">=</span><span class="atv">": Sep 18 2009"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
</span><span class="com">&#60;!--Aqui terminan las etiquetas meta--&#62;</span><span class="pln">
    </span><span class="tag">&#60;link</span><span class="pln"> </span><span class="atn">rel</span><span class="pun">=</span><span class="atv">"shortcut icon"</span><span class="pln"> </span><span class="atn">href</span><span class="pun">=</span><span class="atv">"http://localhost/proyectos/tomates/application/assets/images/favicon.ico"</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"image/x-icon"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;link</span><span class="pln"> </span><span class="atn">rel</span><span class="pun">=</span><span class="atv">"start"</span><span class="pln"> </span><span class="atn">href</span><span class="pun">=</span><span class="atv">"http://localhost/proyectos/tomates/"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
    </span><span class="tag">&#60;link</span><span class="pln"> </span><span class="atn">rel</span><span class="pun">=</span><span class="atv">"index"</span><span class="pln"> </span><span class="atn">href</span><span class="pun">=</span><span class="atv">"http://localhost/proyectos/tomates/"</span><span class="pln"> </span><span class="tag">/&#62;</span><span class="pln">
  </span><span class="tag">&#60;/head&#62;</span><span class="pln">
  </span><span class="tag">&#60;body&#62;&#60;/body&#62;</span><span class="pln">
</span><span class="tag">&#60;/html&#62;</span></a></pre>
</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Table2Clipboard 1.0 now preserves styles]]></title>
<link>http://dafizilla.wordpress.com/2009/09/14/table2clipboard-1-0-now-preserves-styles/</link>
<pubDate>Mon, 14 Sep 2009 17:49:15 +0000</pubDate>
<dc:creator>dafi</dc:creator>
<guid>http://dafizilla.wordpress.com/2009/09/14/table2clipboard-1-0-now-preserves-styles/</guid>
<description><![CDATA[Finally after almost a year I release a new version of Table2Clipboard, one of twelve extensions tha]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Finally after almost a year I release a new version of <a href="http://dafizilla.sourceforge.net/table2clip/index.php">Table2Clipboard</a>, one of twelve extensions that won in 2008 the <a href="http://labs.mozilla.com/blog/2008/02/announcing-the-extend-firefox-2-winners/">Firefox 2 Contest</a> in the section Runners Up.</p>
<h3>What&#8217;s new</h3>
<p>Until now <a href="http://dafizilla.sourceforge.net/table2clip/index.php">Table2Clipboard</a> has pasted to clipboard the structure of HTML tables without the styles (colors, borders, fonts) but many users have asked me that the behavior was much more similar to that of Internet Explorer (IE) which indeed maintains many details.</p>
<p>Well, the version 1.0 preserves the styles and in certain cases the result is better than that obtained with IE.</p>
<p>IE inserts also the DOM elements declared &#8220;not visible&#8221;, for example the table shown in Figure 1  is pasted in Excel as shown in Figure 2.</p>
<p style="text-align:center;"><a rel="attachment wp-att-757" href="http://dafizilla.wordpress.com/2009/09/14/table2clipboard-1-0-now-preserves-styles/ie-2/" target="_blank"><img class="aligncenter size-full wp-image-757" title="Table selection on Internet Explorer" src="http://dafizilla.wordpress.com/files/2009/09/ie1.png" alt="ie" width="290" height="194" /></a></p>
<p style="text-align:center;"><strong>Figure 1</strong></p>
<p style="text-align:center;"><strong>Table selection on Internet Explorer</strong></p>
<p style="text-align:center;"><a rel="attachment wp-att-762" href="http://dafizilla.wordpress.com/2009/09/14/table2clipboard-1-0-now-preserves-styles/excel-from-ie-2/" target="_blank"><img class="aligncenter size-medium wp-image-762" title="Paste from Internet Explorer to Microsoft Excel" src="http://dafizilla.wordpress.com/files/2009/09/excel-from-ie1.png?w=300" alt="excel-from-ie" width="300" height="91" /></a><strong> </strong></p>
<p style="text-align:center;"><strong>Figure 2</strong></p>
<p style="text-align:center;"><strong>Copy from Internet Explorer paste to Microsoft Excel</strong></p>
<p>Table2Clipboard discards hidden DOM elements as shown in Figure 3, this makes more sense for me.</p>
<p style="text-align:center;"><a rel="attachment wp-att-763" href="http://dafizilla.wordpress.com/2009/09/14/table2clipboard-1-0-now-preserves-styles/excel-from-t2c-2/" target="_blank"><img class="aligncenter size-medium wp-image-763" title="Paste from Firefox with Table2Clipboard to Microsoft Excel" src="http://dafizilla.wordpress.com/files/2009/09/excel-from-t2c1.png?w=300" alt="Paste from Firefox with Table2Clipboard to Microsoft Excel" width="300" height="122" /></a></p>
<p style="text-align:center;"><strong>Figure 3</strong></p>
<p style="text-align:center;"><strong> Copy from Firefox with Table2Clipboard paste to Microsoft Excel</strong></p>
<h3>Other little improvements</h3>
<p>Now web links are copied and user can choose to copy images (tag IMG), too.<br />
All defaults settings can be modified from configuration dialog.</p>
<p>The copy of styles on OpenOffice doesn&#8217;t work as well as the one on Microsoft products.<br />
The &#8220;Paste Special&#8221; feature available on <a href="http://dafizilla.wordpress.com/2009/08/01/table2clipboard-and-clipboard-application-interoperability/">OpenOffice doesn&#8217;t recognize CSS styles</a> but only deprecated tags like FONT.</p>
<p>I will add support for OpenOffice soon but I prefer the &#8220;release early release often&#8221; (after a year??? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ) approach so this version has poor styles support on the popular open source office automation suite.</p>
<p>Compatibility issues with Thunderbird 3.x are now fixed.</p>
<p>Table2Clipboard can be installed from <a href="https://addons.mozilla.org/en/firefox/addon/1852">AMO </a>or from the <a href="http://dafizilla.sourceforge.net/table2clip/index.php">project site on dafizilla</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[JavaFX Forms Framework Part 5]]></title>
<link>http://carlfx.wordpress.com/2009/09/04/javafx-forms-framework-part-5/</link>
<pubDate>Fri, 04 Sep 2009 01:25:12 +0000</pubDate>
<dc:creator>carldea</dc:creator>
<guid>http://carlfx.wordpress.com/2009/09/04/javafx-forms-framework-part-5/</guid>
<description><![CDATA[Introduction Tilghman Island This is the final part in a five part series of entries creating a proo]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h1>Introduction</p>
<div id="attachment_559" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-559" title="Tilghman Island" src="http://carlfx.wordpress.com/files/2009/09/128-2832_img.jpg?w=300" alt="Tilghman Island" width="300" height="225" /><p class="wp-caption-text">Tilghman Island</p></div></h1>
<p><strong>T</strong>his is the final part in a <strong>five</strong> part series of entries creating a proof of concept for a <a href="http://jfxtras.org/portal/samples/all?p_p_id=101_INSTANCE_1Bl5&#38;p_p_lifecycle=0&#38;p_p_state=normal&#38;p_p_mode=view&#38;p_p_col_id=column-2&#38;p_p_col_pos=1&#38;p_p_col_count=2&#38;_101_INSTANCE_1Bl5_struts_action=%2Fasset_publisher%2Fview_content&#38;_101_INSTANCE_1Bl5_urlTitle=mvc-forms-framework-demo&#38;_101_INSTANCE_1Bl5_type=content&#38;redirect=%2Fportal%2Fsamples%2Fall%3Fp_p_id%3D101_INSTANCE_1Bl5%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-2%26p_p_col_pos%3D1%26p_p_col_count%3D2%26_101_INSTANCE_1Bl5_delta%3D15%26_101_INSTANCE_1Bl5_keywords%3D%26_101_INSTANCE_1Bl5_advancedSearch%3Dfalse%26_101_INSTANCE_1Bl5_andOperator%3Dtrue%26cur%3D3">JavaFX forms framework</a>.  Here, I will conclude with some thoughts relating to using JavaFX to build a forms framework. If you are here for the first time I recommend going to the beginning: <a href="http://carlfx.wordpress.com/2009/07/29/javafx-forms-framework-part-1/">Part 1 &#8220;<strong>What is a Forms Framework?</strong>&#8220;</a>.  By now we should know why it is very important to understand the <strong>MVC </strong>architectural pattern and how it applies when building applications (especially form type applications). The forms framework helps provide manageable code and clear boundaries for both the <strong>designer role</strong> and <strong>developer role</strong>. This allows a designer to focus on the usability (look and feel) of the application meanwhile allowing the developer to focus on the service components and business logic. Next, I want to talk about the popular and ambiguous acronym &#8216;<strong>RIA&#8217;</strong> (better known as rich internet application).  You are probably wondering what does RIA have anything to do with a MVC forms framework?  Well, let me try to explain. To some people &#8216;RIA&#8217; is a buzzword and to some people its actually a tangible software development platform. I have a hunch that some people are not convinced they should jump on the bandwagon or not.  But whatever you choose to agree with, I believe as we slowly become convinced what RIA is and how it fits into our domain an MVC forms framework should always be considered when building larger scale forms based applications. I want to begin by discussing RIA from a Swing/Web/Enterprise developer point of view (considering that&#8217;s my background).</p>
<h1>Swing/Web/Enterprise Developer</h1>
<p>Like most of us who had previously come from an enterprise background noticed the <a href="http://en.wikipedia.org/wiki/Web_2.0">Web 2.0</a> looking applications getting lots of attention.  Whenever I hear the word <a href="http://en.wikipedia.org/wiki/Rich_Internet_application"><strong>RIA</strong></a>, I really  think that it should be called  &#8220;<strong>Rich Applications</strong>&#8221; and drop the &#8216;<strong>I</strong>&#8216; because all clients should look and feel great regardless if they were connected to the Internet or not. So<strong>, usability</strong> is key to making client side applications connect with users. This year I was fortunate to go to <a href="http://carlfx.wordpress.com/2009/05/31/javaone-minute/">JavaOne 2009</a> and experience all things <strong>rich client</strong> (some enterprise) and one of my last sessions was about <a href="http://benzilla.galbraiths.org/2009/06/04/craftmanship/">Craftsmanship in Software</a> from Ben Galbraith. He mentions &#8220;<strong>the most important aspect of software creation: crafting an amazing user experience</strong>.&#8221; This makes me realize that as applications become richer, consumers will demand richer content (a vicious cycle).  But,  I still believe  <strong>enterprise-y</strong> looking applications (not so flashy)  using Swing will still have its place in the world of rich client. When developing rich clients I&#8217;ve found <strong>Swing GUI</strong> development to be quite pleasant to work with, however at times certain things  seem pretty hard to do such as animation, binding, and validation.</p>
<p><div class="wp-caption alignnone" style="width: 570px"><a href="http://commons.wikimedia.org/wiki/File:Martin_Jetpack_Unveiling,_Liftoff!_%282714934801%29.jpg"><img class=" " title="Martin Jetpack" src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/67/Martin_Jetpack_Unveiling%2C_Liftoff%21_%282714934801%29.jpg/800px-Martin_Jetpack_Unveiling%2C_Liftoff%21_%282714934801%29.jpg" alt="Martin Jet Pack" width="560" height="374" /></a><p class="wp-caption-text">Martin Jet Pack</p></div>
<hr />
<h1>JavaFX</h1>
<p>If you are like me who enjoys software development will learn over time some good proverbs and principles that surface. One saying I’ve heard was “<strong>Letting Go of Your Bananas</strong>”, which can be applied to your life and not just software. In terms of software I feel its OK to let go of some things and embrace other things. So, it&#8217;s healthy to be early adopters, but always keeping in the back of your mind past concepts that are tried and true.  An example would be &#8220;Swing/Web Frameworks&#8221; where everyone created their own or used the vast number of open-source libraries out there.</p>
<div class="wp-caption alignnone" style="width: 586px"><a href="http://commons.wikimedia.org/wiki/File:Rocket_man_-_melbourne_show_2005.jpg"><img class="  " title="Rocket man - melbourne show" src="http://upload.wikimedia.org/wikipedia/commons/1/1f/Rocket_man_-_melbourne_show_2005.jpg" alt="Rocket man - melbourne show (Fir0002/Flagstaffotos)" width="576" height="384" /></a><p class="wp-caption-text">Rocket man - melbourne show (Fir0002/Flagstaffotos)</p></div>
<h1>Conclusion</h1>
<p>As the JavaFX community matures I believe  forms based frameworks, GUI tools and application frameworks should start appearing, making many developers&#8217; jobs much easier. I think there will be a day where Java developers around the world will not think &#8216;<strong><em>Swing is Hard</em></strong>&#8216;, but say &#8216;<strong><em>JavaFX is extremely Easy</em></strong>&#8216;. I encourage you as the reader to explore and learn as much as you can about JavaFX because it&#8217;s not every day that you can start from the beginning to learn a soon-to-be-popular language. Enjoy!</p>
<dl class="wp-caption alignright">
<dt> </dt>
</dl>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Flex Fundamentals]]></title>
<link>http://meghsoft.wordpress.com/2009/08/29/flex-fundamentals/</link>
<pubDate>Sat, 29 Aug 2009 18:35:10 +0000</pubDate>
<dc:creator>meghsoft</dc:creator>
<guid>http://meghsoft.wordpress.com/2009/08/29/flex-fundamentals/</guid>
<description><![CDATA[The Origins of Flex Originally Flash content was created with the Flash multimedia-authoring program]]></description>
<content:encoded><![CDATA[The Origins of Flex Originally Flash content was created with the Flash multimedia-authoring program]]></content:encoded>
</item>
<item>
<title><![CDATA[JavaFX Forms Framework Part 4]]></title>
<link>http://carlfx.wordpress.com/2009/08/29/javafx-forms-framework-part-4/</link>
<pubDate>Sat, 29 Aug 2009 16:03:45 +0000</pubDate>
<dc:creator>carldea</dc:creator>
<guid>http://carlfx.wordpress.com/2009/08/29/javafx-forms-framework-part-4/</guid>
<description><![CDATA[Introduction (Updated)** Added JavaFX Script code to represent a display panel mapping instead of th]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h1>Introduction <span style="color:#ff0000;"> </span></h1>
<p><span style="color:#ff0000;"><strong>(Updated)<span style="color:#000000;">** <span style="color:#0000ff;">Added </span></span><span style="color:#000000;"><span style="color:#0000ff;">JavaFX Script code</span></span></strong><strong><span style="color:#000000;"><span style="color:#0000ff;"> to represent a display panel mapping instead of the XML format example in the &#8216;User of the API (Application Developer)&#8217; section.</span></span></strong></span></p>
<p><span style="color:#ff0000;"><strong><span style="color:#000000;"> </span></strong><span style="color:#000000;"><span style="color:#000000;">(Thanks! </span></span></span><a href="http://jroller.com/aalmiray/">Andres Almiray</a>)<span style="color:#ff0000;"><span style="color:#000000;"><span style="color:#000000;"> </span></span></span></p>
<p><span style="color:#ff0000;"><strong><span style="color:#000000;"><br />
</span></strong></span></p>
<p style="text-align:left;"><strong>T</strong>his is the forth installment of a series of blog entries relating to a proof of concept for a <strong><a href="http://www.javafx.com/">JavaFX</a> Forms Framework</strong>.</p>
<div class="wp-caption alignright" style="width: 262px"><img title="Scott McNealy" src="http://farm3.static.flickr.com/2459/3604769345_35328d2fd7.jpg" alt="Chairman and Co-Founder, Sun Microsystems. (person on the left)" width="252" height="189" /><p class="wp-caption-text">Chairman and Co-Founder, Sun Microsystems. (person on the left) </p></div>
<p style="text-align:left;">If you missed the beginning of the series you may go to <a href="../2009/07/29/javafx-forms-framework-part-1/"><strong>Part 1</strong></a>, <a href="../2009/08/03/javafx-forms-framework-part-2/"><strong>Part 2</strong></a> and <a href="../2009/08/20/javafx-forms-framework-part-3/"><strong>Part 3</strong></a>. Before we discuss this section I want to recap for those who have been following along. <strong>Part 1</strong> explains “<strong>What is a Form based framework?</strong>” and a <strong>demo application</strong>. <strong>Part 2</strong> describes the <strong>requirements</strong> and <strong>design</strong>. <strong>Part 3</strong> are the implementation details. As we near the end of the series in <strong>Part 4</strong> we will discuss <strong>enhancements</strong> that could be added to improve the <strong>FXForms</strong> framework. Below is a summary of the <strong>features</strong> from two user perspectives, first being the ‘<strong>User of the API</strong>’ and secondly the ‘<strong>User of the application</strong>’. I will <strong>only</strong> explain in detail the &#8216;<strong>User of the API</strong>&#8216; perspective.</p>
<h1>Features</h1>
<p><span style="color:#800080;"><strong><span style="color:#0000ff;">User of the API (Application Developer)</span><br />
</strong></span></p>
<ul>
<li><strong>Mapping files (forms to beans)</strong></li>
<li><strong>GUI Component factory &#8211; make use of other controls</strong></li>
</ul>
<p><span style="color:#0000ff;"><strong>User of the application (User experience)</strong></span></p>
<ul>
<li><strong>Icon error, warn, info indicators overlay</strong></li>
</ul>
<blockquote>
<ol>
<li>Override images to load and position when validation occurs.</li>
<li>Error / Exceptions / Global errors</li>
<li>Tooltips</li>
</ol>
</blockquote>
<ul>
<li><strong>Transitions to forms (fading, sliding, etc)<br />
</strong></li>
<li><strong>Focus Policy<br />
</strong></li>
<li><strong>User feedback (block gui visually) busy, indeterminate state.</strong></li>
<li><strong>Skinning and Themes for Forms</strong></li>
<li><strong>Context sensitive help</strong></li>
<li><strong>Sound effects</strong></li>
</ul>
<h2 style="text-align:left;">User of the API (Application Developer)</h2>
<p>The goal here is to make life easier for the Application developer developing <strong>JavaFX Forms</strong>.</p>
<p>The features are as follows:</p>
<ul>
<li>Mapping Files – This provides custom bindings to field elements and bean properties. Also provides mappings for actions and controls.</li>
<li>GUI Component factories – Display panel managers (form manager) to assemble and wrap components to provide presentation model pattern behavior.</li>
</ul>
<p><strong>1) Mapping files (forms to beans) </strong>–      Display panels (forms) will be mapped to a particular Java Bean class.      Each field will be mapped based on the bean property ‘<strong>name</strong>’ and the GUI widget’s ‘<strong>id</strong>’ attribute. When defining a display panel <span style="text-decoration:line-through;">in XML it is a      good idea to create a <a href="http://en.wikipedia.org/wiki/Document_Type_Definition"><strong>DTD</strong></a> or <a href="http://en.wikipedia.org/wiki/XML_schema"><strong>Schema</strong></a>, but for brevity I will not create      them, and I will describe each <strong>XML</strong> element in detail such as default values,      enumerated types, etc. </span>an object representing fields and their corresponding bindings and actions will be called a &#8216;Display Panel Metadata&#8217; object.</p>
<p>When mapping fields and controls here are situations you will encounter:</p>
<blockquote>
<ul>
<li>Nested properties &#8211; Nested objects ie: Person references an object Address with a property called <strong>city</strong>. (use  &#8216;<strong>address.city</strong>&#8216;)</li>
<li>Mapping bean properties with different GUI component ids. ie: Person bean property is &#8216;<strong>fName</strong>&#8216; and the TextBox&#8217;s id is &#8216;<strong>firstName</strong>&#8216;</li>
<li>Custom bindings (list models single select, multi-select and contains all). ie: ListBox containing all objects in a collection owned by Person.</li>
<li>Action mappings to events and controls. ie: Buttons are mapped to functions in modules (script level functions).</li>
</ul>
</blockquote>
<p><span style="text-decoration:line-through;"><strong>Below is an example of an XML mapping file might look like:</strong></span></p>
<p><strong>Please skip this mapping file and go to JavaFX script code right after it. XML mapping file is replaced by JavaFX script code.<br />
</strong></p>
<p><strong><span style="color:#000000;"> </span><br />
</strong></p>
<pre><span style="color:#a65700;">&#60;</span><span style="text-decoration:line-through;"><span style="color:#5f5035;">displayPanels</span></span><span style="color:#a65700;">&#62;</span>
  <span style="color:#696969;">&#60;!--
  <span style="color:#ff0000;"><strong>*************************************************************************
</strong></span></span><span style="color:#ff0000;"><strong>  </strong><strong>**** NO LONGER IN USE, DEPRECATED,                                  *****
  **** Please </strong></span><span style="color:#ff0000;"><strong><strong>DISREGARD.</strong></strong></span>
<span style="color:#ff0000;"><strong>  **** REPLACED WITH JavaFX DisplayPanelMetadata class                *****
  <strong>*************************************************************************</strong></strong></span>
<span style="color:#696969;">  --------------------------------</span>
<span style="color:#696969;">  - Full Name Form Display Panel -</span>
<span style="color:#696969;">  --------------------------------</span>
<span style="color:#696969;">  This describes all gui widgets and actions.</span>
<span style="color:#696969;">    * Text control bound to a different named bean property 'fName'</span>
<span style="color:#696969;">    * Radio buttons bound to bean property 'likesFood'</span>
<span style="color:#696969;">    * Spinner control bound to bean property 'dateOfBirth'</span>
<span style="color:#696969;">    * Spinner control bound to bean property 'shoeSize'</span>
<span style="color:#696969;">    * List or combo control bound to nested bean property 'address.state'</span>
<span style="color:#696969;">    * List box control bound to nested bean property 'contacts' (collection)</span>
<span style="color:#696969;">    * List box control bound to nested bean property 'relatives' (collection)</span>
<span style="color:#696969;">    * Button control bound to action handler </span>
<span style="color:#696969;">  --&#62;</span>
  <span style="text-decoration:line-through;"><span style="color:#a65700;">&#60;</span><span style="color:#5f5035;">displayPanel</span><span style="color:#274796;"> </span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"FullNameForm"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">    className</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"com.company.forms.FullNameForm"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">    beanClass</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"com.company.domain.model.PersonBean"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">    presentationModel</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"com.company.domain.model.personpresentationmodel.EditPersonPM"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">    reuseForm</span><span style="color:#808030;">=</span><span style="color:#274796;">”true”</span><span style="color:#a65700;">&#62;</span></span>

    <span style="color:#696969;">&#60;!--First Name Field --&#62;</span>
    <span style="color:#a65700;">&#60;</span><span style="text-decoration:line-through;"><span style="color:#5f5035;">textControl</span><span style="color:#274796;"> </span></span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"firstName"</span><span style="color:#274796;"> </span><span style="color:#074726;">name</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"fName"</span><span style="color:#a65700;">/&#62;</span>

    <span style="color:#696969;">&#60;!-- Likes Food (yes or no)--&#62;</span>
    <span style="color:#a65700;">&#60;</span><span style="text-decoration:line-through;"><span style="color:#5f5035;">radioButton</span><span style="color:#274796;"> </span></span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#274796;">”no”</span>
<span style="color:#274796;">      </span><span style="color:#074726;">name</span><span style="color:#808030;">=</span><span style="color:#274796;">”likesFood”</span>
<span style="color:#274796;">      selectedValue</span><span style="color:#808030;">=</span><span style="color:#274796;">”true”</span>
<span style="color:#274796;">      bindingType</span><span style="color:#808030;">=</span><span style="color:#274796;">”BOOLEAN_TYPE”</span><span style="color:#a65700;">/&#62;</span>
    <span style="color:#a65700;">&#60;</span><span style="text-decoration:line-through;"><span style="color:#5f5035;">radioButton</span><span style="color:#274796;"> </span></span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#274796;">”yes”</span>
<span style="color:#274796;">      </span><span style="color:#074726;">name</span><span style="color:#808030;">=</span><span style="color:#274796;">”likesFood”</span>
<span style="color:#274796;">      selectedValue</span><span style="color:#808030;">=</span><span style="color:#274796;">”false”</span>
<span style="color:#274796;">      bindingType</span><span style="color:#808030;">=</span><span style="color:#274796;">”BOOLEAN_TYPE”</span><span style="color:#a65700;">/&#62;</span>

    <span style="color:#696969;">&#60;!--Date of Birth Spinner control--&#62;</span>
    <span style="color:#a65700;">&#60;</span><span style="text-decoration:line-through;"><span style="color:#5f5035;">spinner</span><span style="color:#274796;"> </span></span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#274796;">”dob”</span>
<span style="color:#274796;">      </span><span style="color:#074726;">name</span><span style="color:#808030;">=</span><span style="color:#274796;">”dateOfBirth”</span>
<span style="color:#274796;">      defaultValue</span><span style="color:#808030;">=</span><span style="color:#274796;">”null”</span>
<span style="color:#274796;">      bindingType</span><span style="color:#808030;">=</span><span style="color:#274796;">”DATE_TYPE”</span><span style="color:#a65700;">/&#62;</span>

    <span style="color:#696969;">&#60;!--Shoe Size Spinner control--&#62;</span>
    <span style="color:#a65700;">&#60;</span><span style="text-decoration:line-through;"><span style="color:#5f5035;">spinner</span><span style="color:#274796;"> </span></span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#274796;">”shoeSize”</span>
<span style="color:#274796;">      </span><span style="color:#074726;">name</span><span style="color:#808030;">=</span><span style="color:#274796;">”shoeSize”</span>
<span style="color:#274796;">      defaultValue</span><span style="color:#808030;">=</span><span style="color:#274796;">”5”</span>
<span style="color:#274796;">      minimumValue</span><span style="color:#808030;">=</span><span style="color:#274796;">”2”</span>
<span style="color:#274796;">      maxValue</span><span style="color:#808030;">=</span><span style="color:#274796;">”18”</span>
<span style="color:#274796;">      stepValue</span><span style="color:#808030;">=</span><span style="color:#274796;">”1”</span>
<span style="color:#274796;">      bindingType</span><span style="color:#808030;">=</span><span style="color:#274796;">”NUMBER” </span><span style="color:#a65700;">/&#62;</span>

    <span style="color:#696969;">&#60;!--US State Drop Down List control--&#62;</span>
    <span style="color:#a65700;">&#60;</span><span style="text-decoration:line-through;"><span style="color:#5f5035;">listModel</span><span style="color:#274796;"> </span></span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"address.state"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">      uniqueElementProperty</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"code"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">      displayName</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"${name}"</span><span style="color:#274796;"> </span><span style="color:#a65700;">/&#62;</span>

    <span style="color:#696969;">&#60;!--Contacts List Box control--&#62;</span>
    <span style="color:#a65700;">&#60;</span><span style="text-decoration:line-through;"><span style="color:#5f5035;">listModel</span><span style="color:#274796;"> </span></span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"contacts"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">      uniqueElementProperty</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"id"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">      displayName</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"${firstName} ${lastName} – (${id})"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">      bindingType</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"MULTIPLE_SELECT"</span><span style="color:#274796;"> </span><span style="color:#a65700;">/&#62;</span>

    <span style="color:#696969;">&#60;!--Relatives List Box control--&#62;</span>
    <span style="color:#a65700;">&#60;</span><span style="text-decoration:line-through;"><span style="color:#5f5035;">listModel</span><span style="color:#274796;"> </span></span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"relatives"</span>
<span style="color:#274796;">      </span><span style="color:#074726;">name</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"relatives"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">      uniqueElementProperty</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"id"</span>
<span style="color:#274796;">      displayName</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"${firstName} ${lastName} – (${id})"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">      bindingType</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"CONTAINS_ALL"</span><span style="color:#274796;"> </span><span style="color:#a65700;">/&#62;</span>

    <span style="color:#696969;">&#60;!--Save Button control--&#62;</span>
    <span style="color:#a65700;">&#60;</span><span style="text-decoration:line-through;"><span style="color:#5f5035;">action</span><span style="color:#274796;"> </span></span><span style="color:#074726;">id</span><span style="color:#808030;">=</span><span style="color:#274796;">”saveAction” </span>
<span style="color:#274796;">      </span><span style="color:#074726;">name</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"saveAction"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">      module</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"com.company.domain.forms.personactions"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">      function</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"updatePerson"</span><span style="color:#274796;"> </span>
<span style="color:#274796;">      listener</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"java.awt.event.ActionListener"</span><span style="color:#a65700;">/&#62;</span>
<span style="text-decoration:line-through;">
  <span style="color:#a65700;">&#60;/</span><span style="color:#5f5035;">displayPanel</span><span style="color:#a65700;">&#62;</span>
<span style="color:#a65700;">&#60;/</span><span style="color:#5f5035;">displayPanels</span></span><span style="color:#a65700;"><span style="text-decoration:line-through;">&#62;</span>
</span></pre>
<p><strong>Line 15-19</strong> Defines a form or display panel.</p>
<p><strong>Line 22</strong> Maps a text field when a bean property and GUI control are named differently. Framework should assume if the name and id are the same and at text control developer doesn&#8217;t need to map. <span style="text-decoration:line-through;">This keeps the XML mapping file smaller.</span></p>
<p><strong>Line 24-32</strong> Custom binding for radio controls. Other scenarios exist, but for a simple boolean value selection the &#8216;BOOLEAN_TYPE&#8217;</p>
<p><strong>Line 34-38</strong> Custom binding for a JSpinner. The bean property is a java.util.Date.</p>
<p><strong>Line 41-47</strong> Custom binding for a JSpinner. The bean property is an int.</p>
<p><strong>Line 49-52</strong> Custom binding for a dropdown list. The bean property is a java.lang.String. Notice the nested properties. When a form displays a nested property on the same form.</p>
<p><strong>Line 54-58</strong> Custom binding for a List box. This is not bound to a bean property but a populated list allowing the user to select multiple items.</p>
<p><strong>Line 60-65</strong> Custom binding for a List box. This is bound to a bean property referencing a collection of objects. Notice the &#8220;CONTAINS_ALL&#8221; which means all items in the list box are synchronized inside the collection.</p>
<p><strong>Line 67-72</strong> Action mapping for a button on the form. They are named so actions can be reused such as menu or toolbar.</p>
<p><strong>Disregard the XML mapping file above. The same representation is below in JavaFX script code defining a display panel.</strong></p>
<p><strong><span style="color:#ff0000;">**IMPORTANT NOTE</span>: <span style="color:#0000ff;">Since JavaFX is a declarative language which can achieve the same thing as a mapping file, I have re done the XML in JavaFX below:</span></strong></p>
<pre><span style="color:#800000;font-weight:bold;">var</span> displayPanelMetadata<span style="color:#800080;">:</span>DisplayPanelMetadata <span style="color:#808030;">=</span>  DisplayPanelMetadata <span style="color:#800080;">{</span>
  id<span style="color:#800080;">:</span> <span style="color:#0000e6;">"FullNameForm"</span>
  className<span style="color:#800080;">:</span> <span style="color:#0000e6;">"com.company.forms.FullNameForm"</span>
  reuseForm<span style="color:#800080;">:</span> <span style="color:#0f4d75;">true</span>

  <span style="color:#696969;">// Custom bindings to field elements</span>
  customBindings<span style="color:#800080;">:</span> <span style="color:#808030;">[</span>
    <span style="color:#696969;">// First Name Field </span>
    TextControlMetadata<span style="color:#800080;">{</span>
        id<span style="color:#800080;">:</span> <span style="color:#0000e6;">"firstName"</span>
        name<span style="color:#800080;">:</span> <span style="color:#0000e6;">"fName"</span>
    <span style="color:#800080;">}</span><span style="color:#808030;">,</span>

    <span style="color:#696969;">// Likes Food (yes or no)</span>
    RadioButtonMetadata <span style="color:#800080;">{</span>
        id<span style="color:#800080;">:</span> <span style="color:#0000e6;">"no"</span>
        name<span style="color:#800080;">:</span> <span style="color:#0000e6;">"likesFood"</span>
        selectedValue<span style="color:#800080;">:</span> <span style="color:#0000e6;">"false"</span>
        bindingType<span style="color:#800080;">:</span><span style="color:#0000e6;">"BOOLEAN_TYPE"</span>
    <span style="color:#800080;">}</span><span style="color:#808030;">,</span>

    RadioButtonMetadata <span style="color:#800080;">{</span>
        id<span style="color:#800080;">:</span> <span style="color:#0000e6;">"yes"</span>
        name<span style="color:#800080;">:</span> <span style="color:#0000e6;">"likesFood"</span>
        selectedValue<span style="color:#800080;">:</span> <span style="color:#0000e6;">"true"</span>
        bindingType<span style="color:#800080;">:</span><span style="color:#0000e6;">"BOOLEAN_TYPE"</span>
    <span style="color:#800080;">}</span><span style="color:#808030;">,</span>

    <span style="color:#696969;">// Date of Birth Spinner control</span>
    SpinnerMetadata <span style="color:#800080;">{</span>
        id<span style="color:#800080;">:</span> <span style="color:#0000e6;">"dob"</span>
        name<span style="color:#800080;">:</span> <span style="color:#0000e6;">"dateOfBirth"</span>
        defaultValue<span style="color:#800080;">:</span><span style="color:#0000e6;">"null"</span>
        bindingType<span style="color:#800080;">:</span> <span style="color:#0000e6;">"DATE_TYPE"</span>
    <span style="color:#800080;">}</span><span style="color:#808030;">,</span>

    <span style="color:#696969;">// shoe size</span>
    SpinnerMetadata <span style="color:#800080;">{</span>
        id<span style="color:#800080;">:</span> <span style="color:#0000e6;">"shoeSize"</span>
        name<span style="color:#800080;">:</span> <span style="color:#0000e6;">"shoeSize"</span>
        defaultValue<span style="color:#800080;">:</span> <span style="color:#0000e6;">"5"</span>
        minimumValue<span style="color:#800080;">:</span> <span style="color:#0000e6;">"2"</span>
        maxValue<span style="color:#800080;">:</span> <span style="color:#0000e6;">"18"</span>
        stepValue<span style="color:#800080;">:</span> <span style="color:#0000e6;">"1"</span>
        bindingType<span style="color:#800080;">:</span> <span style="color:#0000e6;">"NUMBER_TYPE"</span>
    <span style="color:#800080;">}</span><span style="color:#808030;">,</span>

    <span style="color:#696969;">// state selection</span>
    ListModelMetadata <span style="color:#800080;">{</span>
        id<span style="color:#800080;">:</span> <span style="color:#0000e6;">"address.state"</span>
        uniqueElementProperty<span style="color:#800080;">:</span><span style="color:#0000e6;">"code"</span>
        displayName<span style="color:#800080;">:</span><span style="color:#0000e6;">"${name}"</span>
    <span style="color:#800080;">}</span><span style="color:#808030;">,</span>

    <span style="color:#696969;">// contacts List Box control (not bound to bean)</span>
    ListModelMetadata <span style="color:#800080;">{</span>
        id<span style="color:#800080;">:</span> <span style="color:#0000e6;">"contacts"</span>
        uniqueElementProperty<span style="color:#800080;">:</span><span style="color:#0000e6;">"id"</span>
        displayName<span style="color:#800080;">:</span> <span style="color:#0000e6;">"${firstName} ${lastName} – (${id})"</span>
        bindingType<span style="color:#800080;">:</span> <span style="color:#0000e6;">"MULTIPLE_SELECT"</span>
    <span style="color:#800080;">}</span><span style="color:#808030;">,</span>

    <span style="color:#696969;">// relatives(family) List Box control</span>
    ListModelMetadata <span style="color:#800080;">{</span>
        id<span style="color:#800080;">:</span> <span style="color:#0000e6;">"relatives"</span>
        name<span style="color:#800080;">:</span> <span style="color:#0000e6;">"relatives"</span>
        uniqueElementProperty<span style="color:#800080;">:</span><span style="color:#0000e6;">"id"</span>
        displayName<span style="color:#800080;">:</span> <span style="color:#0000e6;">"${firstName} ${lastName} – (${id})"</span>
        bindingType<span style="color:#800080;">:</span> <span style="color:#0000e6;">"CONTAINS_ALL"</span>
    <span style="color:#800080;">}</span>
  <span style="color:#808030;">]</span> <span style="color:#696969;">// custom bindings sequence</span>

  <span style="color:#696969;">// Save Button control</span>
  actions<span style="color:#800080;">:</span><span style="color:#808030;">[</span>
      ActionMetaData <span style="color:#800080;">{</span>
      name<span style="color:#800080;">:</span> <span style="color:#0000e6;">"saveAction"</span>
      module<span style="color:#800080;">:</span> <span style="color:#0000e6;">"com.company.domain.forms.personactions"</span>
      functionReference<span style="color:#800080;">:</span> <span style="color:#0000e6;">"updatePerson"</span>
    <span style="color:#800080;">}</span>

    <span style="color:#808030;">]</span> <span style="color:#696969;">// actions</span>

<span style="color:#800080;">}</span> <span style="color:#696969;">//displayPanel</span></pre>
<p><strong>Line 0-3</strong> Defines a form or display panel.</p>
<p><strong>Line 8-11</strong> Maps a text field when a bean property and GUI control are named differently. Framework should assume if the name and id are the same and at text control developer doesn&#8217;t need to map. This keeps the metadata mapping info smaller.</p>
<p><strong>Line 14-19</strong> Custom binding for radio controls. Other scenarios exist, but for a simple boolean value selection the &#8216;BOOLEAN_TYPE&#8217;</p>
<p><strong>Line 29-34</strong> Custom binding for a JSpinner. The bean property is a java.util.Date.</p>
<p><strong>Line 37-45</strong> Custom binding for a JSpinner. The bean property is an int.</p>
<p><strong>Line 48-52</strong> Custom binding for a dropdown list. The bean property is a java.lang.String. Notice the nested properties. When a form displays a nested property on the same form.</p>
<p><strong>Line 55-60</strong> Custom binding for a List box. This is not bound to a bean property but a populated list allowing the user to select multiple items.</p>
<p><strong>Line 63-69</strong> Custom binding for a List box. This is bound to a bean property referencing a collection of objects. Notice the &#8220;CONTAINS_ALL&#8221; which means all items in the list box are synchronized inside the collection.</p>
<p><strong>Line 74-77</strong> Action mapping for a button on the form. They are named so actions can be reused such as menu or toolbar.</p>
<p><strong>2) GUI Component factory – make use of other controls</strong></p>
<p>Forms can be retrieved and populated using convenient factory functions. When assembling a form and mapping properties the underlying implementation may have a configuration file to have modular ways to specify what controls will be used for binding controls.<br />
<code><br />
var <strong>personForm</strong> = FormManager.retrieveForm(personBean, 'FullNameForm');<br />
</code></p>
<h1>Conclusion</h1>
<p>While some features of the &#8216;<strong>User of the Application</strong>&#8216; perspective may seem debatable, I believe a forms framework should at least have all the features described in the &#8216;<strong>User of the APIs</strong>&#8216; perspective. As a framework implementer one should design a plug-able architecture for custom components. Components should be wrapped and registered when assembling a form. I&#8217;m sure there are many features I have not mentioned.  As JavaFX matures I believe  GUI builders providing WYSIWYG development will eventually allow third party GUI controls to be added to their control palette. Next, I will discuss <strong><a href="http://carlfx.wordpress.com/2009/09/04/javafx-forms-framework-part-5/">Part 5 Concluding thoughts</a>.</strong></p>
<p>Like always, any comments are welcome!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[JavaFX Forms Framework Part 3]]></title>
<link>http://carlfx.wordpress.com/2009/08/20/javafx-forms-framework-part-3/</link>
<pubDate>Thu, 20 Aug 2009 06:13:53 +0000</pubDate>
<dc:creator>carldea</dc:creator>
<guid>http://carlfx.wordpress.com/2009/08/20/javafx-forms-framework-part-3/</guid>
<description><![CDATA[Introduction Matthew 7:13-14 This is the third installment of a series of blog entries relating to a]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h1>Introduction</h1>
<div id="attachment_456" class="wp-caption alignright" style="width: 235px"><img class="size-medium wp-image-456" title="Ancient of Days" src="http://carlfx.wordpress.com/files/2009/08/acient.jpg?w=225" alt="Matthew 7:13-14" width="225" height="300" /><p class="wp-caption-text">Matthew 7:13-14</p></div>
<p style="text-align:left;"><strong>T</strong>his is the third installment of a series of blog entries relating to a proof of concept for a <strong><a href="http://www.javafx.com">JavaFX</a> Forms Framework</strong>. If you missed the beginning of the series you may go to <a href="http://carlfx.wordpress.com/2009/07/29/javafx-forms-framework-part-1/"><strong>Part 1</strong></a> and <a href="http://carlfx.wordpress.com/2009/08/03/javafx-forms-framework-part-2/"><strong>Part 2</strong></a>. We will take a look at code snippets relating to how the FXForms Framework was implemented. If you want to jump right into the code you may download it <a href="http://jfxtras.org/portal/c/document_library/get_file?p_l_id=11535&#38;folderId=25048&#38;name=DLFE-1304.zip"><span style="text-decoration:underline;"><strong>here</strong></span></a> or browse the source code <span style="text-decoration:underline;"><span style="color:#0000ff;"><a href="http://code.google.com/p/jfxtras/source/browse/#svn/jfxtras.samples/trunk/CarlFX/fxforms" target="_blank"><strong>here</strong></a></span></span> from the <a href="http://code.google.com/p/jfxtras/source/browse/#svn/jfxtras.samples"><strong>JFXtras Samples</strong></a> area. To those who are following the series will notice similarities to <strong><a href="http://www.jgoodies.com/index.html">JGoodies</a> Bindings </strong>and <strong>Validation </strong><a href="http://www.jgoodies.com/downloads/libraries.html">libraries</a>, it is because of those libraries and <a href="http://www.jgoodies.com/articles/">presentations</a> which basically inspired me to create this <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller"><strong>MVC</strong></a> <strong>forms framework</strong> in <strong>JavaFX</strong>.</p>
<p style="text-align:left;"><strong>Disclaimer:</strong> Most of the code snippets will deal with the <strong>user of the API&#8217;s perspective</strong> as opposed to the <strong>implementer of the API&#8217;s perspective</strong> in order to keep the blog entry short. I will try my best to touch on areas regarding the framework&#8217;s underlying implementation. I advise people to check the code project out, review it and run it.</p>
<p>A thing I&#8217;d like to bring to your attention is that I decided to refactor the code a little and add a <strong>new</strong> feature to the <strong>FXForms Framework</strong>. I refactored the form to reference an instance of a presentation model instead of inheriting from it. As I mentioned in <strong><a href="../2009/08/03/javafx-forms-framework-part-2/"><strong>Part 2</strong></a></strong> the form will be independent of the presentation model. This provides different validation contexts while reusing the same form. An example of this situation is when a user uses a form to ‘<strong>Add</strong>’ information versus an ‘<strong>Edit</strong>’ of the form information. The new feature added is the ability to validate a field as the user is typing into the text box and positions an <strong>icon </strong>to indicate an <strong>error, warning or information </strong>to the user. Another feature might be to add <strong>tool tips</strong> when the mouse hovers over the icon similar to JGoodies’ <a href="http://www.jgoodies.com/products/images/validation/icons.png">IconFeedbackPanel</a> behavior in Java Swing. Before going further into the implementation details you may want to launch the <a href="http://jfxtras.org/portal/c/document_library/get_file?p_l_id=11535&#38;folderId=25048&#38;name=DLFE-1303.jnlp"><strong>demo</strong> </a>to get a feel for the behavior of the entry form with validation and icon indicators.</p>
<p style="text-align:center;">
<div id="attachment_472" class="wp-caption aligncenter" style="width: 98px"><a href="http://jfxtras.org/portal/c/document_library/get_file?p_l_id=11535&#38;folderId=25048&#38;name=DLFE-1303.jnlp"><img class="size-full wp-image-472  " title="Click to Launch" src="http://carlfx.wordpress.com/files/2009/08/webstart.gif" alt="Demo" width="88" height="23" /></a><p class="wp-caption-text">Demo</p></div>
<p><strong>Instructions:</strong></p>
<ul>
<li>Enter numbers or symbols into the first, last and middle name field.</li>
<li>Click on the check box to swap the <a href="http://weblogs.java.net/blog/rbair/archive/2006/05/the_unknown_jav.html"><strong>JavaBean</strong></a> for the form.</li>
<li>Observe the underlying bean values changing.</li>
</ul>
<p>Next are the steps on how to develop the demo using the <strong>FXForms Framework</strong>.</p>
<h1>Developer Steps</h1>
<ol>
<li>Create a <strong>JavaBean</strong> representing a domain object.</li>
<li>Create a <strong>Presentation Model</strong> with <strong>validation</strong> for a Form.</li>
<li>Create a <strong>Form</strong></li>
<li>Associate a <strong>Presentation Model to Form</strong></li>
<li>Use the <strong>Form </strong>in an application</li>
</ol>
<h1>Detailed Steps</h1>
<p style="text-align:left;"><strong><span style="color:#0000ff;">Step 1. Create a JavaBean representing a domain object.</span></strong></p>
<pre>// Java
<span style="color:#993300;">public class <strong>PersonBean</strong> extends <strong>DomainModel</strong></span>{
    <strong><span style="color:#993300;">public static final String FIRST_NAME_PROPERTY = "firstName";</span></strong>
    public static final String MIDDLE_NAME_PROPERTY = "middleName";
... // more strings naming properties
    <strong><span style="color:#993300;">private String firstName;</span></strong>
    private String middleName;
... // more attributes

    /**
     * Returns first name of the person.
     * @return
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     * Sets the first name of the person.
     * @param firstName
     */
    public void setFirstName(String firstName) {
        String old = this.firstName;
        this.firstName = firstName;
        <strong><span style="color:#993300;">firePropertyChange(FIRST_NAME_PROPERTY, old, firstName);</span></strong>
    }
... // the rest of the methods.
}</pre>
<p><strong><a href="http://code.google.com/p/jfxtras/source/browse/jfxtras.samples/trunk/CarlFX/fxforms/test/domain/model/PersonBean.java">PersonBean.java</a> </strong>- A domain object containing property change support.</p>
<p><a href="http://code.google.com/p/jfxtras/source/browse/jfxtras.samples/trunk/CarlFX/fxforms/src/fxforms/model/DomainModel.java"><strong>DomainModel.java</strong></a> &#8211; Abstract base class containing property change support.</p>
<p><span style="color:#0000ff;"><strong>Step 2. Create a Presentation Model with validation for a Form</strong></span></p>
<p>As I mentioned earlier about reusing the same form with different presentation models. Below you will see an ‘<strong>Add Form</strong>’ with validation on the <strong>Last Name field</strong>. The error icon indicates that the last name <strong>may not</strong> contain <strong>symbols</strong> and <strong>numbers</strong>, but allowing <strong>letters</strong>, <strong>apostrophe </strong>or <strong>hyphen </strong>in the name. You will notice the red error icon beside the <strong>&#8216;last name&#8217;</strong> text field.</p>
<div id="attachment_403" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-403 " title="iSF86_add_form_example" src="http://carlfx.wordpress.com/files/2009/08/isf86_add_form_example.png?w=300" alt="Add Form validation on last name field." width="300" height="169" /><p class="wp-caption-text">Add Form validation on last name field.</p></div>
<pre>    // JavaFX
    var <strong>personForm</strong>:<strong>NameForm</strong> = <strong>NameForm</strong>{
        <strong><span style="color:#993300;">presentationModel:domain.model.personpresentationmodel.AddPersonPM{}</span></strong>
    };
    <span style="color:#993300;"><strong>personForm.presentationModel.jBean = new PersonBean();</strong></span></pre>
<p>Next, you will see an ‘<strong>Edit Form</strong>’ with <strong>no</strong> <strong>validation</strong> on the <strong>&#8216;Last Name&#8217; field</strong>. But, there is validation on the <strong>&#8216;First Name&#8217; field</strong>. The warning icon indicates that the first name can contain <strong>symbols </strong>and <strong>numbers</strong>, <strong>letters</strong>, <strong>apostrophe </strong>or <strong>hyphen</strong>, <strong>but isn’t recommended</strong>. You will notice the yellow warning icon beside the &#8216;<strong>first name</strong>&#8216; field.</p>
<div id="attachment_404" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-404 " title="iSF86_edit_form_example" src="http://carlfx.wordpress.com/files/2009/08/isf86_edit_form_example.png?w=300" alt="Edit Form no validation for Last Name field" width="300" height="168" /><p class="wp-caption-text">Edit Form no validation for Last Name field</p></div>
<pre>    // JavaFX
    <strong><span style="color:#993300;">personForm.presentationModel = domain.model.personpresentationmodel.EditPersonPM{}
    personForm.presentationModel.jBean = personBean2;</span></strong></pre>
<p><strong>*Note</strong>: The examples above are two hypothetical use cases, I mocked up those forms to help illustrate different validation contexts. The demo app uses an <strong>edit presentation model</strong> that does validate on the &#8216;<strong>last name</strong>&#8216; field.</p>
<p><span style="color:#0000ff;"><strong><span style="color:#000000;">Edit Person </span><span style="color:#000000;">Presentation Model w/Validation</span></strong></span></p>
<pre>// JavaFX
<span style="color:#993300;">public class <strong>EditPersonPM</strong> extends fxforms.model.model.PresentationModel</span> {

   /** Validate the first name field */
   var validateFirstName =  <strong>Validator</strong>{
       <span style="color:#993300;"><strong>id:PersonBean.FIRST_NAME_PROPERTY</strong></span>
       <strong><span style="color:#993300;">public override function validate(value:Object)</span></strong>{
           return validateName(value, PersonBean.FIRST_NAME_PROPERTY, <strong>"Warning"</strong>);
       }
   };
... // more validators
   postinit {
       <span style="color:#993300;"><strong>addValidator(validateLastName);</strong></span>
       addValidator(validateFirstName);
       addValidator(validateMiddleName);
   }
}
// Script level function
/**
 * Using regular expression allow letters, apostrophe, hyphen
 */
<span style="color:#993300;"><strong>function validateName(value:Object, propName:String, messageType:String)</strong></span>{ // use friendly names, short names, etc.
    var results = ValidationResult{};
    var strValue:String = value as String;
    <span style="color:#993300;">var found:<strong>Boolean </strong>= Pattern.matches("^[a-zA-Z,'.\\-\\s]*$", strValue);</span>
    if (not found) {
        var message:<span style="color:#993300;"><strong>FieldMessage</strong></span> = <span style="color:#993300;"><strong>FieldMessage</strong></span>{
            <strong>id:propName</strong>
            <strong>messageType:messageType</strong>
            <strong>errorId</strong>:"123"
            <strong>errorMessage</strong>:"No symbols in names except - or ' (apostrophe)"
        }
        <span style="color:#993300;">results.addMessage(message);</span>
    }
    <strong><span style="color:#993300;">return results;</span></strong>
}</pre>
<p style="text-align:left;"><strong>Line 01</strong>: Class EditPersonPM extends fxforms.model.model.PresentationModel<br />
<strong>Line 04</strong>: <strong>var validateFirstName</strong> is an instance of a Validator<br />
<strong>Line 12</strong>: Adds all <strong>Validator</strong>s to the presentation model<br />
<strong>Line 21</strong>: Script level function to be used in each validator<br />
<strong>Line 24</strong>: Regular expression to allow letters, apostrophe and hyphen characters only.<br />
<strong>Line 26</strong>: Creation of the message when <strong>Validator </strong>validates.</p>
<p style="text-align:left;"><a href="http://code.google.com/p/jfxtras/source/browse/jfxtras.samples/trunk/CarlFX/fxforms/test/domain/model/personpresentationmodel.fx"><strong>personpresentationmodel.fx</strong></a> &#8211; The edit presentation model for a person name form.</p>
<p style="text-align:left;"><strong><a href="http://code.google.com/p/jfxtras/source/browse/jfxtras.samples/trunk/CarlFX/fxforms/src/fxforms/model/model.fx">model.fx</a> </strong>- Contains presentation model and value model implementation.</p>
<p style="text-align:left;"><strong><a href="http://code.google.com/p/jfxtras/source/browse/jfxtras.samples/trunk/CarlFX/fxforms/src/fxforms/model/validation.fx">validation.fx</a></strong> &#8211; Contains the validator, message, result classes.</p>
<p style="text-align:left;">
<p style="text-align:left;">
<p style="text-align:left;"><span style="color:#0000ff;"><strong>Step 3. Create a Form</strong></span></p>
<p style="text-align:left;"><span style="color:#0000ff;"><strong><span style="color:#000000;">Edit Person Form (Screen mockup)</span><br />
</strong></span></p>
<pre>0 full name panel
+-1------------------------+ // VBox with 3 things
! +-2--------------------+ ! // HBox with 2 things
! ! [ 3 ] [ 4           ]! ! // Label(section) and Label(title)
! +----------------------+ !
! +-5--------------------+ ! // HBox with 2 things
! ! [ 6 ] [ 7  ]         ! ! // Label(spacer} and Text(instructions)
! !                      ! ! // wrapping text abilities
! +----------------------+ !
! +-8--------------------+ ! // HBox with 2 things
! ! +-9---+ +-10-------+ ! ! // VBox_9(labels) Vbox_10(textbox)
! ! ![11] ! ! [15]     ! ! ! // Label(lastname) TextBox()
! ! ![12] ! ! [16]     ! ! ! // Label(firstName) TextBox()
! ! ![13] ! ! [17]     ! ! ! // Label(mi)  TextBox()
! ! ![14] ! ! [18]     ! ! ! // Label(suffix)  TextBox()
! ! +-----+ +----------+ ! !
! +----------------------+ !
+--------------------------+</pre>
<p><strong>NameForm inherits from Form<br />
Form inherits from CustomNode</strong></p>
<pre>// JavaFX
<span style="color:#993300;"><strong>public class NameForm extends fxforms.ui.form.Form </strong></span>{
   <span style="color:#993300;"><strong>public override function create():Node</strong></span>{
        // 0 main panel
        var mainPanel:Panel = Panel{
            content:[]
        }
        ... // more layouts and widgets

        var firstLabel:Label = Label {
            text: "First Name"
            hpos:HPos.RIGHT
            font : Font {
                size: 18
            }
            layoutInfo: LayoutInfo { minWidth: 100 width: 150 maxWidth: 200 }
        };
        ... // more code
<strong><span style="color:#993300;">        var lastNameTextBox:TextBox = fxforms.ui.controls.MyTextBox {
            id:"lastName"
            columns:20
        };</span></strong>
        var miNameTextBox:TextBox = fxforms.ui.controls.MyTextBox {
            id:"middleName"
            columns:20
        };
        ... // more fields

        // *** NOTE: This is for easy lookup. And relating to Scene.lookup(id) bug in 1.2.
<span style="color:#993300;"><strong>        guiFields = [lastNameTextBox, firstNameTextBox, miNameTextBox, suffixNameTextBox];
        presentationModel.addGuiFields(guiFields);
        return mainPanel;</strong></span>
    } // create()
} // NameForm</pre>
<p style="text-align:left;"><strong><a href="http://code.google.com/p/jfxtras/source/browse/jfxtras.samples/trunk/CarlFX/fxforms/test/domain/forms/nameform.fx" target="_blank">NameForm.fx </a></strong>- This represents a Form containing a person&#8217;s name information.</p>
<p style="text-align:left;"><a href="http://code.google.com/p/jfxtras/source/browse/jfxtras.samples/trunk/CarlFX/fxforms/src/fxforms/ui/form.fx" target="_blank"><strong>form.fx</strong></a> &#8211; This is the base class which contains the presentation model for forms binding behavior.</p>
<p style="text-align:left;"><a href="http://code.google.com/p/jfxtras/source/browse/jfxtras.samples/trunk/CarlFX/fxforms/src/fxforms/ui/controls.fx" target="_blank"><strong>controls.fx</strong></a> &#8211; This contains all registered GUI controls for observing value model value changes. Currently only one control exists the <a href="http://java.sun.com/javafx/1.2/docs/api/javafx.scene.control/javafx.scene.control.TextBox.html" target="_blank"><strong>TextBox </strong></a>control.</p>
<p><strong>*Note</strong>: The ideal way to build forms is using the JFXtras MigLayout library. To learn more take a look at Dean Iverson&#8217;s blog entry called &#8220;<a href="http://pleasingsoftware.blogspot.com/2009/06/miglayout-for-javafx-reloaded.html">MigLayout for JavaFX Reloaded</a>&#8220;.</p>
<p style="text-align:left;">
<p style="text-align:left;"><span style="color:#0000ff;"><strong>Step 4. Associate a Presentation Model to Form</strong></span></p>
<pre>// JavaFX
var personForm:<strong>NameForm </strong>= <strong>NameForm</strong>{
    <strong><span style="color:#993300;">presentationModel:domain.model.personpresentationmodel.EditPersonPM{}</span></strong>
    translateX: bind slideFormX
};
<strong><span style="color:#993300;">var personBean2:domain.model.PersonBean = new domain.model.PersonBean();</span></strong>
personBean2.setFirstName("Squidward");
personBean2.setLastName("Tentacles");
personBean2.setMiddleName("Nickelodeon");
personBean2.setSuffixName("Sr.");

// set presentation model with domain object
<span style="color:#993300;"><strong>personForm.presentationModel.jBean = personBean2;</strong></span></pre>
<p style="text-align:left;"><strong>Line 02</strong>: Associate presentation model to form<br />
<strong>Line 05</strong>: Create an instance of a JavaBean<br />
<strong>Line 12</strong>: Bind bean to presentation model and form</p>
<p style="text-align:left;">Once the presentation model and form are assembled binding an existing Java object is a snap. In <strong>part 4</strong> on enhancing this process would be to create a factory to obtain meta information of the form to retrieve  nested properties within a POJO/JavaBean off of the JavaFX main thread (desktop profile is the EDT). This effort will help alleviate from the dreaded Hibernate lazy init exception when using detached objects. So, making sure you don&#8217;t block the GUI thread is a big deal when it comes to user experience.</p>
<p style="text-align:left;"><span style="color:#0000ff;"><strong>Step 5. Use the Form in an application</strong></span></p>
<pre>    <span style="color:#993300;"><strong>var switchPersonButton:CheckBox = CheckBox </strong></span>{
            text: bind personToSwitchText
            width: 100
            translateX: 5
            translateY: bind mainScene.height - switchPersonButton.height - 5
            allowTriState: false
            selected: false
            <span style="color:#993300;"><strong>override var onMouseReleased = function(e:MouseEvent):Void {
                if (selected){
                   personToSwitchText = "Sponge Bob";
                   personForm.presentationModel.jBean = personBean1;
                } else {
                   personToSwitchText = "Squidward";
                   personForm.presentationModel.jBean = personBean2;
                }
            }</strong></span>
        };

    var mainScene:Scene = Scene {
        fill: LinearGradient {
                    startX: 0
                    startY: 0
                    endX: 0
                    endY: 1
                    stops: [
                        Stop { offset: 0.1 color: Color.ORANGE },
                        Stop { offset: 1.0 color: Color.YELLOW },
                    ]
                }
        content: [<span style="color:#993300;"><strong>personForm</strong></span>, <strong><span style="color:#993300;">switchPersonButton</span></strong>, backButton, nextButton]
    };</pre>
<p style="text-align:left;"><strong><a href="http://code.google.com/p/jfxtras/source/browse/jfxtras.samples/trunk/CarlFX/fxforms/test/domain/Main.fx">Main.fx</a> </strong>- The main application file to launch the application</p>
<p style="text-align:left;">
<h1 style="text-align:left;">Value Model</h1>
<p style="text-align:left;">The &#8216;<strong>Value Model</strong>&#8216; is probably the most important aspect of how the Forms binding works. The value model is a model that holds a single value that notifies registered listeners that a value has changed. Registered listeners will likely be GUI controls and JavaBean properties. Bidirectional binding occurs when a bean property value changes, which notifies the value model which updates the  GUI control value. This holds true when going in the other direction too, such as the user changes the value of the GUI control which notifies the value model which updates the JavaBean property value.</p>
<p style="text-align:left;"><a href="http://code.google.com/p/jfxtras/source/browse/jfxtras.samples/trunk/CarlFX/fxforms/src/fxforms/model/model.fx">model.fx</a> &#8211; Contains presentation model and value model implementations.</p>
<p style="text-align:left;">
<h1 style="text-align:left;">Conclusion</h1>
<p>I feel the implementation of the fxforms framework using JavaFX was extremely easy and is a lot less code compared to a Java equivalent of a Swing/SWT forms framework, also carrying additional overhead using 3rd party libraries for binding and validation. As JavaFX matures with more controls the forms framework would need to be flexible enough to add any controls to handle custom bindings such as list models.  Next we will look at <a href="http://carlfx.wordpress.com/2009/08/29/javafx-forms-framework-part-4/"><strong>Part 4 Enhancements </strong></a>. As always any feedback is welcome!</p>
<p style="text-align:left;">
<h1 style="text-align:left;">References</h1>
<p>Validation presentation by Karsten Lentzsch &#8211; <a href="http://www.jgoodies.com/articles/validation.pdf">http://www.jgoodies.com/articles/validation.pdf</a></p>
<p>JGoodies: <a href="http://www.jgoodies.com/articles/validation.pdf">http://www.jgoodies.com/</a></p>
<p>JGoodies Support: <a href="http://www.jgoodies.com/products/purchase.html">http://www.jgoodies.com/products/purchase.html</a></p>
<p>The Unknown JavaBean by Richard Bair &#8211; <a href="http://weblogs.java.net/blog/rbair/archive/2006/05/the_unknown_jav.html">http://weblogs.java.net/blog/rbair/archive/2006/05/the_unknown_jav.html</a></p>
<p>JavaFX &#8211; JMS Unexpected Null Pointer Exception <a href="http://blogs.sun.com/clarkeman/entry/javafx_jms_unexpected_null_pointer">http://blogs.sun.com/clarkeman/entry/javafx_jms_unexpected_null_pointer</a></p>
<p>JFXtras Community Site &#8211; <a href="http://jfxtras.org/portal/home">http://jfxtras.org/portal/home</a></p>
<p style="text-align:left;">
<p style="text-align:left;">
<p style="text-align:left;">
<p style="text-align:left;">
<p style="text-align:left;">
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Thunderbird 2 - Herramientas de Oficina - Gestor de Correo]]></title>
<link>http://discoduro.wordpress.com/2009/08/19/thunderbird-2-herramientas-de-oficina-gestor-de-correo/</link>
<pubDate>Wed, 19 Aug 2009 22:45:39 +0000</pubDate>
<dc:creator>kikovf</dc:creator>
<guid>http://discoduro.wordpress.com/2009/08/19/thunderbird-2-herramientas-de-oficina-gestor-de-correo/</guid>
<description><![CDATA[Nombre: Thunderbird 2 Licencia: GNU (Gratis) S.O: Windows XP, Windows Vista, Windows 7 Tamaño: 6.25 ]]></description>
<content:encoded><![CDATA[Nombre: Thunderbird 2 Licencia: GNU (Gratis) S.O: Windows XP, Windows Vista, Windows 7 Tamaño: 6.25 ]]></content:encoded>
</item>
<item>
<title><![CDATA[JavaFX Forms Framework Part 2]]></title>
<link>http://carlfx.wordpress.com/2009/08/03/javafx-forms-framework-part-2/</link>
<pubDate>Mon, 03 Aug 2009 18:36:02 +0000</pubDate>
<dc:creator>carldea</dc:creator>
<guid>http://carlfx.wordpress.com/2009/08/03/javafx-forms-framework-part-2/</guid>
<description><![CDATA[Full Name Form with Validation Introduction This is the second installment of a series of blog entri]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h1><img src="/DOCUME%7E1/cdea/LOCALS%7E1/Temp/moz-screenshot.png" alt="" /></p>
<div id="attachment_397" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.jroller.com/carldea/resource/javafx/fxforms.jnlp"><img class="size-medium wp-image-397" title="fxformsvalidation" src="http://carlfx.wordpress.com/files/2009/08/fxformsvalidation.png?w=300" alt="Full Name Form with Validation" width="300" height="180" /></a><p class="wp-caption-text">Full Name Form with Validation</p></div>
<p>Introduction</h1>
<p><strong>T</strong>his is the second installment of a series of blog entries relating to a proof of concept for a <strong>JavaFX Forms Framework</strong>. Before I specify the <strong>requirements</strong> and a simple <strong>design</strong> of the <strong>FXForms Framework</strong>, I want to follow-up on comments about tough issues relating to enterprise application development and JavaFX. If you recall in <em><a href="../2009/07/29/javafx-forms-framework-part-1/">Part 1</a></em> we discussed about <strong>MVC </strong>form based technologies. I listed many technologies that may only provide a means to separate content from presentation, but they don&#8217;t necessarily deal with real plumbing problems such as <em>Threading, Binding, Validation and Transactions</em>.  I believe these issues are one of the most important areas that must be understood in the JavaFX world, thus positioning itself as a premiere enterprise development platform (not just rich client <strong>a hint to <a href="http://www.oracle.com/us/corporate/press/018363">Oracle</a></strong>).  As <a href="http://twitter.com/osbald">Richard Obaldeston</a> mentions in the <a href="../2009/07/29/javafx-forms-framework-part-1/#comments">comments</a> regarding enterprise level support for JavaFX controls similar to <a href="http://swinglabs.org/projects.jsp">Swinglabs / SwingX</a>. I cannot speak of the future concerning Swing &#38; Swinglabs, but I believe the JavaFX teams are well aware of them, (very much so) due to the fact that the same project owners of the <a href="https://swingx-ws.dev.java.net/">SwingX-WS</a> are <a href="http://www.parleys.com/display/PARLEYS/Home#slide=1;talk=24903698;title=Interview%20with%20the%20JavaFX%20team">leads on the JavaFX</a> teams (I don’t mean to put them on the spot).  Many of these difficult issues are mostly solved in the Browser based Web Application Development world and can also be <strong>done in the JavaFX world </strong>(Check out <a href="http://mkblog.exadel.com/ria/javafx-and-spring-crud">Exadel</a>). Of course I can&#8217;t answer all the hurdles faced in just one blog entry especially because every enterprise application has varied types of architectures such as (Corba, RMI, EJB, Soap, <a href="http://jnb.ociweb.com/jnb/jnbAug2009.html">RESTful</a>, JSON, Jini, JMS, DAO, JDO, JDBC, JNI, etc). It would literally take a book or two. But, I will try to address some of them later in this blog as we discuss <strong>JavaFX and Java interoperability</strong>. One should always re-evaluate one’s architecture to adhere to best practices or industry standards and conventions. However, some standards seem to stall or are slow to be accepted (<a href="https://appframework.dev.java.net/intro/index.html">JSR-296</a> or <a href="https://beansbinding.dev.java.net/">JSR-295</a>) with many reasons of course. It is often the nature of the beast when it comes to new technology solutions and refactoring that subsequently boils down to when and how you want to pick your battles. As readers of this blog for the first time who might be new to JavaFX or Java Swing I strongly encouraged you to explore and learn about the pitfalls of <a href="http://jfxtras.googlecode.com/svn/site/javadoc/release-0.5/org.jfxtras.async/org.jfxtras.async.JFXWorker.html">thread safety</a>, <a href="http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html">asynchronous behaviors</a>, <a href="http://www.greggbolinger.com/blog/2008/11/11/1226423940000.html">best practices</a>, and UI concepts like (<a href="http://weblogs.java.net/blog/alexfromsun/archive/2007/06/_enablingdisabl_1.html">UI blocking</a>, <a href="http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html">disabling</a>, progress bar, etc.) . So, let’s get started with requirements and the analysis phase of our FXForms Framework.</p>
<h1>Requirements</h1>
<p><strong>M</strong>y main goal of these series of blog entries are to share with others my experience with creating an application called <strong>iSF86</strong> which hopefully will end up in the <a href="http://www.java.com/en/store/">Java App Store</a> and make tons of cash so I can quit my day job like <a href="http://www.iphonesavior.com/2009/01/iphone-developer-quits-day-job-after-ishoot-hits-number-one.html">Ethan</a> (wishful thinking). <strong>iSF86</strong> is an application which contains many form elements to capture a person’s information to apply for a job doing <a href="http://en.wikipedia.org/wiki/Top_Secret">classified</a> work for the United States Government. When dealing with so many forms I thought of building a mini Forms Framework where domain objects can be mapped to forms. The application will save a person’s <a href="http://www.opm.gov/forms/html/sf.asp">SF86</a> information locally as an XML file. This is purely a client-side application which doesn’t involve any server-side communications. Each form would be bound to domain objects in a bi-directional way. A domain object that is bound to an existing form can be swapped out with a different domain object, thus making the old bean ready to be garbage collected and unbound to the form. <strong>Important Note</strong>: One requirement is that the domain objects will be <strong>JavaBeans</strong> (see disclaimer below).</p>
<p><strong>Disclaimer:</strong> For brevity, the requirements are for <strong><a href="http://weblogs.java.net/blog/rbair/archive/2006/05/the_unknown_jav.html">JavaBeans</a> </strong>(change support) and <strong>not <a href="http://en.wikipedia.org/wiki/Plain_Old_Java_Object">POJO</a>s</strong> (<a href="http://weblogs.java.net/blog/rbair/archive/2006/05/the_unknown_jav.html">there is a difference</a>)! Yes, I know I said POJOs in <em>Part 1</em>, because I wanted to tackle the problem using <a href="http://jakarta.apache.org/bcel/">byte code engineering</a> for boiler plate code for property change support on POJOs, but it would be beyond the scope of the blog series’ goal. So, this tutorial is really geared for people migrating Swing/SWT applications to JavaFX applications.</p>
<p><strong>FX Forms Framework Requirements:</strong></p>
<ol>
<li>It shall bind JavaFX Forms to      JavaBeans as domain objects<strong> </strong></li>
<li>It shall enable JavaBeans to      be swapped in a JavaFX Form<strong> </strong></li>
<li>It shall provide validation      on property values<strong> </strong></li>
<li>It shall provide Action      bindings to controls<strong> </strong></li>
</ol>
<p>To keep the framework simple shown below is a list of features that the framework does not provide.  Interesting features will later be discussed in <a href="http://carlfx.wordpress.com/2009/08/29/javafx-forms-framework-part-4/"><em>Part 4 Enhancements</em></a>.</p>
<p><strong>What the FX Forms Framework does NOT provide:</strong></p>
<ul>
<li>Application Framework      Features (like <a href="https://appframework.dev.java.net/intro/index.html">JSR-296</a>)
<ul>
<li>Application Lifecycle</li>
<li>Resource injection</li>
<li>Task Monitoring</li>
<li>Saved Preferences</li>
<li>Thread Pool</li>
</ul>
</li>
<li>Forms Building</li>
<li>RCP Features
<ul>
<li>Window Docking</li>
<li>Menu bar</li>
<li>Etc.</li>
</ul>
</li>
</ul>
<h1>Design</h1>
<p><strong>B</strong>efore going into the design I want to mention other technologies which provide beans to forms binding or RIA MVC capable. The mentioned technologies are primarily Java based. Some of my classes will use similar names because I’ve taken a lot of ideas from these frameworks in the past.  Here are just a few that come to mind:</p>
<ul>
<li><a href="http://griffon.codehaus.org/">Griffon</a> &#8211; A Grails-like Rich      Internet Framework</li>
<li><a href="http://www.metawidget.org/">MetaWidget</a> (thanks to <a href="http://www.jroller.com/aalmiray/">Andres Almiray</a> an author of <a href="http://manning.com/almiray/">Griffon in Action</a> for mentioning it      to me)</li>
<li><a href="http://mkblog.exadel.com/ria/javafx-and-spring-crud/">Exadel</a>, <a href="http://exadel.com/web/portal/flamingo">JavaFX/Spring/Seam RIA</a> development platform</li>
<li><a href="http://www.jgoodies.com/downloads/libraries.html">JGoodies</a> Swing      Bindings and Validation</li>
<li><a href="http://www.jboss.com/products/seam/">Seam</a> – Ajax/JSF RIA      platform.</li>
<li><a href="http://spring-rich-c.sourceforge.net/1.1.0/index.html">Spring Rich      Client</a> – Swing / SWT Application framework, Forms binding and      validation</li>
<li><a href="http://wiki.eclipse.org/index.php/Rich_Client_Platform">Eclipse RCP</a> –</li>
<li><a href="https://beansbinding.dev.java.net/">Beans Bindings</a> (JSR 295)</li>
<li><a href="http://cocoon.apache.org/2.2/blocks/forms/1.0/498_1_1.html">Apache      Cocoon</a> – Form based binding</li>
<li><a href="http://code.google.com/p/javabuilders/">JavaBuilders</a> -</li>
</ul>
<p>As a reminder regarding rapid application development that there are two main areas on building applications quickly ‘<strong>Forms building’</strong> and ‘<strong>Forms binding’</strong>. We will only focus on ‘Forms binding’. Ok, already! Let’s get to the designing.</p>
<h2>User of the API</h2>
<p>At times when it comes to API development I’m a fan of user driven design and the user of the API is who I’m targeting. So, I pretend the FXForms Framework is ready to be used. Below is the developer obtaining a JavaBean and setting it into some Form.</p>
<pre>// normally loaded from external source
var personBean1:PersonBean = new PersonBean(); // change support enabled
personBean1.setFirstName("SpongeBob");
.
.
.

// generate a form and bind to bean. <strong>Req #1</strong>
var personForm:NameForm = NameForm{
jBean:personBean1
};

// subsequent time another domain object is loaded <strong>Req #2</strong>
var personBean2:PersonBean = … // loaded from external source.
personForm.jBean = personBean2; // old person bean is no longer attached

// set property to an invalid value. <strong>Req #3</strong>
personBean2.setFirstName(“#$”);
// validator will fire to output error message

// create navigation panel area <strong>Req #4</strong>
var mainButtonForm:PresentationModel = MainButtonForm {
jBean:personBean2
};
var nextButton:Button = mainButtonForm.getControl(‘nextButton’);
// simulate a mouse press to test action binding</pre>
<p>Let’s step through the code to see what is happening and what the FXForms Framework will provide.</p>
<p><strong>Line 1</strong>: Creating domain object or loading from external source. Notice the <strong>new </strong>on the PersonBean (Java Object).</p>
<p><strong>Line 8</strong>: Instantiating a Form to use the current <strong>JavaBean</strong> loaded. All the properties will be bound to form elements bi-directionally. Changes in the GUI will affect properties and changes to the bean properties will change the GUI fields. (Requirement <strong>#1</strong>)</p>
<p><strong>Line 14</strong>: Swapping a domain object with the existing form. Old bean is disconnected from the form and replaced with new bean. <em>Presentation Model Pattern</em> (Requirement #<strong>2</strong>)</p>
<p><strong>Line 17</strong>: <strong>Validation</strong> of a property when set with invalid data. The user can type into the textbox to fire the validator code. <strong>ValueModel</strong> updated (Requirement #<strong>3</strong>)</p>
<p><strong>Line 20-25</strong>: A button panel form has buttons mapped to <strong>actions</strong>. <em>Command Pattern</em>. Yes, this is strange but I will explain later. (Requirement #<strong>4</strong>)</p>
<p>You will notice the comment on <strong>line 25</strong> where you could test a control such as obtaining a button independent of the application being launched (testing individual forms).  This brings up a good point when using MVC Frameworks.  In  the Swing world I highly recommend using <a href="http://fest.easytesting.org/swing/wiki/pmwiki.php"><strong>FEST Swing</strong></a> a tool to test Swing applications with ease. Also, the team is working on <a href="http://steveonjava.com/2009/08/02/jfxtras-test-and-fest-unite/">FEST for JavaFX</a> with a <a href="http://steveonjava.com/2009/08/02/jfxtras-test-and-fest-unite/">joint effort</a> with the <a href="http://jfxtras.org/">JFXtras</a> team.</p>
<h1>JavaFX and Java Interoperability</h1>
<p>While the user of the API appears simple, it is the behind-the-scenes work that some may consider unorthodox when using a combination of Triggers, Bindings, Reflection, Threading, etc. Until the JavaFX teams expose (with JavaFX blessed code) better interoperability against Java and JavaFX, I will resort to techniques that are known and official. When using triggers on properties this enables us to follow the basic <a href="http://en.wikipedia.org/wiki/Proxy_pattern">proxy pattern</a>: where a property is changed you will have an opportunity to intercept the change and update value models, which also updates GUI widgets mapped to them. One concern is that object-based memory leaks could occur with <strong>inverse bind</strong> (Maybe we need a <strong>unbind</strong> keyword). Another problem is properly populating a form on or off the JavaFX’s main process thread (EDT on the desktop environment) without blocking the GUI thread or causing some race condition.  What follows are the necessary classes to implement the FXForms framework.</p>
<h1>Class Design</h1>
<p>// Java<br />
<strong>DomainModel </strong>&#60;abstract Java class&#62;<br />
pcs:PropertyChangeSupport</p>
<p>// Java<br />
<strong>PersonBean</strong> extends <strong>DomainModel</strong> &#60;JavaBean&#62;<br />
firstName:String<br />
middleName:String<br />
lastName:String<br />
suffixName:String</p>
<p>// JavaFX<br />
<strong>FieldSetter</strong> &#60;mixin class&#62; Adapter<br />
valueModel:<strong>ValueModel<br />
</strong>boundValue:String</p>
<p>// JavaFX<br />
<strong>MyTextBox </strong>extends TextBox, <strong>FieldSetter</strong><br />
updateField(obj:Object):Void</p>
<p>// JavaFX<br />
<strong>ValueModel </strong>&#60;adapter class&#62;<br />
propertyName:String<br />
guiControls:<strong>FieldSetter</strong>[]<br />
boundValue:Object<br />
jBean:Object</p>
<p>// JavaFX<br />
<strong>PresentationModel </strong>extends PropertyChangeListener &#60;mixin class&#62;<br />
propertyValues: Map &#60;String, ValueModel&#62;<br />
propertyValidatorMap: Map &#60;String, List&#60;Validator&#62;<br />
jBean: DomainModel // java class javabean inherit<br />
getModel(propertyName:String):ValueModel<br />
getControl(propertyName:String):Control<br />
propertyChange(changeEvent: PropertyChangeEvent):Void</p>
<p>//JavaFX<br />
<strong>Form</strong><br />
guiControls:[] // Scene.lookup(id) is currently a bug in jfx 1.2<br />
presentationModel:PresentationModel</p>
<p>// JavaFX<br />
<strong>NameForm</strong> extends CustomNode, Form, <strong><span style="text-decoration:line-through;">PresentationModel</span> </strong>&#60;JavaFX node&#62;</p>
<p>// JavaFX<br />
<strong>Validator</strong><br />
validate():ValidationResult</p>
<p>// JavaFX<br />
<strong>ValidationResult<br />
</strong>messages:[]<br />
getMessages():Message</p>
<p>// JavaFX<strong><br />
Message</strong><br />
key:String<br />
propertyName:String<br />
errorType:[“warn”,”err”]<br />
text:String</p>
<p><span style="text-decoration:line-through;">You will notice the NameForm inherits the <strong>PresentationModel</strong> <a href="../2009/06/29/does-javafx-have-multiple-inheritance/">mixin</a> class which provides the controller functionality mixed in with the view. I’ve done this to make the example short</span> Sometimes I&#8217;m not a big fan of inheritance especially in this case and decided to refactor in order to separate the &#8220;<em><strong>Presentation Model</strong></em>&#8221; from the &#8220;<em><strong>View Form</strong></em>&#8221; for form reuse.  There are situations such as reusing the same <strong>GUI form</strong> for &#8220;<strong>Adding</strong>&#8221; and &#8220;<strong>Editing</strong>&#8220;, but the validation of the form data is different. Developers may also create a concrete presentation model that inherits from the mixin class to be independent of the view so that it decouples the Form and the Presentation Model. An EditPresentationModel and an AddPresentationModel should be created to have two different validations using the same <strong>GUI form</strong>.  Again for a slim down version I’ve omitted the ability to consume an XML file detailing the form metadata and mappings such as actions, mandatory fields, validators, and custom bindings; the named property is the same name as the ‘<strong>id</strong>’ attribute on the JavaFX GUI form element (TextBox). I will discuss in <a href="http://carlfx.wordpress.com/2009/08/29/javafx-forms-framework-part-4/"><em>Part 4</em> </a><em><a href="http://carlfx.wordpress.com/2009/08/29/javafx-forms-framework-part-4/">Enhancements</a>. </em>Relating to validation at some point I would like to provide a way to display warnings and error icons beside fields whenever a Validation Result is updated. The validation results will contain the error messages to be displayed. One last thing to mention is GUI component factories aren’t in the design. You will also notice when creating a TextBox I needed additional behavior, so I simply created a MyTextBox instead of something like <strong>var field1 = WidgetFactory.create(valueModel, “TextBox”)</strong> to wrap, return and put it into form.</p>
<h1>Conclusion</h1>
<p>This is surely not a thorough or complete design, but an attempt to demonstrate how to make a simple forms framework from scratch. Hopefully, I’ve captured the requirements and articulated the object relationships within the textual design (No UML sorry). Next, we will look into how to implement the FXForms Framework in <a href="http://carlfx.wordpress.com/2009/08/20/javafx-forms-framework-part-3/"><strong><em>Part 3</em></strong></a>. Please be advised that this design is subject to change as any development shop would.</p>
<p>Personal Note: Sometimes I wonder if Sun had focused on finishing the often highly controversial JSR 295 Beans Binding and Java Properties before JavaFX would it render this blog entry totally useless.</p>
<p>Any comments are welcome. Thanks!</p>
<p>-Carl</p>
<h1>References</h1>
<p>JavaFX w/JMS 307-311 JavaFX RIA book Server Call Back- James Clarke updates code for JavaFX &#8211; Developing RIA book regarding Code Recipe for JMS pages 307-3011 <a href="http://tinyurl.com/lzej5x" target="_blank">http://tinyurl.com/lzej5x</a></p>
<p>Best practices: <a href="http://www.greggbolinger.com/blog/2008/11/11/1226423940000.html">http://www.greggbolinger.com/blog/2008/11/11/1226423940000.html</a></p>
<p>Fuse <a href="http://weblogs.java.net/blog/joconner/archive/2007/11/index.html">http://weblogs.java.net/blog/joconner/archive/2007/11/index.html</a></p>
<p>Exadel, <a href="http://mkblog.exadel.com/ria/javafx-and-spring-crud/">http://mkblog.exadel.com/ria/javafx-and-spring-crud/</a></p>
<p>Swing worker / swing/ <a href="http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html">http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html</a></p>
<p>Beans Binding: <a href="https://beansbinding.dev.java.net/">https://beansbinding.dev.java.net/</a></p>
<p>RESTful : <a href="http://jnb.ociweb.com/jnb/jnbAug2009.html">http://jnb.ociweb.com/jnb/jnbAug2009.html</a></p>
<p>jfxtras JFXWorker <a href="http://jfxtras.googlecode.com/svn/site/javadoc/release-0.5/org.jfxtras.async/org.jfxtras.async.JFXWorker.html">http://jfxtras.googlecode.com/svn/site/javadoc/release-0.5/org.jfxtras.async/org.jfxtras.async.JFXWorker.html</a></p>
<p>Java Properties: <a href="http://tech.puredanger.com/java7#property">http://tech.puredanger.com/java7#property</a></p>
<p>Fxbuilder: <a href="http://www.jroller.com/aalmiray/entry/griffon_gfxbuilder_fxbuilder_side_by">http://www.jroller.com/aalmiray/entry/griffon_gfxbuilder_fxbuilder_side_by</a></p>
<p>Disable Swing Container:<a href="http://tips4java.wordpress.com/2009/08/02/disabled-panel/">http://weblogs.java.net/blog/alexfromsun/archive/2007/06/_enablingdisabl_1.html</a></p>
<p>Java Properties without Getters and Setters: <a href="http://www.artima.com/forums/flat.jsp?forum=270&#38;thread=247837">http://www.artima.com/forums/flat.jsp?forum=270&#38;thread=247837</a></p>
<p>Beans Binding (JSR 295) &#38; Properties on JDK7: <a href="http://www.javalobby.org/java/forums/t101998.html">http://www.javalobby.org/java/forums/t101998.html</a></p>
<p>JSR 295: <a href="http://jcp.org/en/jsr/detail?id=295">http://jcp.org/en/jsr/detail?id=295</a></p>
<p>RCP Spring rich- <a href="http://spring-rich-c.sourceforge.net/1.0.0/index.html">http://spring-rich-c.sourceforge.net/1.0.0/index.html</a></p>
<p>SAF:<a href="https://appframework.dev.java.net/intro/index.html">https://appframework.dev.java.net/intro/index.html</a></p>
<p>Oracle buys Sun : <a href="http://www.oracle.com/us/corporate/press/018363">http://www.oracle.com/us/corporate/press/018363</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Table2Clipboard and clipboard application interoperability]]></title>
<link>http://dafizilla.wordpress.com/2009/08/01/table2clipboard-and-clipboard-application-interoperability/</link>
<pubDate>Sat, 01 Aug 2009 09:35:18 +0000</pubDate>
<dc:creator>dafi</dc:creator>
<guid>http://dafizilla.wordpress.com/2009/08/01/table2clipboard-and-clipboard-application-interoperability/</guid>
<description><![CDATA[Many users asked to me to add to the extension Table2Clipboard (T2C for friends) the ability to pres]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignleft size-full wp-image-675" title="calc_excel_t2c" src="http://dafizilla.wordpress.com/files/2009/08/calc_excel_t2c.png" alt="calc_excel_t2c" width="128" height="128" />Many users asked to me to add to the extension <a href="https://addons.mozilla.org/en-US/firefox/addon/1852">Table2Clipboard</a> (T2C for friends) the ability to preserve web links and maintain the styles during tables copy.</p>
<p>Preserving links and other HTML tags was a very easy task, I&#8217;ve written the code very quickly and both OpenOffice Calc and Microsoft Excel have handled correctly the pasted content.</p>
<p>When I started to support <em>style preservation</em> I discovered different and ugly results on the two popular office suites making harder to write cross platform XUL code.</p>
<p>Actually T2C pastes to clipboard inserting data in two different formats (<a href="http://dafizilla.wordpress.com/2007/08/18/put-in-clipboard-same-content-in-multiple-formats-using-xul/">flavors</a>), unicode plain text and HTML format.<br />
When users do &#8220;Paste Special&#8221; the HTML format is pasted and applications (Excel or Calc) render inside the data sheet.</p>
<p>Both Excel and Calc handle only the deprecated <a href="http://www.w3schools.com/tags/tag_FONT.asp">FONT</a> tag and a subset of <a href="http://www.w3schools.com/tags/tag_table.asp">TABLE</a> tag attributes and this represents a great limitation for style preservation from T2C.</p>
<p>If you try to paste from Microsoft Explorer to Microsoft Excel you discover everything is copied, the styles are totally preserved but if you paste from Explorer to OpenOffice Calc all style are lost!!!</p>
<p>Well, Explorer inserts to clipboard <strong>also</strong> <a href="http://en.wikipedia.org/wiki/Rich_Text_Format">RTF</a> formatted text and Excel works very fine with the barely public RTF file format.</p>
<p>Clipboard application interoperability goes to hell, HTML is not fully supported by the &#8220;Paste Special&#8221; feature available on both suites, and as usual Microsoft uses semi proprietary data formats to exchange informations between applications.</p>
<p>I think at least OpenOffice should improve its &#8220;Paste&#8221; feature simply adding support for HTML <a href="https://developer.mozilla.org/En/XUL/Attribute/Style">style</a> attribute.</p>
<p>T2C can preserve correctly styles only implementing platform specific code for OpenOffice and Microsoft Office and I really hate write specific platform.</p>
<p>I&#8217;m considering other alternatives but I see only the darkness of C++, OLE and core dump&#8230;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[JavaFX Forms Framework Part 1]]></title>
<link>http://carlfx.wordpress.com/2009/07/29/javafx-forms-framework-part-1/</link>
<pubDate>Wed, 29 Jul 2009 14:03:04 +0000</pubDate>
<dc:creator>carldea</dc:creator>
<guid>http://carlfx.wordpress.com/2009/07/29/javafx-forms-framework-part-1/</guid>
<description><![CDATA[Full Name Form with Validation Introduction Software developers creating form based applications wil]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div id="attachment_397" class="wp-caption alignright" style="width: 310px"><a href="http://www.jroller.com/carldea/resource/javafx/fxforms.jnlp"><img class="size-medium wp-image-397" title="fxformsvalidation" src="http://carlfx.wordpress.com/files/2009/08/fxformsvalidation.png?w=300" alt="Full Name Form with Validation" width="300" height="180" /></a><p class="wp-caption-text">Full Name Form with Validation</p></div>
<h1>Introduction</h1>
<p style="text-align:left;"><strong>S</strong>oftware developers creating form based applications will inevitably stumble across the single most important architectural design pattern &#8220;<a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller"><strong>Model View Controller</strong></a>&#8221; or &#8220;<strong>MVC</strong>&#8220;<strong> </strong>in short. This concept has paved the way for many frameworks which provide true <a href="http://en.wikipedia.org/wiki/Separation_of_concerns"><strong>separation of concerns</strong>.</a> The main idea of these MVC frameworks are to separate content from presentation. In layman&#8217;s terms I call them &#8220;<strong>Forms Framework</strong>&#8220;. When building enterprise applications with a forms framework the ability to achieve  rapid application development and developer productivity will increase greatly. I would like to create a series of blog entries (<strong>five parts</strong>) detailing a simple proof of concept of a <strong>mini forms framework</strong>. Below is a brief summary of the five part series:</p>
<p><strong>Part 1 -</strong> What is a Forms Framework? Also a quick <a href="http://www.jroller.com/carldea/resource/javafx/fxforms.jnlp">demo</a> of a simple form application.<br />
<strong><a href="http://carlfx.wordpress.com/2009/08/03/javafx-forms-framework-part-2/">Part 2</a> -</strong> Requirements and design<br />
<strong><a href="http://carlfx.wordpress.com/2009/08/20/javafx-forms-framework-part-3/">Part 3</a> -</strong> Implementation details<br />
<strong><a href="http://carlfx.wordpress.com/2009/08/29/javafx-forms-framework-part-4/">Part 4</a> -</strong> Enhancements<br />
<strong><a href="http://carlfx.wordpress.com/2009/09/04/javafx-forms-framework-part-5/">Part 5</a> -</strong> Concluding thoughts</p>
<h1 style="text-align:left;">Other Form based technologies</h1>
<ul>
<li><a href="https://developer.mozilla.org/en/XUL">Mozilla &#8211; XUL</a> &#8211; Browser based development platform</li>
<li><a href="http://partners.adobe.com/public/developer/xml/index_arch.html">Adobe -  XML Forms Architecture (XFA)</a> &#8211; PDF based</li>
<li><a href="http://www.w3.org/MarkUp/Forms/">W3C &#8211; XForms </a>- Next generation browsers would support a standard</li>
<li><a href="http://struts.apache.org/">Apache &#8211; Struts</a> &#8211; A Java Web based framework</li>
<li><a href="http://swingml.sourceforge.net/">SwingML</a> &#8211; A Java Swing based application framework</li>
<li><a href="http://www.swixml.org/">SWIXML</a> &#8211; A Java Swing based UI framework</li>
<li><a href="http://www.thinlet.com/index.html">Thinlet</a> &#8211; A Java Applet based UI framework</li>
<li><a href="http://windowsclient.net/">WPF XAML</a>/<a href="http://office.microsoft.com/en-us/infopath/default.aspx">InfoPath</a> &#8211; Microsoft .Net Forms architecture</li>
</ul>
<p>Although the form based technologies listed above use vastly different ways to build form based applications, they all are basically using the <strong>MVC </strong>based architectural pattern. My intent is reuse existing Java domain objects <a href="http://en.wikipedia.org/wiki/Plain_Old_Java_Object">POJO</a>s while using JavaFX as a front-end thus providing a return on investment on legacy system domain models. While mature Java technologies like JAXB, EJB and Hibernate still dominate the Java enterprise the idea is to reuse what we already have.  JavaFX was developed from the ground up with MVC in mind such as the &#8220;<a href="http://javafx.com/docs/integrate-graphic-assets/Workflow.jsp">Designer-Developer Workflow</a>&#8220;. So, with a forms framework a Java Bean would bind to a Presentation Model and a JavaFX Form. I will call the mini forms framework &#8220;<strong>FXForms</strong>&#8221; framework throughout the series.</p>
<h1>Demo</h1>
<p>A form containing JavaFX textbox components to capture a person&#8217;s full name.</p>
<p><strong>Instructions:</strong></p>
<ul>
<li>Check Box to toggle two people using the same form</li>
<li>Type and change information in fields, thus changing the underlying bean</li>
<li>Click on Next for a transition to next form.</li>
<li>Click on Back to return to form</li>
</ul>
<p><a href="http://www.jroller.com/carldea/resource/javafx/fxforms.jnlp">Click here to run demo</a></p>
<h1>Conclusion</h1>
<p>Many who have already read my entry regarding <a href="../2009/06/28/javafx-presentation-model-pattern-using-binding/">JavaFX Presentation Model Pattern Using Binding</a>. Here, I have decided to kick it up a notch and actually develop a <strong>mini forms framework</strong> to make forms development easier than ever.  <a href="http://www.javafx.com">JavaFX</a> is an excellent choice to create nice looking GUI forms that will easily bind to your domain model. Next <a href="http://carlfx.wordpress.com/2009/08/03/javafx-forms-framework-part-2/"><strong>Part 2</strong></a>, we will take a look at requirements for a forms framework.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Accessing the System Clipboard with JavaScript – A Holy Grail?]]></title>
<link>http://brooknovak.wordpress.com/2009/07/28/accessing-the-system-clipboard-with-javascript/</link>
<pubDate>Tue, 28 Jul 2009 01:28:09 +0000</pubDate>
<dc:creator>brooknovak</dc:creator>
<guid>http://brooknovak.wordpress.com/2009/07/28/accessing-the-system-clipboard-with-javascript/</guid>
<description><![CDATA[I am developing an API written in JavaScript for a project which requires the ability to copy data t]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I am developing an API written in JavaScript for a project which requires the ability to copy data to, and retrieve data from, a<em> </em>clipboard within a web browser. A simple/common problem definition – but due to tight browser security, finding a solution is a bit of a nightmare. This article outlines and discusses a number of approaches for implementing a clipboard feature into your JavaScript applications.</p>
<p><a href="http://brooknovak.wordpress.com/files/2009/07/copy-paste.jpg"><img src="http://brooknovak.wordpress.com/files/2009/07/copy-paste.jpg?w=225" alt="copy-paste" title="copy-paste" width="225" height="300" class="aligncenter size-medium wp-image-289" /></a><br />
<!--more--></p>
<h2>The Ideal JavaScript Clipboard Interface</h2>
<p>The concept of the &#8220;clipboard&#8221; is simple;  it is essentially a place for storing and retrieving a single unit/piece of cloned data. The code snippet below describes this clipboard concept in terms of a JavaScript interface.</p>
<pre class="brush: jscript;">
Clipboard = {
    copy : function(data) {
        //... implemention …
    },
     getData : function() {
        // … implementation …
     }
};
</pre>
<p>A simple concept, a self explanatory interface. However, the description above is vague; it does not state where &#8220;the clipboard&#8221; resides, nor does it mention if there can be more than one clipboard.</p>
<h3>Multiple Clipboards</h3>
<p>Unfortunately there can be more than one clipboard present.  There is one &#8220;System clipboard&#8221; present when a user is logged into their profile/account (some strange people might install/configure some features on their OS to support multiple system clipboards). Ideally, all applications should use the system clipboard when copying and pasting so its users can copy and paste between all applications. However this is not always the case. For example, Cygwin uses its own clipboard for Cygwin applications and unless the user explicitly turns on a clipboard integration option, the user cannot copy and paste between Cygwin applications and non-Cygwin applications.</p>
<h3>The Web&#8217;s Sandbox Environment</h3>
<p>Web applications run in a sandbox environment to prevent malicious scripts from infecting a visitor&#8217;s computer. The sandbox environment restricts access to system resources, such as the file system, and unfortunately, the system clipboard. Check out <a href="http://news.cnet.com/8301-1009_3-10021715-83.html">this article</a> for one example why the system clipboard is a restricted resource. Fortunately restrictions for accessing the system clipboard can be overcome. There are many approaches for accessing the system clipboard &#8211; each approach has its own trade-offs.</p>
<h2>Internet Explorer&#8217;s clipboardData Object</h2>
<p>Microsoft&#8217;s Internet Explorer family makes life very easy to access the system clipboard. To set the system clipboard&#8217;s text,  just use the <a href="http://msdn.microsoft.com/en-us/library/ms535220%28VS.85%29.aspx"><code>clipboardData</code></a> object. Here is an example:</p>
<pre class="brush: jscript;">
var didSucceed = window.clipboardData.setData('Text', 'text to copy');
</pre>
<p>To access the system&#8217;s clipboard data (in a textual format) you simply invoke:</p>
<pre class="brush: jscript;">
var clipText = window.clipboardData.getData('Text');
</pre>
<p>The first time the <code>clipboardData</code> object is accessed IE will prompt the user to allow the script to access the system clipboard (note: if you run the script locally IE does not bother with the confirmation and automatically allows it). <a href="http://support.microsoft.com/kb/224993">IE version 6 and below</a> will not bother asking the users (unless they have some non-default security features set to a &#8220;high level&#8221;). We cannot assume that users will choose to allow the script to access the system clipboard. If they decline, the <code>clipboardData.setData</code> method returns false. Unfortunately the <code>clipboardData.getData</code> method is vague: as it returns an empty string if the user chooses to decline. This is ambiguous since the system clipboard&#8217;s contents could actually be empty! Ideally it would return null. You could either always assume that empty string is a signal for failure to access the clipboard and try use a different method (read on), or you could attempt to verify that it was a failure:</p>
<pre class="brush: jscript;">
var clipText = window.clipboardData.getData('Text');
if (clipText == “”) { // Could be empty, or failed
	// Verify failure
	if (!window.clipboardData.setData('Text', clipText))
		clipText = null;
}
</pre>
<p><strong>Note:</strong> <em>the verification method will not display two prompts, since the first prompt will be remembered for the session.</em></p>
<h2>A Sketchy Work-around: The Flash Copy Hack</h2>
<p>Jeffrey Larson came up with a <a href="http://www.jeffothy.com/weblog/clipboard-copy/">nifty solution</a> using Adobe Flash. To copy text to the system clipboard a small flash object is embedded into the document by manipulating the DOM, and the text to be copied is passed as a parameter to the embedded object. The Flash program then takes this text and copies it to the system clipboard via the Flash API. This was a security hole in Flash up-to and including versions 9, and was patched in version 10 so that <a href="http://www.adobe.com/devnet/flashplayer/articles/fplayer10_uia_requirements.html">unsolicited access to the system clipboard is denied</a>. That is, Flash requires users to physically trigger the ActionScript clipboard code via a mouse click in order to grant access.</p>
<p>There still exists a workaround using that is supported by Flash 9 and 10. A small JavaScript library called <a href="http://code.google.com/p/zeroclipboard/">ZeroClipboard</a> exploits Flash, and fools the users, by placing invisible Flash movies over button elements. Whenever a user clicks on these invisible flash movies, ZeroClipboard successfully copies text to the system clipboard since the access is technically not &#8220;unsolicited.&#8221; This is a bit cheeky, some people are calling this process &#8220;click jacking.&#8221; It could be seen as a security flaw, and later Flash releases might put an end to this clipboard exploitation mayhem once and for all – who knows.</p>
<p>Using ZeroClipboard will only allow copying of text to the system clipboard on mouse-clicks. It does not allow access in any other contexts, such as timers, or CTRL+C keyboard events. It is a specific solution intended for Copy buttons.</p>
<p>One drawback is that this option does require the browsers to have the adobe flash plugin installed. So detection of Flash support is essential. Adobe has released a simple-to-use <a href="http://www.adobe.com/products/flashplayer/download/detection_kit/">detection kit</a> which would do the trick. Another simple one can be found <a href="http://www.featureblend.com/javascript-flash-detection-library.html">here</a>.</p>
<p>Flash version 9 has a <a href="http://bugs.adobe.com/jira/browse/FP-80">bug in Linux systems</a> where Web browsers are unable to support transparency for embedded Flash movies. Thus ZeroClipboard is <a href="http://code.google.com/p/zeroclipboard/issues/detail?id=5">not suitable</a> on clients with this setup.</p>
<p>ZeroClipboard should be named ZeroSysCopy or something similar since it only provide unidirectional access to the system clipboard. I attempted to pursue a bidirectional implementation, but the ActionScript API <a href="http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&#38;file=00002187.html">does not provide any way of clipboard retrieval</a> due to security risks. Adobe&#8217;s ActionScript API for the Flex environment does provide <a href="http://livedocs.adobe.com/flex/3/langref/flash/desktop/Clipboard.html">ways of getting to the system clipboard</a>, but only on paste events from a paste button click on a context menu, or paste commands like CTRL+V.</p>
<h2>Using Java Applets</h2>
<p>Jeffrey Larson&#8217;s Flash copy hack got me thinking: what about taking a similar approach using Java applets instead of Flash movies. The beauty of Java is that it can communicate directly with JavaScript, thus can support both copy and paste operations. This is possible via a technology called Liveconnect. This solution has some pricey trade-offs though.</p>
<h3>Liveconnect</h3>
<p>Netscape developed an API called NP API (Netscape Plugin API) which is a cross browser plugin architecture supported by all major browsers except IE today (although some IE browsers do support it – IE&#8217;s equivalent is ActiveX). Liveconnect is one way to implement NP API-based plugins using JavaScript and Java. It was first supported in Netscape 4. A plugin could implement and return an instance to a Java class. The public methods exposed by this class was the scriptable interface for the plugin. The class could be called from JavaScript and even from other Java applets running within the page with the browser marshalling the calls between the various contexts. (see <a href="http://en.wikipedia.org/wiki/NPAPI#LiveConnect">http://en.wikipedia.org/wiki/NPAPI#LiveConnect</a>). The technology has matured since then and is still supported by Mozilla browsers, and Opera. Webkit does not seem to support it anymore.</p>
<p>Some browsers, such as Firefox, do not ship with a Java Virtual Machine plugin, since it &#8220;bloats&#8221; the browsers download size. So like the Flash hack, it depends on a plugin, which is a bit of a concern since the JVM plugins are relatively large to download.</p>
<p>Sun has respecified and reimplemented the Liveconnect technology as of version <a href="http://java.sun.com/javase/6/webnotes/6u10/plugin2/liveconnect">6 update 10</a>, which to my understandings just means that it is faster, more reliable and contains a bunch of extra features not needed for the purposes of some simple clipboard code.</p>
<h3>Implementation</h3>
<p>There are many issues and quirks with this technology. Luckily the code will be very small and simple for the clipboard. Most browsers support the ability to directly use Java inside of JavaScript, but some browsers have issues with some things such as creating new class instances. A more reliable approach would be to store the Java clipboard code into an applet.</p>
<p><a href="http://www.cs.waikato.ac.nz/~bjn8/wpress/jsclipboard/javademo.html">Try the demo here</a>. <a href="http://www.cs.waikato.ac.nz/~bjn8/wpress/jsclipboard/LCClipboard.java">Click here</a> for the applet source. Note that it only works on some browsers, and most probably not on IE.</p>
<p>Hopefully the demo code is self-explanatory. In order to break out of the JVM sandbox environment  <code>java.security.AccessController.doPrivileged</code> is used. Unfortunately that is not enough; after running a small test &#8211; the clipboard was found to be sandboxed. In order to access the system clipboard, the script must be digitally signed. You can sign the applet privately for free to get it running on your machine, but this is probably not practical for you. To digitally sign your applet publicly, you have to go somewhere like <a href="http://www.verisign.com/">Verisign</a> and purchase a certificate for your applet. This currently costs $500 (US) for one year.</p>
<p>Another implication worth noting is that on the first time the JavaScript talks to the Java applet, it will take a little while to load the JVM (several seconds). Once the JVM is loaded it runs smoothly.</p>
<h2>Using Silverlight?</h2>
<p>To the point: None of the Silverlight versions (currently up to version 3) <a href="http://blogs.msdn.com/codingadventures/archive/2009/05/26/copying-data-to-the-clipboard-in-silverlight.aspx">does not provide system clipboard access</a>. This is a shame because it interacts well with JavaScript and is supported by all the common browsers (even on Linux via Moonlight).</p>
<h2>Mozilla&#8217;s XUL Approach</h2>
<p>Mozilla has this inbuilt plugin called “clipboard helper” which can be accessed with JavaScript using the XUL API. <a href="http://almaer.com/blog/supporting-the-system-clipboard-in-your-web-applications-what-a-pain">Dion Almaer explored this approach</a>, <a href="http://www.cs.waikato.ac.nz/~bjn8/wpress/jsclipboard/xuldemo.html">click here</a> for a demo (try downloading it and viewing it locally on your machine).</p>
<p>The XUL approach has some issues, as pointed out by Dion. If you run the script locally an ugly dialog pops up containing a vague (and scary) message warning the user about the possibility of malicious code being executed. The user&#8217;s decision can be remembered. However it fails to access the clipboard when not running script from a local file. This can be overcome: One option is to set some obscure user preferences for Mozilla to allow access. This might not be practical, especially if you are planning to use the script on public sites. Another option is to digitally sign the JavaScript containing the XUL clipboard code – which of coarse is a pricey option.</p>
<h2>Making use of execCommand</h2>
<p>The <code>execCommand</code> JavaScript function is supported by all <a href="http://www.quirksmode.org/dom/execCommand.html">major browsers</a>. The browsers all support the &#8220;Copy&#8221; and &#8220;Paste&#8221; commands. All browsers except for IE only expose the <code>execCommand</code> function for documents with design-mode turned on (for wizzywig editing).</p>
<p>Webkit does not protect the copy command, I wrote a <a href="http://brooknovak.wordpress.com/2009/07/27/webkit-clipboard-security-hole/">post</a> about this security hole. In both Chrome 2 and Safari 4 (on windows and mac) I managed to copy text to the system clipboard without any security warnings/promptings what-so-ever via <code>execCommand</code>. My assumption is that this will be the same for older versions of Webkit. <em>This is very concerning</em>. Mozilla throws security exceptions which can be only avoided via setting the user preferences or signing the JavaScript code. Opera and Konqueror just does not work. For IE it is possible to use this approach, as well as other approaches with <code>MicrosoftTextRange</code> objects, but it has no benefits over using the <code>clipboardData</code> object since it safeguards the copy and paste operations in the same way.</p>
<h3>Implementation</h3>
<p><a href="http://www.cs.waikato.ac.nz/~bjn8/wpress/jsclipboard/execcommanddemo.html">Try it out here</a>. The first time the copy operation is invoked, an inline document in design mode is dynamically created and appended to the main document – thus exposing the <code>execCommand</code>. The inline document contains an <code>textarea</code> and is always hidden from the user. So to copy text to the system clipboard, the <code>textarea</code>&#8217;s value is set to the text to be copied, then the <code>textarea</code> is displayed, focused and selected, and finally the <code>execCommand("copy")</code> method is invoked. The <code>textarea</code> will never be rendered (i.e. the user will not see a random flash on the page) because it is hidden straight after the copy command has executed (the UI will not refresh until after the script finishes executing).</p>
<p>The demo does have a scrolling issue: since the <code>textarea</code> is selected and focused the scrollbars will change if the <code>iframe</code> is not in view. You can easily overcome this behavior this by placing the <code>iframe</code> in a float (<a href="#fallthrough">see below</a> regarding keyboard events).</p>
<p>This script will work in IE, the first time the copy operation is executed a dialog will pop up asking the user for the script for permission to access the clipboard. Unfortunately there is no way of telling whether the user allowed or denied access. The <a href="http://msdn.microsoft.com/en-us/library/ms536419%28VS.85%29.aspx">MSDN docs</a> specifies that <code>execCommand</code> returns true of false depending if the command succeeds or fails, however it will always return true even if the user denies access. Furthermore, while the prompt is displayed the users will see the internal frame rendered which might be confusing for the user (although this could be better concealed by <a href="#fallthrough">using floats</a>). The <code>window.clipboardData</code> object would be a better option, even if the user denies access via <code>window.clipboardData</code>, you probably would not want to blast them with any more security-risk dialogs.</p>
<h2>Fabricating DOM Events</h2>
<p>This is merely an idea, which is a similar approach to the <code>execCommand</code> approach. If it were possible to manually fire CTRL+C and CTRL+V events such that the browsers execute their &#8220;default&#8221; handlers, then by using similar trickery used with the <code>execCommand</code> implementation on demand access to the clipboard would be possible. However, the Web&#8217;s sandbox environment does not let JavaScript simulate user interactions (that would be very bad!). Just a thought.</p>
<h2>Clipboard Events</h2>
<p>IE, Webkit and FF 3+ supports up to six different clipboard events which can be invoked from context menus or key-commands like CTRL+C:</p>
<ul>
<li><strong>onbeforecut</strong>
<ul>
<li>FF does not support this.</li>
<li>IE raises this event before a context menu is displayed and something in the document is selected.</li>
<li>IE only raises these on editable elements.</li>
</ul>
</li>
<li><strong>oncut</strong>
<ul>
<li> IE only raises these on editable elements.</li>
</ul>
</li>
<li> <strong>onbeforecopy</strong>
<ul>
<li> FF does not support this.</li>
<li> IE and Safari raises this event 		before a context menu is displayed and something in the document is 		selected.</li>
</ul>
</li>
<li> <strong>oncopy</strong>
<ul>
<li> Only executed when about to copy 		something in the default handler.</li>
<li> Webkit exposes <code>clipboardData</code> on 		the event object.</li>
</ul>
</li>
<li> <strong>onbeforepaste</strong>
<ul>
<li> FF does not support this.</li>
<li> IE raises this event before a 		context menu is displayed and something in the document is 		selected.</li>
</ul>
</li>
<li> <strong>onpaste</strong>
<ul>
<li> IE only raises these on editable 		elements.</li>
</ul>
</li>
</ul>
<p>Webkit exposes the <code>clipboardData</code> object in <a href="http://developer.apple.com/DOCUMENTATION/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/CopyAndPaste.html">clipboard events</a> by attaching it to the event objects. Webkit&#8217;s  <code>clipboardData</code> object is implemented in the same way as IE&#8217;s <code>clipboardData</code> object.</p>
<p>In order to get text from the clipboard, <code>clipboardData.getData</code> can only be accessed in the <code>onpaste</code> event. This is nice and simple:</p>
<pre class="brush: jscript;">
		document.body.onpaste = function(e) {
			alert(e.clipboardData.getData(&quot;Text&quot;));
			e.preventDefault();
		}
</pre>
<p><strong>Note</strong>: <em>preventing the default behavior is necessary if you are planning to handle the event, but if your code is just sniffing, then exclude the <code>e.preventDefault()</code> call.</em></p>
<p>Ideally the code would be similar for setting the clipboard data upon copy events. Unfortunately Webkit has a <a href="https://bugs.webkit.org/show_bug.cgi?id=17645">bug</a> where you cannot set clipboard data in any of the clipboard events! You can use a work-around by using the same approach in the following section.</p>
<h2><a name="fallthrough">Using Keyboard Events</a></h2>
<p>In most Web applications you do not have to worry about setting/getting the system clipboard data via key presses like CTRL+C, all browsers implement this for you. However, my API needs to get/set system clipboard data whenever the user presses clipboard key combinations like CTRL+C, on an non-editable document. Specifically: on CTRL/CMD+C/X keystrokes, the text to be copied is not the selected text in the document. And, on CTRL/CMD+V keystrokes, no matter where the focus is, the API must be able to retrieve the system clipboard text.</p>
<p>Webkit and FF3+ browsers&#8217; default handlers for copying, cutting and pasting occur in the <code>oncopy</code>, <code>oncut</code> and <code>onpaste</code> events respectively. Browsers which do not use clipboard events execute their copy and paste code in their keydown/keypress default handlers.</p>
<p><a href="http://www.cs.waikato.ac.nz/~bjn8/wpress/jsclipboard/fallthroughdemo.html">Click here for the demo</a>. Whenever a clipboard command is raised from a keyboard stroke, a <code>textarea</code> appears and is selected/focused. The browser&#8217;s default handler then executes its clipboard command on the selected <code>textarea</code>. A timer event is scheduled with no delay so that once the browsers default handler has executed its clipboard command, the timer event is queued afterward &#8211; where it then hides the <code>textarea</code> from view.</p>
<p>This approach was inspired from Webkit&#8217;s lack of support for using <code>clipboardData.setData</code>, I started with a  solution which used the <code>oncopy</code> event, which was then generalized to use keyboard events. You may want to use oncopy/onpaste in Webkit/FF3+ browsers instead of keyboard commands – however there is no real benefit from this except for Chrome: Chrome&#8217;s copy button in its window&#8217;s context menu is clickable, even if nothing in the document is selected (which raises the <code>oncopy</code> event).</p>
<p>The <code>textarea</code> element is <em>very</em> small and usually displayed outside of the view-port. If the vertical and horizontal scrollbars are not at the hard top or left of the document then the <code>textarea</code> is briefly flashed at the top right section of the window. If for example, the float is positioned at an absolute left position of -100 (out of viewport) but the horozontial scrollbars are scrolled to 40 pixels, the scrollbars would scroll to zero (hard left) whenever the <code>textarea</code> is selected/focused. (Note: restoring them to their original values will just create an ugly scrollbar jolting effect).</p>
<p>Originally I developed a <a href="http://www.cs.waikato.ac.nz/~bjn8/wpress/jsclipboard/fallthroughdemoold.html">bulky solution</a> without floats,  but I stumbled across a <a href="http://almaer.com/blog/supporting-the-system-clipboard-in-your-web-application-part-two">blog</a> that had happened to use this same approach but instead using floats (many thanks to Dion).</p>
<p>It is important to avoid race conditions while showing and hiding the <code>textarea</code> before and after the browsers&#8217; default handlers for clipboard operations. Clipboard events are guaranteed to work. Opera queues a <code>settimeout</code> with zero delay after all events in the current event batch &#8211; <code>onkeydown</code>, <code>onkeypress</code>, <code>onkeyup</code> event sequence is seen as an event batch (see <a href="http://dev.opera.com/articles/view/timing-and-synchronization-in-javascript/">timing-and-synchronization-in-javascript</a>) &#8211; so it is safe to use <code>onkeydown</code> in Opera. From my own experiments, my observations are that Firefox&#8217;s clipboard operations are executed on <code>keypress</code> events. IE and Webkit can only use <code>keydown</code> since clipboard key combinations do not get <code>keypress</code> events. There was no luck with getting Konqureror to work with this approach – KHTML has problems with selecting and focusing on an input element (it works sometimes).</p>
<h2>Summary</h2>
<p><a href="http://www.cs.waikato.ac.nz/~bjn8/wpress/jsclipboard/article_summary.html">Go here to see a summary</a> of the explored approaches and their demos (sorry about the external link but my blog layout does not handle large tables!).</p>
<h2>Conclusion</h2>
<p>The “ideal interface” previously discussed is not possible: there are different contexts in which you may want to copy and retrieve data to and from the clipboard, so packaging up a universal clipboard solution is not realistic.</p>
<p>There is a lot of (hacky) code to get cut, copy and paste in a JavaScript application. Is it really worth the time and effort to support copy and paste? I think so. Copy and paste is extremely useful, especially for some type of web-page editor. Microsoft found that paste was the most commonly used operation in their Word application, and copy was the third most common (see <a href="http://blogs.msdn.com/jensenh/archive/2005/11/07/489864.aspx">http://blogs.msdn.com/jensenh/archive/2005/11/07/489864.aspx</a><a href="http://blogs.msdn.com/jensenh/archive/2005/11/07/489864.aspx"> </a> and <a href="http://www.pluggd.in/microsoft/most-used-features-commands-in-microsoft-word-and-a-few-design-lessons-2600/">most-used-features-commands-in-microsoft-word-and-a-few-design-lessons</a>).</p>
<p>Please post feedback&#8230; don&#8217;t be shy!</p>
<h2>Other Helpful Links/References</h2>
<ul>
<li><a href="http://ajaxian.com/archives/seeding-the-clipboard-in-flash10-with-zero-clipboard">http://ajaxian.com/archives/seeding-the-clipboard-in-flash10-with-zero-clipboard</a></li>
<li><a href="http://srp.stanford.edu/demo/">http://srp.stanford.edu/demo/</a></li>
<li><a href="http://trephine.org/t/index.php?title=Understanding_LiveConnectExplorer">http://trephine.org/t/index.php?title=Understanding_LiveConnectExplorer</a></li>
<li><a href="http://blog.pengoworks.com/index.cfm/2008/2/19/Accessing-privileged-methods-in-a-Java-Applet-via-JavaScript">http://blog.pengoworks.com/index.cfm/2008/2/19/Accessing-privileged-methods-in-a-Java-Applet-</a><a href="http://blog.pengoworks.com/index.cfm/2008/2/19/Accessing-privileged-methods-in-a-Java-Applet-via-JavaScript">via-JavaScript</a></li>
<li><a href="http://imagingexperts.typepad.com/imaging_experts/2006/10/javascripting_i.html">http://imagingexperts.typepad.com/imaging_experts/2006/10/javascripting_i.html</a></li>
</ul>
<p><strong>August 24th 09: SORRY BUT ALL DEMO LINKS HAVE BEEN BROKEN! All my wordpress files have been lost on my University web server! GRRRR!</strong></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Jupiter Strike]]></title>
<link>http://markovthoughtchain.wordpress.com/2009/07/21/jupiter-strike/</link>
<pubDate>Tue, 21 Jul 2009 11:35:30 +0000</pubDate>
<dc:creator>markov1089</dc:creator>
<guid>http://markovthoughtchain.wordpress.com/2009/07/21/jupiter-strike/</guid>
<description><![CDATA[Pre-emptive strike on Jupiter brings solar system to the brink of interplanetary war! Take that, Jup]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.jpl.nasa.gov/news/news.cfm?release=2009-112">Pre-emptive strike on Jupiter brings solar system to the brink of interplanetary war!</a></p>
<p>Take that, Jupiter!</p>
<p>Mars and Venus are monitoring the situation with bated breath.<br />
:-O</p>
<hr />
<p>Exactly 15 years after <a href="http://en.wikipedia.org/wiki/Comet_Shoemaker-Levy_9">Shoemaker-Levy 9</a>!</p>
<hr />
<p>Isn&#8217;t there speculation that Jupiter serves a sort of protective function for the Earth?  Incoming threats like comets and asteroids will tend to get caught in Jupiter&#8217;s gravity well, before reaching the Earth?</p>
<p>Maybe not:</p>
<p><a href="http://news.nationalgeographic.com/news/2007/08/070827-jupiter-comets.html">Jupiter Both an Impact Source and Shield for Earth</a></p>
<p><a href="http://www.newscientist.com/article/mg19526192.200">Jupiter both protects and endangers us</a></p>
<p><a href="http://www.newscientist.com/article/dn12532-jupiter-increases-risk-of-comet-strike-on-earth.html">Jupiter increases risk of comet strike on Earth</a></p>
<hr />
<blockquote><p>Whether they find life there or not, I think Jupiter should be called an enemy planet.</p></blockquote>
<p>&#8211; Classic Jack Handey quote</p>
<hr />
<p><a href="http://www.amazon.com/Europa-Strike-Heritage-Trilogy-Douglas/dp/0380788306"><em>Europa Strike</em></a>, by Ian Douglas (a <em>nom de plume</em> of <a href="http://en.wikipedia.org/wiki/William_H._Keith,_Jr.">William H. Keith, Jr.</a>)</p>
<p>This is the third book of the <a href="http://en.wikipedia.org/wiki/Heritage_Trilogy"><em>Heritage Trilogy</em></a>, which in turn is the first of a trilogy of trilogies (a <em>meta-trilogy</em>?) about the adventures of the U.S. Marines in space.  The last book of the last trilogy, <a href="http://www.amazon.com/Semper-Human-Three-Inheritance-Trilogy/dp/0061238643/"><em>Semper Human</em></a>, was published only this past May.  This is an example of the sub-genre of science fiction called <a href="http://en.wikipedia.org/wiki/Military_science_fiction">&#8220;military SF&#8221;</a>.</p>
<p>Maybe <a href="http://shortcovers.com/shortcovers/Prologue-They-Were-Called-The/sc-hGVuro7UU0CQg_IaK35R0w/page1.html">the dreaded Xul (Hunters of the Dawn)</a> detected a nascent civilization on Jupiter, and decided to drop an asteroid on it!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Profile]]></title>
<link>http://bobwama.wordpress.com/2009/06/18/profile/</link>
<pubDate>Thu, 18 Jun 2009 19:20:25 +0000</pubDate>
<dc:creator>bobwama</dc:creator>
<guid>http://bobwama.wordpress.com/2009/06/18/profile/</guid>
<description><![CDATA[Today&#8217;s Wallpaper: This wallpaper is by DeviantArt&#8217;s RomaneAR. Check out some more of hi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:center;">Today&#8217;s Wallpaper:</p>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-805" title="CGI-Other-14302" src="http://bobwama.wordpress.com/files/2009/06/cgi-other-14302.jpg" alt="CGI-Other-14302" width="600" height="375" /></p>
<p style="text-align:left;">This wallpaper is by DeviantArt&#8217;s RomaneAR. Check out some more of his (or her, I&#8217;m not sure) work at RomaneAR.Deviantart.com.</p>
<p style="text-align:left;">Have you heard about the <a href="http://labs.mozilla.com/contests/extendfirefox3.5/details.php">Extend Firefox</a> competition? For the upcoming release of Firefox 3.5 (RC1 was released yesterday) there&#8217;s a competition for development of new (or updated w/ significant improvement) addons for 3.5. There are some tight prizes, including some awesome software and a new 15&#8221; MACBOOK (I am drooling at the thought). Also some 13&#8221; ones for subcategories. Check out the details at the prior link. I know I am entering (once I teach myself how to script XUL and Javascript that is)- possibly twice even.</p>
<p style="text-align:left;">
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Senior Analyst - London - upto £70k]]></title>
<link>http://calvinjnr.wordpress.com/2009/06/08/tech-director-london-upto-70k/</link>
<pubDate>Mon, 08 Jun 2009 16:59:41 +0000</pubDate>
<dc:creator>calvinjnr</dc:creator>
<guid>http://calvinjnr.wordpress.com/2009/06/08/tech-director-london-upto-70k/</guid>
<description><![CDATA[Reporting to the CEO and founder, you will design, implement and manage the key processes for managi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Reporting to the CEO and founder, you will design, implement and manage the key processes for managing all technical, operational, support and maintenance functions of the enterprise in all markets, starting with the US launch, the UK, Scandinavian, German, Swiss and Spanish markets planned for the latter part of this year, and other international markets in the following years.</p>
<p>RESPONSIBILITIES:</p>
<p>Upgrade, implement, and continually refine the internal technical processes of the company including;</p>
<p>* Production environment</p>
<p>- Hardware Architecture design (Including network components)</p>
<p>- Service Management</p>
<p>- Change Control Management</p>
<p>* Program/Project Management</p>
<p>- Technical Planning</p>
<p>- Operational Planning</p>
<p>* Software &#38; Applications</p>
<p>- Product development</p>
<p>~ Internal and or External Resourcing</p>
<p>~ Server development using PHP, Perl, &#38; Java  on Linux, Apache, MYSQL Architectures</p>
<p>~ Client development using Javascript (Mootools &#38; Jquery libraries) with Ajax, Java, Flash with Red5</p>
<p>~ Xul and Jetpack based browser development</p>
<p>~ Specialized libraries: Mencoder &#38; Ffmpeg, JaxCapture in Java</p>
<p>~ Bespin of Mozilla Labs &#38; Netbeans</p>
<p>~ Interface, Functional &#38; Database Design on Server Side</p>
<p>~ Client browser adaptation, creation and innovation</p>
<p>- Continuous innovation and adaptation on software architecture Code Maintenance</p>
<p>- Documentation</p>
<p>* Quality Assurance</p>
<p>- Requirement Definitions</p>
<p>- User and Test Cases</p>
<p>- White &#38; Black Box Testing</p>
<p>* Reporting</p>
<p>- Financial, Operational and Technical Metrics</p>
<p>- Efficiency Matrix on Business Objectives</p>
<p>* Overall IT Functions</p>
<p>- Corporate Network</p>
<p>- PC and Telephony</p>
<p>REQUIREMENTS:</p>
<p>* Between 3-5 years in a similar role;</p>
<p>* In depth expertise and experience in programming in the following languages: PHP, Perl, Java, Java Script;</p>
<p>* Expertise in Ajax, Flash, Xul &#38; Jetpack;</p>
<p>* Vast experience with client browsers, their capabilities and interoperability with different Web Servers;</p>
<p>* In depth understanding of the configuration potentials of the main web servers IIS; Apache etc;</p>
<p>* Mathematically inclined;</p>
<p>* Excellent Business Analysis skills;</p>
<p>* Expertise and experience in the SQL language, optimal SQL performance, database modeling and data storage:</p>
<p>* Experience managing or being part of a Q&#38;A team;</p>
<p>* Excellent scheduling &#38; project management skills;</p>
<p>* Extreme commitment to meeting time &#38; cost schedules;</p>
<p>* Highly motivated by a start-up environment;</p>
<p>* Excellent communication skills;</p>
<p>* Detail oriented and analytical thinker;</p>
<p>* Pro-active personality;</p>
<p>* Excellent English. Additional language abilities a plus;</p>
<p>* Usability experience and expertise a plus;</p>
<p>* Willingness to relocate to Madrid, Spain for a minimum initial period (6-12 months)</p>
<p>Neil Clements</p>
<p><a href="mailto:neil@majorplayers.co.uk">neil@majorplayers.co.uk</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Arte argentino en la Colección Fortabat]]></title>
<link>http://guiacontratango.wordpress.com/2009/06/08/arte-argentino-en-la-coleccion-fortabat/</link>
<pubDate>Mon, 08 Jun 2009 04:34:29 +0000</pubDate>
<dc:creator>guiacontratango</dc:creator>
<guid>http://guiacontratango.wordpress.com/2009/06/08/arte-argentino-en-la-coleccion-fortabat/</guid>
<description><![CDATA[A partir de este mes, el público podrá conocer en detalle las obras de consagrados artistas argentin]]></description>
<content:encoded><![CDATA[A partir de este mes, el público podrá conocer en detalle las obras de consagrados artistas argentin]]></content:encoded>
</item>
<item>
<title><![CDATA[gContextMenu's imageURL property refactored on Firefox 3.5x]]></title>
<link>http://dafizilla.wordpress.com/2009/06/05/gcontextmenus-imageurl-property-refactored-on-firefox-3-5x/</link>
<pubDate>Fri, 05 Jun 2009 16:04:06 +0000</pubDate>
<dc:creator>dafi</dc:creator>
<guid>http://dafizilla.wordpress.com/2009/06/05/gcontextmenus-imageurl-property-refactored-on-firefox-3-5x/</guid>
<description><![CDATA[Edited on 9 June 2009 Mozilla guys decided to add a getter for imageURL so no extension will be affe]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong><span style="color:#ff0000;">Edited on 9 June 2009</span> </strong>Mozilla guys decided to add a getter for <strong>imageURL </strong>so no extension will be affected by new property <strong>mediaURL</strong> replacement, you can read the full story at <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=497098">bug 497098</a>.</p>
<p>Another time Mozilla community demonstrates its strength,  why nobody considered the impact before modification is another story <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>&#8211;</p>
<p>Today a <a href="http://dafizilla.sourceforge.net/viewsourcewith/index.php">ViewSourceWith</a> user filed a bug about a regression on Firefox 3.5b4, causing VSW to no more open images <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_eek.gif' alt='8O' class='wp-smiley' /> </p>
<p>After dressing the debug uniform I started to investigate the problem.</p>
<p>I&#8217;ve realized the object gContextMenu doesn&#8217;t more contain the property <strong>imageURL</strong> used by VSW and maybe many other extensions.</p>
<p>The <strong>imageURL</strong> property has been renamed/refactored to <strong>mediaURL</strong>.</p>
<p>Honestly the new name fits better its new usage and maybe the <strong>imageURL</strong> property is not intended for usage from extensions.</p>
<p>The poor <a href="https://developer.mozilla.org/en/XUL/PopupGuide/Extensions">gContextMenu</a> documentation doesn&#8217;t describe <strong>imageURL</strong> so maybe I abused its usage.</p>
<p>I think <a href="https://developer.mozilla.org/en/XUL/PopupGuide/Extensions">gContextMenu</a> need a better documentation because its usage is so sexy inside extensions.</p>
<h3>The workaround</h3>
<p>A string find/replace inside code fixed the bug, to maintain compatibility with FF 3.0.x I&#8217;ve modified the code as shown below</p>
<pre><span style="font-size:12px;"><span style="color:#871f78;">var</span> imageURL <span style="color:#781f87;">=</span> gContextMenu<span style="color:#781f87;">.</span>imageURL <span style="color:#781f87;">&#124;&#124;</span> gContextMenu<span style="color:#781f87;">.</span>mediaURL<span style="color:#781f87;">;</span>
</span></pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[XUL-Quellen]]></title>
<link>http://xulpro.wordpress.com/2009/04/28/xul-quellen/</link>
<pubDate>Tue, 28 Apr 2009 13:18:55 +0000</pubDate>
<dc:creator>Exo</dc:creator>
<guid>http://xulpro.wordpress.com/2009/04/28/xul-quellen/</guid>
<description><![CDATA[Weil ich das Rad nicht neu erfinden möchte, werde ich keine ausführliche Dokumentation des XUL-Sprac]]></description>
<content:encoded><![CDATA[Weil ich das Rad nicht neu erfinden möchte, werde ich keine ausführliche Dokumentation des XUL-Sprac]]></content:encoded>
</item>
<item>
<title><![CDATA[XRap Version 1.0]]></title>
<link>http://jsdoodnauth.wordpress.com/2009/04/26/xrap-version-10/</link>
<pubDate>Sun, 26 Apr 2009 18:57:41 +0000</pubDate>
<dc:creator>Joshua</dc:creator>
<guid>http://jsdoodnauth.wordpress.com/2009/04/26/xrap-version-10/</guid>
<description><![CDATA[Well its been a long time coming, a lot of research, and a ton of learning, but here it is.  XRap ve]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Well its been a long time coming, a lot of research, and a ton of learning, but here it is.  XRap version 1.0.  You can now successfully create a Windows Installer(msi) if you are working on Windows, a tarred bunzip2 (tar.bz2) archive if you are working on Linux, and an Apple Disk Image (dmg) if you are working on a Mac.  I have worked out the bugs which I am aware of, but will definately still be working on any new ones that come up.  </p>
<p>Here are the steps for each platform:</p>
<p>Windows:</p>
<ol>
<li>Open up XRap, and select the root of your XULRunner application directory, and click next.</li>
<li>Select the type of License you would like to attach to your application from the drop-down list of available licenses.  You can optionally select your own license, or no license at all. Once you have selected your license option, click next</li>
<li>You must now select the type of installer you would like your end-user to have.
<ul>
<li>Automatic Installer &#8211; Will automatically install your application on to the end-user computer, with no wizard.</li>
<li>Wizard Installer &#8211; Will start the Windows Installer wizard, showing your license agreement on a single page, and giving the option for the end-user to install your application to a custom path.</li>
<li>Minimal Wizard Installer &#8211; Will start the Windows Installer wizard, using only one page, which shows the license agreement, then installs your application to the default directory.<img class="aligncenter size-medium wp-image-434" title="Windows Installer Description" src="http://jsdoodnauth.wordpress.com/files/2009/04/3.png?w=300" alt="Windows Installer Description" width="300" height="243" /></li>
</ul>
</li>
<li>Once your have selected the type of installer you want, click next, and XRap will package your application</li>
<li>When successfully completed, XRap will go to the last page where you can open the directory of where your new msi will be located, and your can close XRap.</li>
</ol>
<p>Linux</p>
<ol>
<li>Open up XRap, and select the root of your XULRunner application directory, and click next.</li>
<li>Select the type of License you would like to attach to your application from the drop-down list of available licenses.  You can optionally select your own license, or no license at all. Once you have selected your license option, click next</li>
<li>You can optionally select to create a zip file of your application for distribution on Windows.  Click next to continue.</li>
<li>XRap will now package your application into a tar.bz2, and optionally a zip file if selected.</li>
<li>When successfully completed, XRap will go to the last page where you can open the directory of where your tar.bz2 file will be located, and your can close XRap.</li>
</ol>
<p>Mac</p>
<ol>
<li>Open up XRap, and select where your XULRunner application (with the .app extension) is located, and click next.</li>
<li>Select the type of License you would like to attach to your application from the drop-down list of available licenses.  You can optionally select your own license, or no license at all. Once you have selected your license option, click next<img class="aligncenter size-medium wp-image-431" title="License Page" src="http://jsdoodnauth.wordpress.com/files/2009/04/picture-4.png?w=300" alt="License Page" width="300" height="248" /></li>
<li>XRap will now package your application into a dmg.</li>
<li>When successfully completed, XRap will go to the last page where you can open the directory of where your dmg file will be located, and your can close XRap.</li>
</ol>
<p>I hope to release an updated version where you can create simple packages for different platforms.  Similar to how you can create a zip file on Linux for distribution on Windows.  My current plans are:</p>
<p>Windows:</p>
<ol>
<li>Create a zip file for release on Linux</li>
<li>Create a zip file for release on Mac, I will have to refactor the directory structure so that it aligns with the Mac model</li>
</ol>
<p>Linux</p>
<ol>
<li>Create a zip file for release on Mac, I will have to refactor the directory structure so that it aligns with the Mac model</li>
</ol>
<p>Mac</p>
<ol>
<li>Create a zip file for release on both Windows and Linux</li>
</ol>
<p>I plan to work on it over the summer, and hope to be compeleted within the next couple months.  Please post any new bugs found on <a title="XRap" href="http://xrap.sourceforge.net" target="_blank">xrap.sourceforge.net</a>.</p>
<p>Enjoy!</p>
<p><a title="XRap" href="http://xrap.sourceforge.net" target="_blank">XRap Version 1.0</a><img class="alignnone size-full wp-image-439" title="xrap64" src="http://jsdoodnauth.wordpress.com/files/2009/04/xrap64.png" alt="xrap64" width="64" height="64" /></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
