What is XUL?

by Vijay 2010-01-27 18:54:11

XUL (XML User Interface Language) is Mozilla's XML-based language that lets you build feature-rich cross platform applications that can run connected or disconnected from the Internet. These applications are easily customized with alternative text, graphics and layout so they can be readily branded or localized for various markets. Web developers already familiar with Dynamic HTML (DHTML) will learn XUL quickly and can start building applications right away.

XUL (pronounced "zool" and rhyming with "cool") was created to make development of the Mozilla browser easier and faster. It is an XML language so all features available to XML are also available to XUL.

Most applications need to be developed using features of a specific platform making building cross-platform software time-consuming and costly. A number of cross-platform solutions have been developed in the past. Java, for example, has portability as a main selling point. XUL is one such language designed specifically for building portable user interfaces.

It takes a long time to build an application even for only one platform. The time required to compile and debug can be lengthy. With XUL, an interface can be implemented and modified quickly and easily.

XUL has all the advantages of other XML languages. For example XHTML or other XML languages such as MathML or SVG can be inserted within it. Also, text displayed with XUL is easily localizable, which means that it can be translated into other languages with little effort.

XUL provides the ability to create most elements found in modern graphical interfaces. Some elements that can be created are:

* Input controls such as textboxes and checkboxes
* Toolbars with buttons or other content
* Menus on a menu bar or pop up menus
* Tabbed dialogs
* Trees for hierarchical or tabular information
* Keyboard shortcuts

The displayed content can be created from the contents of a XUL file or with data from a datasource. In Mozilla, such datasources include a user's mailbox, their bookmarks and search results. The contents of menus, trees and other elements can be populated with this data, or with your own data supplied in an RDF file.

The following is an example XUL file , it will display a button with the label as 'button1'


<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>

<window title="XUL Layout"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/x-javascript"
src="chrome://global/content/dialogOverlay.js" />

<description><html:h1>XUL Box Layout</html:h1></description>

<vbox flex="1" style="overflow: auto">

<groupbox>
<caption label="flexiness" />
<hbox>
<button label="button1" />
<button label="button2" />
</hbox>
</groupbox>

</vbox>
</window>


Tagged in:

955
like
0
dislike
0
mail
flag

You must LOGIN to add comments