A container which typically contains a row of buttons. It is a type of box that defaults to horizontal orientation. It can be collapsed with a grippy
when the toolbar
is placed inside a toolbox
. The toolbar should always have an id
attribute.
Note: Gecko 2.0 adds support for external toolbars. These are toolbars that are not children of a toolbox
element. You can associate an external toolbar with a toolbox for the purpose of managing your toolbars by setting the toolboxid
property on the toolbar.
The chromeclass-toolbar
class may be used to create a toolbar where its visibility depends on the toolbar
flag when opening the window with the window
interface's open() method loads the specified resource into the browsing context (window, <iframe>
or tab) with the specified name. If the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open()
method.
More information is available in the XUL tutorial.
Note: Starting in Gecko 1.9.1, toolbar items are moved from the toolbarpalette
and added to the toolbar when a toolbar is first displayed. In earlier versions, a copy of each item was created and placed on the toolbar. This means that the palette now only contains items not already in the toolbar. This introduces a potential compatibility problem for extensions that depend on being able to identify all possible toolbar items by looking in the toolbarpalette
.
<toolbox> <toolbar id="nav-toolbar"> <toolbarbutton id="nav-users" accesskey="U" label="Users"/> <toolbarbutton id="nav-groups" accesskey="p" label="Groups"/> <toolbarbutton id="nav-events" accesskey="E" label="Events" disabled="true"/> </toolbar> </toolbox>
autohide
true
, the toolbar will be invisible unless the Alt key is pressed by the user. When set to false
, the default, the toolbar is visible. This only has an effect on Windows and needs to be combined with type="menubar"
and a menubar
element.currentset
toolbar
. This will be modified when the user customizes the toolbar. The value of this attribute should be a comma-separated list of item IDs from the toolbarpalette
or, additionally, any of the following strings: "separator
", "spring
", "spacer
".customindex
toolbar
in the list of the custom toolbars. The value is updated automatically by the toolbar customization dialog.customizable
true
on toolbar
s that can be customized. This causes the set of buttons to be persisted across sessions.defaultset
toolbar
. This should be set to a comma-separated list of item IDs from the toolbarpalette
. For example, back-button,forward-button,print-button
.grippytooltiptext
toolbar
's grippy
when the toolbar is collapsed. This would be used to label the grippy so that the user knows which toolbar it represents.height
iconsize
toolbox
, whose iconsize
attribute defines the default for all toolbars that don't specify an icon size.mode
toolbarbutton
s on the toolbar
are displayed.icons
text
full
toolbarname
toolbar
, which is listed on the Show/Hide toolbars menu.
accessibleType
currentSet
spacer
", "separator
", "spring
". An empty toolbar has a currentSet
value of "__empty"
.currentset
attribute.firstPermanentChild
toolbar
. A permanent child is one that is not customizable and remains on the toolbar. Items that are placed directly inside the toolbar without being in the toolbarpalette
are permanent.lastPermanentChild
toolbarpalette
are permanent.toolbarName
toolboxid
toolbox
this toolbar
is a member of. This will either be the toolbox's parent (if it's in a toolbox
), or, if the toolbar is an external toolbar (that is, one not contained in a toolbox), the ID of the toolbox it should be considered to be part of. This makes it possible to have toolbars that are not contained within toolboxes, such as the add-on bar.
insertItem( id, beforeNode, wrapper, beforePermanent )
toolbar
. The new item is added just before the item given by the second argument. If the second argument is null
, but the beforePermanent argument is true
, the item is added to the beginning of the toolbar before the first permanent item. Otherwise, if the beforePermanent argument is false
, the new item is added to the end of the toolbar. The third argument can be used to wrap the new item in another element. Usually, the last argument will be null
as it is mainly for the use of the customize dialog.The id should match an element in the toolbar's toolbarpalette
. Some special ids may also be used to create special spacing items:
separator
: A separator, which is drawn as a vertical bar.spacer
: A non-flexible space.spring
: A flexible space.The method returns the DOM element for the created item.
chromeclass-toolbar
toolbar
option to no in the window.open method. Otherwise, this option will be ignored for this toolbar and it will always be visible.
toolbarbutton
, toolbargrippy
, toolbaritem
, toolbarpalette
, toolbarseparator
, toolbarset
, toolbarspacer
, toolbarspring
, toolbox
nsIAccessibleProvider