Visit Mozilla.org

XUL:tabs

From MDC

« XUL Reference home    [ Examples | Attributes | Properties | Methods | Related ]

A row of tabs. A tabs element should be placed inside a tabbox and should contain tab elements.

More information is available in the XUL tutorial.

Attributes
closebutton, disableclose, disabled, onclosetab, onnewtab, onselect, setfocus, tabindex, tooltiptextnew, value,
Properties
accessibleType, disabled, itemCount, selectedIndex, selectedItem, tabIndex, value,
Methods
advanceSelectedTab, appendItem, getIndexOfItem, getItemAtIndex, insertItemAt, removeItemAt

[edit] Examples

(example needed)

[edit] Attributes

Inherited from XUL element
align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width

closebutton
Type: boolean
If this attribute is set to true, the tabs row will have a "new tab" button and "close" button on the ends. This feature is used by the tabbrowser to provide the facilities for adding and closing tabs. You can set an image to the "new tab" and "close" buttons by applying them to the tabs-newbutton and tabs-closebutton classes respectively.

disableclose
Type: boolean
If this attribute is true the close button will be disabled.

disabled
Type: boolean
Indicates whether the element is disabled or not. If this element is set to true the element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.

onclosetab
Type: script code
This script will be called when the close tab button is clicked.

onnewtab
Not in Firefox
Type: script code
This script will be called when the new tab button is clicked.

onselect
Type: script code
This event is sent to the tabs element when this tab is changed.

setfocus
Type: boolean
If true or omitted, the focus will be given to the first element in the corresponding tabpanel when the tabs are navigated via the keyboard. If this attribute is false, the focus does not change during navigation.

tabindex
Type: integer
The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence.

tooltiptextnew
Not in Firefox
Type: string
Used to set the text which appears in the tooltip when the user moves the mouse over the new button in the tab row.

[edit] Properties

Inherited from XUL element
align, allowEvents, boxObject, builder, className, collapsed, contextMenu, controllers, currentItem, database, datasources, dir, flex, height, hidden, id, left, listBoxObject, maxHeight, maxWidth, menu, minHeight, minWidth, observes, ordinal, orient, pack, persist, ref, resource, statusText, style, tooltip, tooltipText, top, value, width

Inherited from DOM element
attributes, childNodes, cloneNode, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, tagName

accessibleType
Type: integer
A value indicating the type of accessibility object for the element.

disabled
Type: boolean
Gets and sets the value of the disabled attribute.

itemCount New in Firefox 3
Type: integer
Read only property holding the number of child items.

selectedIndex
Type: integer
Returns the index of the currently selected item. You may select an item by assigning its index to this property. By assigning -1 to this property, all items will be deselected.

selectedItem
Type: element
Holds the currently selected item. If no item is currently selected, this value will be null. You can select an item by setting this value. A select event will be sent to the element when it is changed either via this property, the selectedIndex property, or changed by the user.

tabIndex
Type: integer
Gets and sets the value of the tabindex attribute.

value
Type: string
Gets and sets the value of the value attribute.

[edit] Methods

Inherited from XUL element
blur, click, doCommand, focus, getElementsByAttribute

Inherited from DOM element
addEventListener, appendChild, dispatchEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeEventListener, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS

advanceSelectedTab( dir, wrap )
Return type: no return value
If the argument dir is set to 1, the currently selected tab changes to the next tab. If the argument dir is set to -1, the currently selected tab changes to the previous tab. If the wrap argument is true, the adjustment will wrap around when the first or last tab is reached.

appendItem( label, value )
Return type: element
Creates a new item and adds it to the end of the existing list of items. You may optionally set a value. The function returns the newly created element.

getIndexOfItem( item )
Return type: integer
Returns the zero-based position of the specified item. Items are numbered starting at the first item displayed in the list.

getItemAtIndex( index )
Return type: element
Returns the element that is at the specified index.

insertItemAt( index, label, value )
Return type: element
This method creates a new item and inserts it at the specified position. You may optionally set a value. The new item element is returned.

removeItemAt( index )
Return type: element
Removes the child item in the element at the specified index. The method returns the removed item.

[edit] Related

Elements
tabbox, tab, tabpanels, tabpanel.
Interfaces
nsIAccessibleProvider, nsIDOMXULSelectControlElement