Here’s an interesting link for a Friday. Viktor Zeman on Quality Unit sent us a link to “PostAffiliateXpress“, some boring IT application with an interesting interface and an even more intriguing back-end.
The UI combines a Vista-like “Start” menu along with an OS X-like dock (using everyone’s favorite fish-eye widget). It also has a built-in widget system that leverages Google Widgets. Overall, it’s a pretty nice implementation of a desktop and windowing in Ajax.
The framework itself is “GwtPHP” which attempts to take all the advantages of GWT and deploy them to PHP backends in an attempt to solve the problem of limited Java-friendly hosting services. Unfortunately, the framework isn’t available for use until sometime in early November.
Dual-License
The developers intend to use the familiar “free for hobbyists, pay up for commercial use” licensing model (what their licensing page calls a “what for what” model).
Give some feedback
Viktor says that they are quite keen to get feedback from folks on the project, so interested folks should get in touch, let them know what you think about the licensing model, and perhaps get early access, etc.
Darrell Meyer has announced the release of Ext GWT 1.1 which is said to “shortens the feature set gap between Ext JS.”
New Features
The Grid component wraps the Ext JS grid, and it includes support for grid plugins which fit into component lifecycles. You can also use a subclass, EditableGrid which…. allows you to edit content on the fly.
Auto complete has been added to the combo boxes a la Google Suggest.
Portal is a custom layout container that uses a multi-column layout on contains Portlets. Each Porlet can be drag and dropped to change order or move to another column. Each Portlet can contain any content and supports icons to expand / collapse, close, etc.
The desktop mimics the behavior of the operating system look at feel. It is now possible to create multi-window applications with support for a task bar and start menu. Windows support normal, maximize, and minimize states. The start menu is a custom menu that allows new menu items. In addition, there is support for a “task” area for adding additional items.
Java Bean Support with BeanModel
The Ext GWT Store and Binder API work with ModelData instances. The primary goal of ModelData is to provide a type of “introspection” as GWT does not allow runtime inspection of Java objects. You can query ModelData for a list of properties it contains, and these properties can be retrieved and set using the parameter name with the get and set methods.
Although this approach works, it forces you to either implement the ModelData interface in your Java Beans or extend the Ext GWT base classes that implement the ModelData interface. What is missing is a way to use your Java Beans as is, without having to extend the Ext GWT base classes or implement an “invasive” interface.
There are also new examples:
Forum search is an example of a combo box, using a custom XTemplate, and remote data. The data can be paged with built-in support for a paging toolbar.
Image Chooser shows loading a ListView in a Window. Each item has a linked details view, and the ListView supports custom sorting and filtering.
This example shows a Dialog using an AnchorLayout to “anchor” the form fields to the dialog dimensions. When resized, the fields will adjust their size to match the dimensions of the dialog.
I have seen the GWT team working very hard indeed on GWT 1.5, and they must be very happy to see the final release shipped and complete:
GWT 1.5 delivers what we think are an impressive number of improvements, about four hundred issues if you’re counting. We’re also happy that one of those is issue 168, our most-requested feature, Support for Java 5.
The high level new feature sets are:
Java 5 language support and enhanced JRE emulation
Performance optimizations and easier JavaScript interop
Prettier widgets, better DOM, accessibility, and bi-di
The project is a collection of libraries that provide Java language bindings
and API specific ‘plumbing’ for some Google JavaScript APIs. The goal is to
make it easy for developers to use these JavaScript APIs with GWT. Libraries
available at this time include a new version of Gears, as well as new
libraries for Gadgets and the Google AJAX Search API.
Gears 1.1 Library
A new version of the Gears library is available. In addition to the earlier
version’s support for the Gears LocalServer, Database, and WorkerPool, 1.1
adds integrated support for offline applications and updated sample
applications. The bindings have also been refactored to use GWT 1.5
JavaScript overlay types and a new package hierarchy.
Gadgets 1.0 Library
The Gadgets library simplifies gadget development with GWT by automatically
generating a Gadget specification from Java source and inserting a selection
script in the specification much like a regular GWT project. After compiling
your gadget with GWT, all files are in place to publish your gadget. This
version currently supports the legacy Gadgets API based on the _IG_…
namespace.
Google AJAX Search 1.0 Library
The Google AJAX Search API lets you put Google Search in your web pages,
including Web, Local, and Multimedia searches. This library allows you to
access the API from Java code compiled with the GWT compiler without having
to write additional JavaScript code.
Sanjiv Jivan, original creator of GWT-Ext, posted on SmartGWT, a new wrapper on top of SmartClient.
Charles Kendrick of Isomorphic, creator of SmartClient, announced the new project as well as the approach they have taken:
we’ve taken an approach of generating GWT code from SmartClient’s documentation, combined with hand-coding portions that can’t feasibly be generated. By tweaking our documentation set to contain additional metadata (some of it GWT-specific), we’ve been able to generate code you might not otherwise expect, including things like enumerated constants and convenience constructors.
What this means is that the first release of SmartGWT will provide the complete SmartClient API, fully documented.
Button button = new Button("myButton", "Click me");
button.addClickListener(new ClickListener(){
publicvoid onClick(ClickEvent event){
ISC.say("Hello World!");
}
});
Sanjiv Jivan joined the project under the terms that Isomorphic sign a document that said:
The founders of Isomorphic Software are committed to keeping a complete, up-to-date version of SmartClient available under an LGPL license.
We continue to invest heavily in building new features, skins, tutorials, and tools for SmartClient LGPL.
We think it's normal and expected that some people receive great benefit from LGPL software and do not pay. The spirit of open source, in a nutshell, is that releasing free software creates so much wealth that the portion that flows back to you is more than enough.
Bruce Johnson of the GWT team has continued the deep dive into GWT with a posting on a new GWT 1.5 feature: JavaScript overlay types. This feature goes beyond the JNSI technique to "make it easy to integrate entire families of JavaScript objects into your GWT project. There are many benefits of this technique, including the ability to use your Java IDE's code completion and refactoring capabilities even as you're working with untyped JavaScript objects."
The first example that Bruce gives is to mix JSON objects with Java:
// The JSON object gets its Java type implicitly based on the method's return type
privatenative Customer getFirstCustomer(){
// Get a reference to the first customer in the JSON array from earlier
return $wnd.jsonData[0];
}
}
Bruce then shows us some performance wins that you get, as GWT gets to do a lot of inlining:
A quick digression for compiler geeks. Another neat thing about overlay types is that you can augment the Java type without disturbing the underlying JavaScript object. In the example above, notice that we added the getFullName() method. It's purely Java code — it doesn't exist on the underlying JavaScript object — and yet the method is written in terms of the underlying JavaScript object. In other words, the Java view of the JavaScript object can be richer in functionality than the JavaScript view of the same object but without having to modify the underlying JS object, neither the instance nor its prototype.
(This is still part of the digression.) This cool wackiness of adding new methods to overlay types is possible because the rules for overlay types by design disallow polymorphic calls; all methods must be final and/or private. Consequently, every method on an overlay type is statically resolvable by the compiler, so there is never a need for dynamic dispatch at runtime. That's why we don't have to muck about with an object's function pointers; the compiler can generate a direct call to the method as if it were a global function, external to the object itself. It's easy to see that a direct function call is faster than an indirect one. Better still, since calls to methods on overlay types can be statically resolved, they are all candidates for automatic inlining, which is a Very Good Thing when you're fighting for performance in a scripting language.
Chosr is another Quicksilver inspired piece of software, that lives in the Web, created by Julius Eckert using GWT.
Very interesting to see the interactions, although I wonder a little on the usage. The great thing about Quicksilver is that you hit a quick key combo and you are there. You type what you need, and you are sent off again.
$wnd.sayHello(name); // $wnd is a JSNI synonym for 'window'
}-*/;
But finally, what about if you wrote a bunch of Java code for GWT, and you want JavaScript to call that? Simply link the code back through the $wnd world:
Darrell Meyer has announced Ext GWT 1.0. This is the first fully stable release of the product and it includes a lot of goodies including:
Documentation: new screencasts of the various steps
GWT 1.5 support: "Ext GWT is a 100% native GWT application written in Java. Ext GWT does not wrap any 3rd party JavaScript and does not use any external JavaScript files. Ext GWT fully leverages the GWT API including the widget lifecylce, events, listeners, messaging, and RPC."
"Performance was a high priority item for the Ext GWT 1.0 release. Many changes were made since the first beta releases. Initial rendering times are quicker and the new layout code reacts quicker to window resizing. Improvements can easily be seen in the Explorer demo."
Advanced Form Layouts
Improved Data Loading, Store, Binder, and Field API
Looks like a very solid release indeed. Congrats to the team.
Alex Moffat has written up an exploration of GWT linkers. It looks at the linking part of the GWT compilation step using as an example a linker that creates a sort of manifest for the JavaScript files created by compilation so that you can easily tell which file goes with which browser/locale/etc. combination.
In GWT 1.5 the build process is internally divided into two phases, compilation, which creates JavaScript from Java, and linking, which takes the JavaScript and other resources produced by the compilation phase and packages it for deployment. I wanted to understand a bit more about the linking process after seeing Bob Vawter talk about Resource Bundles and Linkers in GWT at the Google I/O conference. To try and help me do that I’ve created a linker that you can include in you build process to create a sort of manifest file listing which generated JavaScript file applies to which permutation of browser, locale etc.
To create a linker and have it called during the build process you need to do four things
Create a class that implements com.google.gwt.core.ext.Linker
Add a LinkerOrder annotation to the class to define whether the linker should run before the primary linker, after the primary linker or instead of the primary linker. You’re allowed as many linkers before and after the primary as you like but only one primary linker.
Define and add the linker in a <module>.gwt.xml file.
Include the new class in the classpath when running the gwt compiler.
The 1.5 RC1 build provides three different primary linkers that produce three different ways of packaging the compiler output for loading by the browser. The standard linker produces the familiar <module>.nocache.js file that loads the correct <strong name>.cache.html for the target browser. This is the linker that is added in Core.gwt.xml and so is the default linker that is used. Also provided are a cross site linker that creates a <module>-xs.nocache.js and a single script linker. You use the cross site linker if you need to host the GWT generated artifacts on a separate domain from your main site, for example if you use www.mysite.com for serving dynamic content and put all the static stuff, including JavaScript, on static.mysite.com. The single script linker can be used when the compilation process always creates a single JavaScript file that is applicable to all permutations.