... directory within
your chrome structure is good practice.
Consider the main Editor window in Mozilla. Its declaration in Example 11-
2 is flexible enough to associate multiple DTD files with your ...
</stringbundleset>
Chapter 11. Localization-P1
This chapter describes how to use Mozilla's internationalization (I18N) and
localization (L10N) technologies to make applica...
... line, creating a description element for each line
and populating it with a text node with the message inside. Then each
element is appended to the main container that lives in the XUL file.
11. 4.2.2. ... are contained in the binding for the element.
11. 3.2. String Bundle Methods and Properties
Defining your bundle in XUL and then creating the file with the values is
only ha...
... with the available language identifier. Selecting
one language and restarting Mozilla changes the interface for the user.
Example 11- 10
is a simple script for switching locales.
Example 11- 10. ...
units for your application.
11. 5.2. Interaction with the Chrome Registry
As pointed out in Chapter 6
, your packages directories need to be registered
as chrome with the chrome re...
... properties
associated with a XUL window and the other XUL elements, but you can
see all of them if you run the example. Analyzing output like this can
familiarize you with the interfaces available ... available from window and other DOM
objects.
5.2.3 .11. Retrieving elements by property
You can also use a DOM method to access elements with specific properties
by using getElement...
...
5.3. Adding Scripts to the UI
Once you are comfortable with how JavaScript works in the context of the
user interface layer and are familiar with some of the primary DOM methods
used to manipulate ... capturing is the complement of event bubbling. The DOM provides
the addEventListener method for creating event listeners on nodes that
do not otherwise supply them. When you register...
...
manipulated in this way.
5.3.4. Creating Elements Dynamically
Using the createElement method in XUL lets you accomplish things
similar to document.write in HTML, with which you can create new ... application.
The setAttribute method can also be used to update the element's
class attribute with which style rules are so often associated.
toolbarbutton-1 and button-toolbar are...
... fu.spawn('/usr/X11R6/bin/Eterm');
This command spawns a new Eterm with no argument. To open an Eterm
with vi, you could also use this code:
js> fu.spawn('/usr/X11R6/bin/Eterm', ... files. Using these interfaces can make life a lot easier by letting you
focus on creating your Mozilla application without having to implement
XPCOM nsIFile objects manually from yo...
... target within
the files, but the manifest that accompanies the overlay in your package tells
Mozilla which overlays are associated with which XUL files. The part of the
manifest that deals with ... created.
This chapter is divided into four main sections. It starts with a quick
overview of the basics of packaging and installing applications. The second
section provides details ab...
... the code more readable and reusable, as seen in the longer
install script in Example 6 -11
.
Example 6 -11. A more complicated install script
var vi = "10.10.10.10";
var xpiSrc = "adddir1"; ... When the InstallTrigger
object gets a JAR with a package manifest it can read and a package type
that doesn't break the security boundary for applications (i.e., a n...
... applications like xFly) can be used to download other
executables and software into any location on the local machine.
As with Mozilla application installs, you use an installation script within ... 6-6
.
Figure 6-6. Windows taskbar with Mozilla icon
6.5.1.2. Unix
X Windows uses the common X Pixmap (XPM) format for icons. XPM files
are C source code files, with each pixmap def...