Zimlet JavaScript API Reference - DwtTabGroup

Class DwtTabGroup


A tab group is used to manage keyboard focus among a group of related visual elements. It is a tree structure consisting of elements and other tab groups.

The root tab group is the only one without a parent tab group, and is the one that the application interacts with. Focus listeners register with the root tab group. The root tab group tracks where focus is.

Defined in: DwtTabGroup.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
DwtTabGroup(name)
Creates an empty tab group.
Field Summary
Field Attributes Field Name and Description
<static>  
DwtTabGroup.NOT_ROOT_TABGROUP
Exception string that is thrown when an operation is attempted on a non-root tab group.
Method Summary
Method Attributes Method Name and Description
 
Adds a focus change listener to the root tab group.
 
addMember(member, index)
Adds a member to the tab group.
 
addMemberAfter(member, afterMember)
Adds a member to the tab group, positioned after another member.
 
addMemberBefore(member, beforeMember)
Adds a member to the tab group, positioned before another member.
 
contains(member)
Returns true if this tab group contains member.
 
dump(debugLevel)
Pretty-prints the contents of the tab group to the browser console or the debug window.
 
getFirstMember(checkEnabled)
Gets the first member of the tab group.
 
Returns the current focus member.
 
getLastMember(checkEnabled)
Gets the last member of the tab group.
 
Gets the name of this tab group.
 
getNextFocusMember(checkEnabled, skipNotify)
This method sets and returns the next focus member in this tab group.
 
getPrevFocusMember(checkEnabled, skipNotify)
This method sets and returns the previous focus member in this tab group.
 
newParent(newParent)
Sets a new parent for this tab group.
 
Removes all members.
 
Removes a focus change listener from the root tab group.
 
removeMember(member, checkEnabled, skipNotify)
This method removes a member from the tab group.
 
replaceMember(oldMember, newMember, checkEnabled, skipNotify, focusItem, noFocus)
This method replaces a member in the tab group with a new member.
 
resetFocusMember(checkEnabled, skipNotify)
Resets the the focus member to the first element in the tab group.
 
setFocusMember(member, checkEnabled, skipNotify)
Sets the current focus member.
 
setMembers(members)
Resets all members of the tab group to the given arguments.
 
size()
Gets the size of the group.
Class Detail
DwtTabGroup(name)
Creates an empty tab group.
Author: Ross Dargahi.
Parameters:
{string} name
the name of this tab group
Field Detail
<static> DwtTabGroup.NOT_ROOT_TABGROUP
Exception string that is thrown when an operation is attempted on a non-root tab group.
Method Detail
addFocusChangeListener(listener)
Adds a focus change listener to the root tab group. The listener is called when the focus member changes. Note that the focus member hasn't actually been focused yet - only its status within the tab group has changed. It is up to the listener to implement the appropriate focus action.
Parameters:
{AjxListener} listener
a listener
Throws:
DwtTabGroup.NOT_ROOT_TABGROUP

addMember(member, index)
Adds a member to the tab group.
Parameters:
{Array|DwtControl|DwtTabGroup|HTMLElement} member
the member(s) to be added
{number} index Optional
the index at which to add the member. If omitted, the member will be added to the end of the tab group

addMemberAfter(member, afterMember)
Adds a member to the tab group, positioned after another member.
Parameters:
{DwtControl|DwtTabGroup|HTMLElement} member
the member to be added
{DwtControl|DwtTabGroup|HTMLElement} afterMember
the member after which to add member

addMemberBefore(member, beforeMember)
Adds a member to the tab group, positioned before another member.
Parameters:
{DwtControl|DwtTabGroup|HTMLElement} member
the member to be added
{DwtControl|DwtTabGroup|HTMLElement} beforeMember
the member before which to add member

{boolean} contains(member)
Returns true if this tab group contains member.
Parameters:
{DwtControl|DwtTabGroup|HTMLElement} member
the member for which to search
Returns:
{boolean} true if the tab group contains member

dump(debugLevel)
Pretty-prints the contents of the tab group to the browser console or the debug window.
Parameters:
{number} debugLevel Optional
if specified, dump to the debug window at the given level.

{DwtControl|HTMLElement} getFirstMember(checkEnabled)
Gets the first member of the tab group.
Parameters:
{boolean} checkEnabled Optional
if true, then return first enabled member
Returns:
{DwtControl|HTMLElement} the first member of the tab group

{DwtControl|HTMLElement} getFocusMember()
Returns the current focus member.
Throws:
DwtTabGroup.NOT_ROOT_TABGROUP
Returns:
{DwtControl|HTMLElement} current focus member

{DwtControl|HTMLElement} getLastMember(checkEnabled)
Gets the last member of the tab group.
Parameters:
{boolean} checkEnabled Optional
if true, then return last enabled member
Returns:
{DwtControl|HTMLElement} the last member of the tab group

