Developer Forums | About Us | Site Map
Search  
HOME > TUTORIALS > CLIENT SIDE CODING > XML TUTORIALS > CREATE WEB APPLETS WITH MOZILLA AND XML


Sponsors





Useful Lists

Web Host
site hosted by netplex

Online Manuals

Create Web Applets With Mozilla And XML
By Nigel McFarlane - 2003-12-24 Page:  1 2 3 4 5 6 7

Why XUL

XUL, the XML User-interface Language, (pronounced "zool" when you're with the cool) is to the Mozilla Platform what Swing is to the Java environment or what Gtk is to X-Window. It is a set of GUI widgets. These widgets are suitable for applications that have traditional, non-HTML GUIs. The menus, toolbars, scrollbars, and dialog boxes of many Mozilla-based browsers are built using XUL documents.

XUL has extensive cross-platform support -- a Macintosh menu looks like a Macintosh menu and a GNOME button looks like a GNOME button. To perform this task, XUL relies heavily on the current platform's native widgets. This strategy is similar to that used by the IBM-backed Eclipse development tool. The similarity is limited though, because Eclipse ultimately expresses GUI widgets as Java classes, whereas Mozilla expresses them as tags in the XUL dialect of XML.

Why does XUL exist? Mostly because HTML is great for displaying hypertext documents, but terrible for displaying GUIs. Traditional Web-based applications use endless amounts of effort trying to shoehorn HTML into the look-and-feel of a traditional forms-and-menus application. That was never a purpose for which it was intended.

The addition of form elements to HTML (FORM) did little more than create a new way to implement thin-client block-mode applications in the style of the venerable 3270 terminal. Like the 3270, HTML provides batched-up form submission. Character-based applications ultimately gained efficient user-navigation systems, but that was all lost when GUI applications came along. Subsequently GUI applications added back their own navigation structures, using the mouse and widget feedback.

When HTML forms came on the scene, they copied the design of block-mode terminals, but without the tight navigation and without replacing it with a proper GUI equivalent. Under HTML, the user is left to guess which visual elements on a given page might be user controls and which are just decorations. Therefore, for GUI-driven applications, HTML isn't that great a starting point. That's the reason why Java applets were met with such positive market hysteria when they first appeared -- they presented an opportunity to provide a real GUI.

Now there is XUL. XUL takes the very-thin-client model of HTML and thickens it up a bit. Instead of a trivially few form elements, as any ultra-thin client might offer, XUL provides a full set of widgets typical of a more complex piece of client software.

In the past, such client software might have been written as a Java application, perhaps in Tcl/Tk or in Visual Basic. Now thicker clients can be implemented as one or more XUL documents and delivered over the Web (or just processed locally). The application is expressed to begin with as a document rather than as a set of objects. That document is read by a running copy of the Mozilla platform which displays the specified GUI for the user's consumption.

Thus, XUL combines the lightweight attractiveness of HTML with the structured usability of traditional GUIs.



View Create Web Applets With Mozilla And XML Discussion

Page:  1 2 3 4 5 6 7 Next Page: A Closer Look At XUL

First published by IBM developerWorks


Copyright 2004-2024 GrindingGears.com. All rights reserved.
Article copyright and all rights retained by the author.