Java2Script 1.0.0 Roadmap

Road to Java2Script 1.0.0 release:

  • 1.0.0 M3 will be released at Aug 20, 2006.
    In this release, main features include

    • Full support of Eclipse 3.2.0 beside Eclipse 3.1.*
    • No more need of extra JDT core jar enhancement
    • Dynamic JavaScript loading
    • Early Java reflection implementation
    • JUnit support
    • CTabFolder, Table, Combo, Spinner, ProgressBar, Scale improved
    • Early key navigation support
    • Lazy layout improved
    • Support more look and feels
  • 1.0.0 M4 will be released at about Oct 9, 2006. In this release, all features should be locked.
    Coming features include

    • CoolBar, ToolBar, Menu, ColorDialog, FontDialog, more custom widgets improvement
    • Look and feel manager
    • Key navigation system
    • DND system improvement
    • Windows manager
    • Extension points for RPC calls (only interfaces with a very simple reference implementation)
    • Bug-fix of M3
  • There is no 1.0.0 M5 but will be 1.0.0 RC release at Nov 11, 2006
    Works to be done include

    • Dynamic JavaScript loading performance tunning
    • Packing system tunning
    • J2SClazz core packing and zipping
    • J2S SWT performance tunning
    • J2S SWT packing tunning
    • Benchmark system for Java2Script
    • More integration tunning
  • The final release of 1.0.0 will be released in later December, 2006, about one year after Java2Script is open sourced. All thing may depend on feedback of 1.0.0 RC.
    Works to be done include

    • More tutorials
    • White paper
    • Demo projects using Java2Script
    • Documents
    • Lots of XXX v.s. J2S to tell developers about advantages and disadvantages of J2S.
Posted in Java, Java2Script News, JavaScript, Sharing | Leave a comment

SWT Snippets (Reloaded)

Not all the snippets is supported!
Enjoy finding out which J2S SWT Snippets work. J2S SWT is still under developing.

Why is called “Reloaded”?
In the early stage of Java2Script project, SWT Snippets was a showcase page. And it was also a test case page. So this page is just reloaded form former page. The first time I setuped Snippets page, it cost me some time. But as Java2Script project got much improvement. Now, it’s much easier for me to setup the whole SWT Snippets page. And with more and more improvement, I am sure that it will be more convenient to integrate Java2Script application with existed HTML applications(pages).

Posted in Java2Script News, Sharing, SWT | Leave a comment

Java2Script Getting Started (for M3+)

Java2Script Getting Started (PDF)

It’s for the coming release of Java2Script 1.0.0 M3 and later release.

FAQ list is also to be created in the coming days.

Posted in How To, Java2Script News | Leave a comment

Test Driven Development by Java2Script

Now, Java2Script support JUnit for Test Driven Development(TDD) in developing RIA.

To do so, please set up the J2S development environment from SVN repository. If you would like to learn more details about JUnit support of J2S, you may need to checkout the project net.sf.j2s.java.junit.

After setup J2S environment, do your “Hello J2S World” examples for sure. And then create or import your testcases or testsuites. Make sure that your tests pass in Java’s JUnit test. And then “Run as…” -> “Java2Script Unit Test”, your tests will be run in console mode. You may come up with some failures in Java2Script mode even though all tests is passed in Java mode. For example, assertEquals(new Float(1.0).toString(), “1.0”) may result in comparing “1” with “1.0”, which will be considered as failures. Try to report bugs or try to avoid such buggy way.

Currently, JUnit tests over SWT are not supported yet.

Java2Script’s JUnit support will be in the next milestone release scheduled on middle of August.

Posted in How To, Java2Script News | Leave a comment

Loading J2S SWT Application Inside Existed HTML Pages

See the home page for inline demo or visit http://j2s.sourceforge.net/j2s-demo.js for more details.

It seemed that sourceforge.net was very slow for my network location. I had to refresh one or two times to get all *.js correctly loaded. And it seemed that waiting for every *.js is a very boring experience.
Enjoy the inline demo.

Posted in Java2Script News, JavaScript | Leave a comment

A Link An Application

For example:

