Open main menu

CDOT Wiki β

XBL

Revision as of 12:24, 4 October 2006 by Yshen6 (talk | contribs) (XBL (eXtensible Bindings Language))

XBL (eXtensible Bindings Language)

A XML language that used for declaring the behavior of XUL widgets. XBL describing a set of bindings that can be attached to bound elements. The binding implements new methods and properties to the bound element. We can use XUL to define the layout of userinterface, then we can use BXL to change the pieces of the function.

For Example: Create a window box by UXL, then we attach OK/Cancel buttons in the box.

XUL (example.xul):

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

<window
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <box class="okcancelbuttons"/>
</window>

XBL (example.xml):

<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
         xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <binding id="okcancel">
    <content>
      <xul:button label="OK"/>
      <xul:button label="Cancel"/>
    </content>
  </binding>
</bindings>