home
products
education
support
partners
company

introduction

get started

articles

manual

tutorials

reference docs

case studies

knowledge base

goodies

screenshots

demos

echoes

Carousel zone


SourceForge.net Logo

home

forums

downloads

bugs

mailing list
XUI Zone - articles

number of ratings 0
average rating 0.00

New Widget Sets: SWT + HTML

21-April-2005

Coming soon: XUI 2.0 will introduce support for SWT and HTML Widget sets.

SWT

Although very different from the Swing and AWT widget sets we have managed to build these new widget sets into the framework in a pretty seamless way. The SWT integration involved considerable changes to the structure of some key classes such as XPage and XApplet but we had been planning on making such changes in order to add greater flexibility to the platform, particularly with regard to event handling.

Most XUI developers will not notice much difference as the XUI framework hides most of the details of using a particular toolkit. Of course there will be some minor difference in behavior and performance given the difference between the widget platforms. In particular the SWT toolkit requires native libraries and this will necessitate special installation support.

So far we have implemented all the major components in the XUI framework using SWT, including data binding and event binding. We haven't completed a full implementation of all the SWT widgets and we have yet to tackle some of the minor differences such as the opaque/transparent defaults for individual widgets but these are all relatively minor issues. Perhaps more significant is the difference in the event models where there may be some unavoidable differences that require widget specific code however we expect this to be rare.

Anyhow, here's a sneak preview of the Counter example running as a SWT application:

HTML

Ok, so HTML isn't a widget set. Well, since we split the XUI framework from a specific widget set then why not use HTML for the UI? After all you can create some pretty snazzy UIs with HTML and there are oodles of HTML authors and developers out there.

HTML is problematic when it comes to writing serious business applications and the mess that normally results from coding in JavaScript can be a nightmare to deal with. We set out to tackle similar problems with IDE generated Java UI code and got good results so in this HTML work we are trying to bring some of the same benefits to the HTML world.

To illustrate this lets look at how we implement the counter in HTML using XUI. First we have the HTML:

Listing 1 - The HTML version





Counter Example


In the above HTML there is no JavaScript for updating the counter or even for do the counter calculations,. Instead the xui.js library is included and three events are specified. Just as in Java this event binding binding the UI components to the business logic implemented in Java. Beneath the scenes the events are handled by Java methods just as in any other XUI application. No need to worry about the browser or the version, all the widget details are taken care of just as with an AWT or Swing widget. The result is the same clear separation of UI and model that you have come to expect from XUI.

The XUI library supporting this interaction is implemented in JavaScript and Java. The Java can be compiled for JDK 1.1.4 so it will run in just about every Java enabled browser, new or old. As we finalize this technology we will issue more details and documentation, but until then here's a screenshot of the Counter running as an HTML application:

Figure 1 - The HTML version

comments


If you were logged in you could rate this article or add a comment.