{string} getName()
Gets the name of this tab group.
Returns:
{string} the tab group name

{DwtControl|HTMLElement} getNextFocusMember(checkEnabled, skipNotify)
This method sets and returns the next focus member in this tab group. If there is no next member, sets and returns the first member in the tab group.
Parameters:
{boolean} checkEnabled Optional
if true, get the next enabled member
{boolean} skipNotify Optional
if true, notification is not fired. This flag typically set by Dwt tab management framework when it is calling into this method
Throws:
DwtTabGroup.NOT_ROOT_TABGROUP
Returns:
{DwtControl|HTMLElement} new focus member or null if there is no focus member or if the focus member has not changed (i.e. only one member in the tabgroup)

{DwtControl|HTMLElement} getPrevFocusMember(checkEnabled, skipNotify)
This method sets and returns the previous focus member in this tab group. If there is no previous member, sets and returns the last member in the tab group.
Parameters:
{boolean} checkEnabled Optional
if true, get the previously enabled member
{boolean} skipNotify Optional
if true, notification is not fired. This flag typically set by Dwt tab management framework when it is calling into this method
Throws:
DwtTabGroup.NOT_ROOT_TABGROUP
Returns:
{DwtControl|HTMLElement} new focus member or null if there is no focus member or if the focus member has not changed (i.e. only one member in the tabgroup)

newParent(newParent)
Sets a new parent for this tab group.
Parameters:
{DwtTabGroup} newParent
the new parent. If the parent is null, then this tabGroup is the root tab group.

removeAllMembers()
Removes all members.

removeFocusChangeListener(listener)
Removes a focus change listener from the root tab group.
Parameters:
{AjxListener} listener
a listener
Throws:
DwtTabGroup.NOT_ROOT_TABGROUP

{DwtControl|DwtTabGroup|HTMLElement} removeMember(member, checkEnabled, skipNotify)
This method removes a member from the tab group. If the member being removed is currently the focus member, then we will try to set focus to the previous member. If that fails, we will try the next member.
Parameters:
{DwtControl|DwtTabGroup|HTMLElement} member
the member to be removed
{boolean} checkEnabled Optional
if true, then make sure that if we have a newly focused member it is enabled
{boolean} skipNotify Optional
if true, notification is not fired. This flag typically set by Dwt tab management framework when it is calling into this method
Returns:
{DwtControl|DwtTabGroup|HTMLElement} the removed member or null if oldMember is not in the tab groups hierarchy

{DwtControl|DwtTabGroup|HTMLElement} replaceMember(oldMember, newMember, checkEnabled, skipNotify, focusItem, noFocus)
This method replaces a member in the tab group with a new member. If the member being replaced is currently the focus member, then we will try to set focus to the previous member. If that fails, we will try the next member.
Parameters:
{DwtControl|DwtTabGroup|HTMLElement} oldMember
the member to be replaced
{DwtControl|DwtTabGroup|HTMLElement} newMember
the replacing member If this parameter is null, then this method effectively removes oldMember
{boolean} checkEnabled Optional
if true, then make sure that if we have a newly focused member it is enabled
{boolean} skipNotify Optional
if true, notification is not fired. This flag is typically set by the tab management framework when it is calling into this method
focusItem
noFocus
Returns:
{DwtControl|DwtTabGroup|HTMLElement} replaced member or null> if oldMember is not in the tab group

{DwtControl|HTMLElement} resetFocusMember(checkEnabled, skipNotify)
Resets the the focus member to the first element in the tab group.
Parameters:
{boolean} checkEnabled Optional
if true, then pick a enabled member to which to set focus
{boolean} skipNotify Optional
if true, notification is not fired. This flag typically set by Dwt tab management framework when it is calling into this method
Throws:
DwtTabGroup.NOT_ROOT_TABGROUP
Returns:
{DwtControl|HTMLElement} the new focus member

{boolean} setFocusMember(member, checkEnabled, skipNotify)
Sets the current focus member.
Parameters:
{DwtControl|HTMLElement} member
the member to which to set focus
{boolean} checkEnabled Optional
if true, then make sure the member is enabled
{boolean} skipNotify Optional
if true, notification is not fired. This flag typically set by Dwt tab management framework when it is calling into this method
Throws:
DwtTabGroup.NOT_ROOT_TABGROUP
Returns:
{boolean} true if member was part of the tab group hierarchy, else false

setMembers(members)
Resets all members of the tab group to the given arguments.
Parameters:
{Array|DwtControl|DwtTabGroup|HTMLElement} members
the member(s) for the tab group

{number} size()
Gets the size of the group.
Returns:
{number} the size

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