Zimlet JavaScript API Reference - ZmToolBar

Class ZmToolBar


Extends DwtToolBar.

This class represents a basic toolbar which can add buttons, manage listeners, and enable/disabled its buttons.

Defined in: ZmToolBar.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmToolBar(params)
Creates a toolbar.
Method Summary
Method Attributes Method Name and Description
<static>  
ZmToolBar.addButton(params)
Adds a button to the element with the given ID.
 
addSelectionListener(buttonId, listener)
Adds a selection listener.
 
createButton(id, params)
Creates a button and adds the button to this toolbar.
 
enable(ids, enabled)
Enables or disables the specified buttons.
 
enableAll(enabled)
Enables or disables all buttons.
 
getButton(buttonId)
Gets the button.
 
removeSelectionListener(buttonId, listener)
Removes a selection listener.
 
setData(buttonId, key, data)
Sets the data.
 
setItemVisible(buttonId, visible)
sets an item visibility.
 
setSize(width, height)
Sets the size.
Methods borrowed from class DwtToolBar:
addChild, addFiller, addSeparator, addSpacer, focus, getItem, getItemCount, getItems, getKeyMapName
Methods borrowed from class DwtComposite:
cleanupSeparators, clear, dispose, getChild, getChildren, getNumChildren, getTabGroupMember, removeChild, removeChildren
Methods borrowed from class DwtControl:
addClassName, addControlListener, addDisposeListener, addListener, appendElement, blur, clearContent, clearHandler, condClassName, delClassName, getBounds, getClassName, getContent, getCursor, getData, getDragBox, getDragSource, getDropTarget, getEnabled, getFocusElement, getH, getHtmlElement, getHTMLElId, getInsetBounds, getInsets, getLocation, getMargins, getOpacity, getOuterSize, getPosition, getScrollContainer, getScrollStyle, getSize, getTooltipBase, getToolTipContent, getVisibility, getVisible, getW, getX, getXW, getY, getYH, getZIndex, hasFocus, isAlertShown, isDisposed, isInitialized, isListenerRegistered, notifyListeners, preventContextMenu, preventSelection, removeAllListeners, removeControlListener, removeDisposeListener, removeListener, reparent, reparentHtmlElement, replaceElement, setBounds, setClassName, setContent, setCursor, setDisplay, setDisplayState, setDragBox, setDragSource, setDropTarget, setEnabled, setEventPropagation, setFocusElement, setHandler, setHtmlElementId, setLocation, setOpacity, setPosition, setScrollStyle, setToolTipContent, setVisibility, setVisible, setZIndex, showAlert, zShow
Class Detail
ZmToolBar(params)
Creates a toolbar.
Author: Conrad Damon.
Parameters:
{Hash} params
a hash of parameters
{DwtComposite} params.parent
the containing widget
{String} params.className
the CSS class
{constant} params.posStyle
the positioning style
{String} params.id
an explicit ID to use for the control's HTML element
{ZmController} params.controller
the owning controller
{String} params.refElementId
the id of element that contains toolbar
Method Detail
<static> ZmToolBar.addButton(params)
Adds a button to the element with the given ID. Designed to handle non-ZmToolBar toolbars.
Parameters:
params
[hash] hash of params: parent [DwtControl] parent control setting [const] setting that must be true for this button to be added tdId [string] ID of TD that is to contain this button buttonId [string]* ID of the button style [const]* button style type [string]* used to differentiate between regular and toolbar buttons lbl [string]* button text icon [string]* button icon tooltip [string]* button tooltip

addSelectionListener(buttonId, listener)
Adds a selection listener.
Parameters:
{String} buttonId
the button id
{AjxListener} listener
the listener

createButton(id, params)
Creates a button and adds the button to this toolbar.
Parameters:
{String} id
the button id
{Hash} params
a hash of parameters:
{function} params.constructor
the constructor for button object (default is DwtToolBarButton)
{String} params.template
the button template
{String} params.text
the button text
{String} params.tooltip
the button tooltip text
{String} params.image
the icon class for the button
{String} params.disImage
the disabled version of icon
{Boolean} params.enabled
if true, button is enabled
{String} params.className
the CSS class name
{String} params.style
the button style
{int} params.index
the position at which to add the button
{constant} params.shortcut
the shortcut id (from ZmKeyMap) for showing hint
{AjxCallback|DwtMenu} params.menu
the menu creation callback (recommended) or menu
{Boolean} params.menuAbove
if true, popup menu above the button.
{Object} params.whatToShow
if exists, determines what to show as follows: (for usage, see ZmToolBar.prototype._createButton and DwtButton.prototype.setImage and DwtButton.prototype.setText
{Boolean} params.whatToShow.showImage
if true, display image
{Boolean} params.whatToShow.showText
if true, display text

enable(ids, enabled)
Enables or disables the specified buttons.
Parameters:
{Array} ids
a list of button ids
{Boolean} enabled
if true, enable the buttons

enableAll(enabled)
Enables or disables all buttons.
Parameters:
{Boolean} enabled
if true, enable the buttons

{ZmAppButton} getButton(buttonId)
Gets the button.
Parameters:
{String} buttonId
the button id
Returns:
{ZmAppButton} the button

removeSelectionListener(buttonId, listener)
Removes a selection listener.
Parameters:
{String} buttonId
the button id
{AjxListener} listener
the listener

setData(buttonId, key, data)
Sets the data.
Parameters:
{String} buttonId
the button id
{String} key
the data key
{Object} data
the data

setItemVisible(buttonId, visible)
sets an item visibility. finds the button by id.
Parameters:
{String} buttonId
the button id
{Boolean} visible

setSize(width, height)
Sets the size. This method is called by the application view manager fitToContainer(), which happens during initial layout as well as in response to the user changing the browser size.
Parameters:
{int} width
the width (in pixels)
{int} height
the height (in pixels)

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:42 GMT-0400 (EDT)