Zimlet JavaScript API Reference - DwtComposite

Class DwtComposite


Extends DwtControl.

A composite may contain other controls. All controls that need to contain child controls (such as menus, trees) should inherit from this class.

Defined in: DwtComposite.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
DwtComposite(params)
Method Summary
Method Attributes Method Name and Description
 
addChild(child, index)
Adds the given child control to this composite at the index (if specified).
 
collapses consecutive separators into one.
 
Clears the composite HTML element of content and removes all composite children by calling removeChildren.
 
Disposes of the control.
 
getChild(index)
Get the Nth child of this composite.
 
Get a list of children of this composite.
 
Gets the number of children of this composite.
 
Return this.tabGroupMember if present (it always overrides any other contender), otherwise if this composite has children return the composite tab group, otherwise just return this control (instead of a group with one member).
 
removeChild(child)
Removes the specified child control from this control.
 
Removes all of the composite children.
Methods borrowed from class DwtControl:
addClassName, addControlListener, addDisposeListener, addListener, appendElement, blur, clearContent, clearHandler, condClassName, delClassName, focus, 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, setData, setDisplay, setDisplayState, setDragBox, setDragSource, setDropTarget, setEnabled, setEventPropagation, setFocusElement, setHandler, setHtmlElementId, setLocation, setOpacity, setPosition, setScrollStyle, setSize, setToolTipContent, setVisibility, setVisible, setZIndex, showAlert, zShow
Class Detail
DwtComposite(params)
Parameters:
{hash} params
a hash of parameters
{DwtComposite} params.parent
the parent widget
{string} params.className
the CSS class
{constant} params.posStyle
the positioning style
{boolean} params.deferred
if true, postpone initialization until needed
{string} params.id
an explicit ID to use for the control's HTML element
{number} params.index
the index at which to add this control among parent's children
Method Detail
addChild(child, index)
Adds the given child control to this composite at the index (if specified).
Parameters:
{DwtControl} child
the child control to add
{number} index
the index at which to add the child (may be null)

cleanupSeparators()
collapses consecutive separators into one. Gets rid of head or tail separators as well . Note that is does not remove the separators, just hides them so they can re-displayed as needed, next time this is called and other elements become visible this would be used on such subclasses as DwtMenu and DwtToolbar . However, currently it does not work with the toolbars, since separators there are not added as children to the toolbar composite. I tried to make it consistent with the DwtMenu approach, but it seemed a bit complicated right now. so for now I try to make it so no complete groups (items between separators) are hidden at one time. It might also be possible to do it for the toolbar using the _items HTML elements array, but probably less elegant than this approach.

clear()
Clears the composite HTML element of content and removes all composite children by calling removeChildren.
See:
#removeChildren

dispose()
Disposes of the control. This method will remove the control from under the control of it's parent and release any resources associate with the component. The method will also notify any event listeners on registered DwtEvent.DISPOSE event type.

In the case of DwtComposite this method will also dispose of all of the composite's children.

Subclasses may override this method to perform their own dispose functionality but should generally call the parent dispose() method.

See:
DwtControl#isDisposed
DwtControl#addDisposeListener
DwtControl#removeDisposeListener

{DwtControl} getChild(index)
Get the Nth child of this composite.
Parameters:
{number} index
the index of the child.
Returns:
{DwtControl} the child.

{array} getChildren()
Get a list of children of this composite.
Returns:
{array} an array of DwtControl objects

{number} getNumChildren()
Gets the number of children of this composite.
Returns:
{number} the number of composite children

{DwtComposite|DwtTabGroup} getTabGroupMember()
Return this.tabGroupMember if present (it always overrides any other contender), otherwise if this composite has children return the composite tab group, otherwise just return this control (instead of a group with one member).
Returns:
{DwtComposite|DwtTabGroup}

removeChild(child)
Removes the specified child control from this control. A removed child is no longer retrievable via getHtmlElement(), so there is an option to save a reference to the removed child. That way it can be added later using addChild().
Parameters:
{DwtConrol} child
the child control to remove
See:
#addChild

removeChildren()
Removes all of the composite children.

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