Monthly Archives: March 2007

Instantiations Donated WindowBuilder Pro to Java2Script for Development

Instantiations is giving back to the community by donating its products for use by developers of Open Source projects. For more information, please visit http://www.instantiations.com/company/opensource.html

Java2Script is mainly focusing on converting SWT desktop applications. And WindowBuilder Pro is sure a professional GUI designer to help developers building SWT desktop applications. As from earlier trials ( http://j2s.sourceforge.net/screenshots.html#swt-designer ), I found that SWT Designer is a great tool to help designing SWT applications. In order to improve our development efficiencies, I decided to apply for a copy of WindowBuilder Pro instead of limited trial versions. And Eric Clayberg of Instantiations is very kind to give a quick reply and is very generous to donate WindowBuilder Pro to Java2Script team.

Thanks Instantiations Inc. I think WindowBuilder Pro will help us working more efficiently and improving Java2Script plugin to a higher quality level.

Posted in Java2Script News, SWT, WindowBuilder Pro | Leave a comment

Java2Script 1.0.0 M5 Released

The long waited 1.0.0 M5 Release (Once supposed to be 1.0.0 Release Candidate) finally came.
To download and install Java2Script M5, please check
http://j2s.sourceforge.net/download.html
and
http://sourceforge.net/project/showfiles.php?group_id=155436
Regard,
Zhou Renjian
===============
1.0.0 M5 (March 16, 2007)
New and Noteworthy
==================
Java2Script Core
—————-
1. Use Apache Harmony JRE sources instead.
2. Improved ClassLoader now supports multiple threads loading from multiple sites.
3. Lots of ClassLoader bugs are fixed to make sure *.js or *.css are correctly loaded or applied.
4. ClassLoader’s class loading is notified in a half-transparent messagebar.
5. Library *.js can be loaded from Firefox Add-on.
6. Java2Script inner console’s color is now black on white.
7. Java2Script related projects can be created by wizards.
8. Java2Script compiler is refactored a little.
9. More *.js optimized configuration for Apache HTTPD server, including gzip encoding.
Java2Script SWT
—————
1. Window manager is introduced.
2. Shell’s maximizing and minimizing are improved.
3. Increasing or decreasing font size in Firefox is supported.
4. Widgets are improved.
5. SWT lazy loading is built inside.
Java2Script AJAX
—————-
1. Simple RPC protocol is modified
2. Simple RPC now supports Cross Site Script.
Java2Script Example
——————-
1. Java2Script version of Google Talk ( http://demo.java2script.org/gtalk/ )

PATCH UPDATE:

If you download or install Java2Script 1.0.0 M5 after March 21, 2007, you should ignore this patch.

If you download or install Java2Script 1.0.0 M5 before March 21, 2007, you may need to make a patch following the instructions:

Because of a not tested bug that the packed Common.z.js in plugins/net.sf.j2s.lib_1.0.0(.v510/.v520)/j2slib/org/eclipse/swt/widgets/ does not contain TabItem.js, which will result in errors of “$wt.widgets.TabItem is not a constructor” when loading Java2Script SWT application that uses TabFolder widget.

To fix up the problem, please download the patch, and unzip it, replace the old Common.z.js with the new Common.z.js.

If you also download the sources, please replace net.sf.j2s.lib/build/build.xml with the new build.xml.

If you have already installed Java2Script Firefox Add-on, please replace **Path to your Firefox profiles**/extensions/{d60b46a9-bfe3-4b22-8844-07089202e0e6}/chrome/content/
java2script/1.0.0-m5/org/eclipse/swt/widgets/Common.z.js with the new one. In Windows, Common.z.js may be in **System Drive**:\Documents and Settings\**Your Login Name**\Application Data\Mozilla\Firefox\Profiles\**Unique String**\extensions\{d60b46a9-bfe3-4b22-8844-07089202e0e6}\chrome\content\
java2script\1.0.0-m5\org\eclipse\swt\widgets\.

I feel very sorry about the inconveniences.

March 21, 2007

Posted in Java2Script News | Leave a comment

Java2Script’s GTalk

I spent about three days writng an SWT based Google Talk client. And the client used Smack Jabber library, which has simple APIs. As writing the client, I kept the code compatible with Java2Script, which means that I can use the latest Java2Script daily release to pack it as a web servlet application and deploy it as rich internet application (RIA). Here is snapshot of Java2Script version of Google Talk:

Java2Script's GTalk

And here is the online Java2Script’s GTalk.

And because Java2Script’s SimpleRPC supports Cross Site Script, the above application can be loaded from any pages by adding the following HTML

Launch GoogleTalk

to your page.

Or you can just copy the above “javascript:…” part (without quotes) and paste it to address bar and go. You will get a Google Talk client (pure JavaScript) in your page (this page or other pages). This “javascript:…” part is considered as A Link An Application (ALAA).

By digging about Google Talk on Digg.com, I found that Google Talk Gadget on Google’s personalized homepage was really hitting the latest news.

Enjoy it.

Update:

The Java2Script’s Google Talk sources are available at SVN repository now:
http://j2s.svn.sourceforge.net/viewvc/j2s/trunk/demos/org.java2script.demo.gtalk/

And you can also download j2s-1.0.0-m5-gtalk.zip, unzip it and deploy gtalk.war to your Java servlet container.

Posted in A Link An Application, AJAX, ALAA, Java2Script News, RPC, Screenshot, Simple RPC, SWT | 2 Comments

Compressed JavaScript on Apache HTTPD Server

As Java2Script’s library size is getting huger and huger, loading *.js is a critical job for Java2Script. And I decide to output compressed *.js to save loading bandwidth.

In httpd.conf or .htaccess file, add the following:

<IfModule mod_deflate.c>
# Netscape 4.x or IE 5.5/6.0
BrowserMatch ^Mozilla/4 no-gzip
# IE 5.5 and IE 6.0 have bugs! Ignore them until IE 7.0+
BrowserMatch \bMSIE\s7 !no-gzip
# Sometimes Opera pretends to be IE with "Mozila/4.0"
BrowserMatch \bOpera !no-gzip
AddOutputFilterByType DEFLATE text/css text/javascript application/x-javascript
Header append Vary User-Agent
</IfModule>

You can read more about mod_deflate document.

In my experiments, I found that IE 6.0 had a strange bug in loading compressed *.js, so IE 6.0 was fed with huge raw *.js.

In normal bandwidth connection with Firefox 2.0, it takes about 16 seconds for the first time loading and running Java2Script application, and it takes about 6 seconds for later running (Cached *.js are applied). From the log file, there are about 20~30 *.js/*.css/*.png/*.gif hits, which counts up to about 150k. Thanks for the mod_deflate of Apache HTTPD Server. It saves a lot of bandwidth on those maybe 600k+ *.js files. And I considered such Java2Script application loading or running acceptable.

By the way, long waited Java2Script Milestone 5 release is coming. Lots of new features are added.

Update: For more details, please also read article “Compressing and Deploying JavaScript“.

Posted in Apache, JavaScript | Leave a comment