javascript:(function(){var d=document,b=%22http://java2script.ognize.com/1.0.0-m3/%22,t=%22onreadystatechange%22,x=d.createElement(%22SCRIPT%22),f=function(){var s=this.readyState;if(s==null||s==%22loaded%22||s==%22complete%22){var c=%22org.eclipse.swt.examples.controlexample.ControlExample%22;$CL1(b);$CL2(b+%22../control-examples/%22);$CL3(c,function(){eval(c+%22.main([]);%22);});}};x.src=b+%22j2slib.js%22;(typeof x[t]==%22undefined%22)?x.onload=f:x[t]=f;d.getElementsByTagName(%22HEAD%22)[0].appendChild(x);return;})();

will link to an SWT control examples. We can also call this as “A Link An Application”(ALAA).

OK, let’s see what is going on. Now load SWT control examples from java2script.ognize.com (test site only, may be slow and unstable, enjoy it) into this page.

Or, you can copy the link of SWT control examples, and then visit a new HTML page, for example, visit Google, and then paste the link to the location, and then go. You should find the SWT control examples will be loaded inside Google’s page. All you dealing with is just a link! But you alreay get an application everywhere inside your browser.
Users can also bookmark the “javascript:…” links. To bookmark a “javascript:…” link, you should first bookmark a normal HTML page, and then copy the “javascript:…” link location and paste as URL location in the bookmark’s properties dialog. Some browsers (e.g. Opera) will let you change URL when you’re bookmarking without a later modification of URL.
And whenever users want to load the application, users can click the bookmark, which will bring up the application in users’ currently visiting HTML page. For example, if you have already bookmarked the above SWT control examples application as “javascript:…” link. And if you are visiting visit W3C, and you can click the bookmark, and the application will be loaded without leaving the W3C pages.

That is the mean of “A link An Application”. A “javascript:…” link is an application, which may be hosted inside any given HTML pages. And the “javascript:…” link would be a very useful and complicated application besides those simple “javascript:history.go (-1);” or “javascript:alert(document.lastModified);”. So there are chances that you can deliver your useful and complicated web applications via generated “javascript:…” links into any other HTML paes or other web applications.

You can also considered the “javascript:…” link as plugin extensions to the browsers that needs no installations (Only bookmarking). There are plugins for Firefox or IE. Most of those plugins need installations and may also need manually updates or uninstallations. But the “javascript:…” links is free of those deployment instructions. All the application is just a “javascript:…” link. That is enough simple.

A link is an application. An application is a link.

Posted in A Link An Application, ALAA, Java, Java2Script News, JavaScript, Sharing, SWT | Comments Off on A Link An Application

Hosting Update Manager on Sourceforge’s Mirrors

Now Java2Script can be installed from Eclipse Update Manager with URL:

http://j2s.sourceforge.net/update/

It will redirect the download traffics to Sourceforge’s mirrors, so it will be safe and fast.

More technical details about hosting Eclipse plugin update manager on Sourceforge’s mirrors:

First, create your feature project and update site project. site.xml support mirrorURL attribute, you can create the mirrors.xml for your project’s mirror list of Sourceforge.net.

Second, you should map those “plugins/*.jar” to “*.jar” without the prefix “plugins/”.

Third, you should use “.htaccess” to redirect the default *.jar downloads (Someone will always select the default server, which is is not sourceforge mirror, to install) to a default mirror server. The “.htaccess” may looks like:

RewriteEngine On
RewriteBase /update/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^net\.sf\.j2s\.(.*)\.jar$ http://superb-east.dl.sourceforge.net/sourceforge/j2s/net.sf.j2s.$1.jar [R]

Last, use “File Release Sytem” to release your *.jar and site.xml, and update your .htacces, site.xml with features/*.jar (always small in size) into web site. And then test the installation.
Reference:

Plugging into SourceForge.net

http://www.eclipse.org/articles/Article-Plugging-into-SourceForge/sourceforge.html

Posted in How To, Java2Script News, Sharing | 2 Comments

Java2Script 1.0.0 M2 Released

New and Noteworthy
==================
Java2Script Core
—————-
1. Add Javadoc @j2s* support, which support for native JavaScript
2. Identifiers minimization
3. Fixed bug on compiling private field and methods, nested anonymous class and inner

non-static class, and remove unnecessary final variables
4. Optimize the size of generated *.js
5. Support regular expression method of String
6. Support java.util.ResourceBundle
7. Support editting the converted *.js
8. Support converting *.properties into *.js

Java2Script SWT
—————
1. Support blocking of Shell
2. Refining of widget Label, Link, Button, Text, Group, TabFolder, Composite,

Decoration, Shell, See Control Example for details
3. Support Image on Widgets
4. Support most of listeners for SWT widgets
5. Support dispose method of Widget
6. Support exporting the UI to static HTML
7. Optimize layout speeds by deferring layout
(CTabFolder, Combo, Table, Tree, and others are still under improving)

Java2Script AJAX
—————-
1. AJAX for both Java and JavaScript are integrated into Eclipse platform

Java2Script Developer Team
————————–
Welcome new developer – Soheil Hassas Yeganeh, who joined the developer team in late April, 2006.

Download Java2Script 1.0.0 M2 for Eclipse 3.1.*

For more details, please visit http://j2s.sourceforge.net/

Posted in Java2Script News | Leave a comment

Screenshot of SWT Control Example

The Control Example is one of Eclipse SWT examples. I modified the tabs into dynamical loading tab so the example will work faster. You still need to wait about 8 seconds for the example to initialize besides the about 800+k of *.js downloads. Be ENOUGH patient, if you want to get a real tour of JavaScript version of SWT.

Of course the performance and the size of *.js will be optimized to an acceptable level in the future.

PS: J2S SWT Control Example on j2s.sourceforge.net

And finally, after sometime of compressing and ripping out unused codes, after packed by dean edward’s packer, it’s about 250k of the size, and take about 5s to initialize. Considered acceptable when comparing to native Java SWT application.
Now, you can download the Control Example(*.zip 139k), and view the example locally.

J2S SWT Control Example

Posted in Screenshot, Sharing, SWT | Leave a comment

Ajax web pages

Another demo about Java2Script SWT. It also show the coming features of exporting static HTML codes from the J2S SWT window besides showing abilities of reading web pages in AJAX way.
http://c.ognize.com/j2s-ajax-pages/

or ajax-web-pages at j2s.sourceforge.net

For a much faster view (HTML + CSS + a few lines of JS), please visit the exported static demo page

J2S with static HTML export support

Posted in Sharing, User Experience | 1 Comment