IlvToolBar

IlvObject
  |
  +--IlvEmptyView
       |
       +--IlvToolBar
Category:
Common component
JavaScript File:
IlvToolBar.js
Description:
IlvToolBar is a DHTML toolbar. Instances of IlvButton can be added, or sorted in this toolbar. Once the buttons are arranged in the appropriate way, you can create an HTML representation of the toolbar using the toHTML method. This class also offers special support for computing the width and height of the toolbar and the associated notification mechanism.

Constructor Summary
IlvToolBar(left, top)

Method Summary
addButton(button, index)
Adds a button to the toolbar at the specified index.
childrenToHTML()
Creates the HTML for this toolbar's children.
computeHeight()
Computes and returns the height of this toolbar in pixels.
computeWidth()
Computes and returns the width of this toolbar in pixels.
getBackgroundColor()
Returns the background color of the toolbar.
getBackgroundImage()
Returns the background image of the toolbar.
getBorderColor()
Returns the color of the toolbar border.
getBorderThickness()
Returns the border thickness in pixels.
getButtonSpacing()
Returns the button spacing in pixels.
getButtons()
Returns an array containing the buttons in this toolbar.
getIndex(button)
Returns the index of an IlvButton in the toolbar, or -1 if the button is not in the toolbar.
getOrientation()
Returns the orientation of this toolbar.
setBackgroundColor(color)
Sets the background color of the toolbar.
setBackgroundImage(image)
Sets the background image of the toolbar.
setBorderColor(color)
Sets the color of the toolbar border.
setBorderThickness(pixels)
Sets the border thickness in pixels.
setBounds(left, top, width, height)
Changes the size of the toolbar.
setButtonSpacing(pixels)
Sets the button spacing in pixels.
setChildrenBounds(left, top, width, height)
Changes the size of the toolbar's children.
setOrientation(string)
Sets the orientation of this toolbar.

Constructor Detail

IlvToolBar

IlvToolBar(left, top)
Creates an instance of IlvToolBar.

Method Detail

addButton

addButton(button, index)
Adds a button to the toolbar at the specified index. If no index is specified, the button is added at the end of the toolbar.
Parameters:
button - An IlvButton to be added to the toolbar.
index - The position at which the button should be added to the toolbar. This parameter is optional.

childrenToHTML

childrenToHTML()
Creates the HTML for this toolbar's children. Warning: This method is considered to be part of an IlvToolBar's internal implementation and is not a public API.

computeHeight

computeHeight()
Computes and returns the height of this toolbar in pixels.

computeWidth

computeWidth()
Computes and returns the width of this toolbar in pixels.

getBackgroundColor

getBackgroundColor()
Returns the background color of the toolbar. The default value is "#CCCCCC".

getBackgroundImage

getBackgroundImage()
Returns the background image of the toolbar. By default a toolbar has no background image and therefore the background color is visible.

getBorderColor

getBorderColor()
Returns the color of the toolbar border. By default, the color of the border is the same as the background color of the toolbar.
Returns:
A string describing the color or null if the color of the border is the same as the color of the toolbar.

getBorderThickness

getBorderThickness()
Returns the border thickness in pixels.

getButtonSpacing

getButtonSpacing()
Returns the button spacing in pixels.

getButtons

getButtons()
Returns an array containing the buttons in this toolbar. Note: You are not allowed to modify this array or its contents. Use addButton to modify the toolbar.

getIndex

getIndex(button)
Returns the index of an IlvButton in the toolbar, or -1 if the button is not in the toolbar.
Parameters:
button - The IlvButton whose index should be returned.

getOrientation

getOrientation()
Returns the orientation of this toolbar.

setBackgroundColor

setBackgroundColor(color)
Sets the background color of the toolbar. The default value is "#CCCCCC".
Parameters:
color - A string describing the color. For example, "#FFFFFF" corresponds to white.

setBackgroundImage

setBackgroundImage(image)
Sets the background image of the toolbar. The image is tiled across the background of the toolbar. By default, a toolbar has no background image and therefore the background color is visible.
Parameters:
image - The URL of an image.

setBorderColor

setBorderColor(color)
Sets the color of the toolbar border. By default, the color of the border is the same as the background color of the toolbar.
Parameters:
color - A string describing the color or null to set the color of the border to be the same as the color of the toolbar.

setBorderThickness

setBorderThickness(pixels)
Sets the border thickness in pixels. The default value is 4.

setBounds

setBounds(left, top, width, height)
Changes the size of the toolbar. This method is overridden because toolbars automatically calculate their width and height from the buttons they contain.
Parameters:
left - The absolute x position of the toolbar on the page.
top - The absolute y position of the toolbar on the page.
width - The width of the toolbar. This argument is ignored.
height - The height of the toolbar. This argument is ignored.

setButtonSpacing

setButtonSpacing(pixels)
Sets the button spacing in pixels. The default value is 0.

setChildrenBounds

setChildrenBounds(left, top, width, height)
Changes the size of the toolbar's children. Warning: This method is considered to be part of an IlvToolBar's internal implementation and is not a public API.
Parameters:
left - The absolute x position of the toolbar on the page.
top - The absolute y position of the toolbar on the page.
width - The width of the toolbar.
height - The height of the toolbar.

setOrientation

setOrientation(string)
Sets the orientation of this toolbar. The value can be IlvToolBar.VERTICAL or IlvToolBar.HORIZONTAL. The default value is IlvToolBar.HORIZONTAL.

Inherited Methods from IlvEmptyView
addSizeListener, childrenToHTML, getBounds, getHeight, getLeft, getLocation, getSize, getTop, getWidth, isStateInCookie, removeSizeListener, restoreState, saveState, setBounds, setChildrenBounds, setLocation, setSize, setStateInCookie, toHTML
Inherited Methods from IlvObject
callDispose, dispose, getClassName, hashCode, inherits, instanceOf, invoke, registerDispose, removeHTML, setClassName, superConstructor, superInvoke, toString, updateVisibility