生命开始情不情愿都要走完一生

2008年2月18日星期一

XUL COLLECTION

XUL
XUL is a cross-platform language for describing user interfaces of applications .It is an XML language so all features available to XML are also available to XUL


XUL application Model
  • Firefox extension
  • Standalone XULRunner application

XULRunner is a packaged version of the Mozilla platform which allows you to create standalone XUL applications. A browser isn't required to run these applications, as they have their own executable file

  • XUL package
  • Remote XUL application

chrome URL

chrome://<package name>/<part>/<file.xul>

The chrome URL always begins with 'chrome://'. Much like how the 'http://' URL always refers to remote web sites accessed using HTTP and the 'file://' URL always refers to local files, the 'chrome://' URL always refers to installed packages and extensions.


Package Organization

The chrome directory is where you will find all the files that describe the user interface used by the Mozilla browser, mail client and other applications. You will typically put all of the XUL files for an application in this directory, except for extensions which will be installed in the extensions directory for a particular user. Just copying a XUL file into the 'chrome' directory doesn't give the file any extra permissions nor can it be accessed via a chrome URL. To gain the extra privileges, you will need to create a manifest file and put that in the chrome directory. This file is easy to create, as it is typically only a couple of lines long. It is used to map a chrome URL to a file or directory path on the disk where the XUL files are located.


A package can be stored either as a directory or as a JAR archive.


Manifest Files


  • A manifest file describes a package and maps its location on disk to a chrome URL.
  • The manifest files in the chrome directory will be examined when a Mozilla application starts up to see what packages are installed. That means that all you need to do to install a new package is add a new manifest file either into the application
  • content <packagename> <filepath>
  • skin browser classic/1.0 jar:classic.jar!/skin/classic/browser/
  • locale browser en-US jar:en-US.jar!/locale/browser/

  • rome directory or the user specific chrome directory.

CSS SELECTOR
button Matches all button tags
#special-button Matches the element with an id of special-button
.bigbuttons Matches all elements with a class of bigbuttons
button.bigbuttons Matches all button elements with a class of bigbuttons
toolbar > button Matches all buttons that are directly inside toolbar elements.
toolbar > button.bigbuttons Matches all button elements with a class of bigbuttons that are directly inside toolbar elements.
button.bugbuttons:hover Matches all button elements with a class of bigbuttons but only while the mouse is over them.
button#special-button:active Matches all button elements with an id of special-button but only while they are active (being clicked on).
box[orient="horizontal"] Matches all box elements that have an orient attribute that is set to horizontal.

没有评论: