ITPub博客

首页 > Linux操作系统 > Linux操作系统 > XUL简介(转)

XUL简介(转)

原创 Linux操作系统 作者:ilg 时间:2019-05-09 15:48:04 0 删除 编辑
XUL简介(转)

  Why use XUL?

  为何使用XUL?

  翻译者:翟翔 legendren2008@yahoo.com.cn 最后翻译更新:2005年3月14日星期一

  The XML User Interface Language (XUL) is a markup language for creating rich dynamic user interfaces. It is a part of the Mozilla browser and related applications and is available as part of Gecko. It is designed to be portable and is available on all versions of Windows, Macintosh as well as Linux and other Unix flavours. With XUL and other Gecko components, you can create sophisticated applications without special tools.

  XML用户界面语言(XUL)是用来创建丰富动态用户界面的语言。它是Mozilla浏览器的一部分,也是和Mozilla相关联的应用程序,并且可以作为Gecko的一部分。它设计成为适应所有版本的Windows,Macintosh,还有Linux和其他的Unix操作系统。拥有了XUL和其他的Gecko组件,你就可以创建精密复杂的应用程序而不用使用特别的工具。

  XUL was designed for creating the user interface of the Mozilla application including the web browser, mail client and page editor. XUL may be used to create these types of applications. However, it may also be used any place you would use currently use a web application, for instance, when you need to be able to retrieve resources from the network and require a richer user interface. Like HTML, in XUL you can create an interface using a markup language, use CSS style sheets to define appearance and use JavaScript for behavior. You also have access to programming interfaces for reading and writing to remote content over the network and for calling web services. Unlike HTML however, XUL provides a rich set of user interface widgets for creating menus, toolbars, tabbed panels, and hierarchical trees to give a few examples.

  XUL被设计用来创建Mozila应用程序的用户界面,包括网页浏览器,邮件客户端和页面编辑器。XUL可以被用来创建这几种应用程序。但是,它同样可以被用来开发网页应用程序,比如,当你需要能够获得网络资源时,并且需要提供更加丰富的用户界面。就像HTML,用XUL你可以使用语言创建一个界面,使用CSS层叠样式表来定义表现层,并且使用JavaScript来定义行为。你同样具有界面编程的访问权力通过网络来读、写远端的内容,还用来申请网页服务。但不同于HTML,XUL提供丰富的用户界面部件集,比如用来创建菜单,工具栏,tab面板,和树型结构。

  This means you don't have to look for third party code or include a large block of JavaScript in your application just to handle a popup menu. XUL has all of these elements built-in. In addition, the elements are designed to look and feel just like those on the user's native platform, even supporting OS level themes in Windows XP and MacOS X. Or, if you prefer, you can use standard CSS to create your own look. The XUL widgets also support localization and have support for accessibility using OS level accessiblity interfaces.

  这意味着你不用搜索第3方代码或在你的应用程序中包含大段儿的JavaScript来处理一个弹出式菜单。XUL内置了所有的这些组件。而且,这些组件被设计成外观和感受就像用户本地平台上的组件一模一样,甚至支持Windows XP和MacOS X操作系统级的样式。或者如果你愿意,你可以使用标准的CSS来创建你自己的外观。XUL组件同样支持本地化,并且支持操作系统级的可访问界面。

  What is XUL?

  什么是XUL?

  XUL is an XML language and you can use numerous existing standards including XSLT, XPath and DOM functions to manipulate a user interface, all supported directly by Gecko. In fact, XUL is powerful enough that the entire user interface in the Mozilla application is implemented in XUL.

  XUL是XML语言,并且你可以使用大量的现存的标准,包括XSLT, XPath和DOM功能来操作用户界面,全部都由Gecko直接支持。事实上,XUL足够强大以致Mozilla应用程序的全部的用户界面都可以在XUL下执行。

  In addition to the many built-in user interface widgets available in XUL, you may create additional custom widgets using a related language called the Extensible Bindings Language (XBL). This language may be used to create custom tags and implement custom functionality.

  而且XUL体统了许多内置的用户界面组件,你可以使用相关联语言可扩展捆绑语言(XBL)来创建附加的自定义组件。这个语言可以用来创建自定义的tag和执行自定义的功能。

  XUL applications may be either opened directly from a remote Web site, or may be downloaded by the user and installed. Mozilla's XPInstall technology allows an application to be placed on a remote site and installed using only a couple of clicks of the mouse. No searching though the file system for an installer or stepping through a lengthy install process. The benefit of installing an application is lowered security restrictions so that applications may read and write files, and access user preferences and system information.

  XUL应用程序既可以直接由远端的网站开放,也可以由用户来下载安装。Mozilla的XPInstall技术允许位于远端站点的应用程序仅仅通过轻点几下鼠标就安装好了。不用搜索文件系统来获得安装程序,也不用经历漫长的安装过程。安装一个应用程序的好处是较低的安全限制,因此应用程序可以读、写文件,并且获得用户参数选择和系统信息。

  XUL may also be used to create stand alone applications that embed the Gecko engine or may be used as part of the browser. A feature in XUL called an overlay allows a third party to create extensions to the browser itself, for example to add a custom toolbar, change menus, or add other features. This feature is popular in Mozilla Firefox -- there are almost 100 extensions available. Mozilla's upcoming mail client Thunderbird also has a number of extensions available. In fact, any XUL application can support extensions.

  XUL同样可以用来创建独立的应用程序,嵌入在Gecko引擎中或用作浏览器的一部分。XUL的一个特性是覆盖(overlay)允许第3方创建针对浏览器自身的扩展,比如增添一个自定义工具栏,改变菜单,或添加其他的特性。这个特性在Mozilla FireFox中很流行——大概有100个扩展。Mozilla的即将面世的邮件客户端Thunderbird(现在我已经爱上Thunderbird1.0,不再使用OE)同样拥有大量的扩展。事实上,任何一款XUL应用程序都可以支持扩展。

  Gecko also supports various Web Services technologies such as XML-RPC, SOAP and WSDL. These technologies have been used recently to create an application to browse for products on amazon.com.

  Gecko同样可以支持大多数的网页服务技术,诸如XML-RPC, SOAP和WSDL。这些技术已经被用来为amazon网站创建针对浏览器的应用程序。

  Standards and other Technologies Supported

  标准的和其他技术的支持

  The following is a list of technologies supported by Gecko and can be used by XUL applications (not including XUL itself):

  下面列出了Gecko支持的技术并且可以被XUL使用的应用程序(不包括XUL自身):

  • HTML 4.0 and XHTML

  • CSS2 and some of CSS3

  • DOM2 and some of DOM3

  • XML

  • MathML

  • RDF

  • XSLT

  • XPath

  • Simple XLinks

  • XPointer

  • XML Base

  • FIXPtr

  • XML-RPC

  • SOAP (Simple Object Access Protocol)

  • WSDL (Web Services Description Language)

  • ECMAScript/Javascript

  • XBL (eXtensible Bindings Language)(可扩展的嵌入式语言)

  • GIF, JPG, PNG, BMP, ICO images

  • HTTP 1.1

  This list doesn't include all of the mail related features used by Mozilla Mail which you could also use in your own application to support POP3, IMAP and LDAP.

  这个清单没有包含所有被Mozilla Mail使用的相关联的邮件特性,你同样可以使用你自己的应用程序来支持POP3,IMAP和LDAP。

  XUL as an Application Platform

  XUL作为一个应用程序平台

  XUL and Gecko make an excellent choice for building sophisticated Web applications. It provides a rich user interface toolkit, an HTML and CSS renderer with excellent standards-compliance and support for web services, all completely cross platform.

  XUL和Gecko提供了一个用来构建精密复杂的网页应用程序的卓越选择。它提供一个丰富的用户界面工具箱,卓越的遵循标准的HTML和CSS表现层,并且支持网页服务,完全的跨平台。

  Work is ongoing with the Gecko Runtime Environment (GRE), which aims to make Gecko a snap to drop into a standalone application, complete with your own executable, if you desire. The idea is to allow the right version of the GRE to be installed automatically with the application if necessary. If the GRE is already installed, there is no need to install it again, or even download it. For those that are interested, the GRE is about 5 to 10 MB, depending on your platform, which is quite small compared to other application platforms. It's also possible to have Gecko run directly from a network drive or CD.

  工作在Gecko运行环境(GRE美国研究生入学考试^-^)上,为了使Gecko立刻毫无声息地成为独立的应用程序,完全和你自己的应用程序独立,如果你渴望的话。这个点子允许恰当版本的GRE和应用程序一起自动被安装,如果必要的话。如果GRE已经被安装了,那就没有必要再安装它了,甚至不必下载它。最令人感兴趣的,GRE大约5到10MB,取决于你的平台,比起其他的平台已经很小了。同样可以让Gecko通过网络驱动器或CD直接运行。

  Since XUL may be used on Web sites, it can be used with server-side architectures such as PHP and JSP to build dynamic content. This allows Gecko to be both a two-tier or a three-tier application model depending on your needs. There are projects in development now which aim to integrate Java, Python and other languages into Gecko directly.

  XUL可以用在网站上,它也可以用于服务器端架构,诸如PHP和JSP来构建动态内容。这允许Gecko充当双重的或三重的应用程序模式,取决于你的需求。现在已经有开发项目打算把Java, Python和其他的语言直接整合到Gecko里。

  Where to Start?

  从哪里开始?

  XulPlanet provides tutorials and references on XUL, XBL and other related technologies. There is also information from mozilla.org. For complex examples, you can try any of the various Mozilla Firefox extensions, projects on mozdev.org or even the XUL used by the Mozilla applications themselves. Just open the files with a JAR extension in Mozilla'a chrome directory using a ZIP utility and take a look at the files.

  XuPlanet提供教程和XUL有关信息,XBL和其他相关联的技术。还有来自mozilla.org的信息。比如,你可以尝试任何一款Mozilla FireFox的扩展,mozdev.org上的项目或被Mozilla应用程序自身使用的XUL。在Mozilla chrome目录下打开以JAR后缀名的文件,看看这些文件。

  To start learning XUL, begin the XUL tutorial.

  开始学习XUL,从XUL教程开始。

  Or, learn more about XUL and related technologies.

  或者,了解更多有关XUL和相关的技术。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14102/viewspace-116440/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2002-06-18

  • 博文量
    1715
  • 访问量
    1300035