SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatMenuGroup
public class SwatMenuGroup
extends SwatControl
| Field Summary | |
|---|---|
| protected array | The set of SwatMenuItem objects contained in this group. |
| string | The user-visible title of this group. |
| Method Summary | |
|---|---|
| void | addChild(SwatMenuItem child) Adds a child object. |
| void | addItem(SwatMenuItem item) Adds a menu item to this group. |
| SwatUIObject | copy(string id_suffix) Performs a deep copy of the UI tree starting with this UI object. |
| void | display(boolean first) Displays this menu group. |
| array | Gets descendant states. |
| array | getDescendants(string class_name) Gets descendant UI-objects. |
| SwatUIObject | getFirstDescendant(string class_name) Gets the first descendant UI-object of a specific class. |
| void | setDescendantStates(array states) Sets descendant states. |
| void | setMenuItemValues(string value) Sets the value of all SwatMenuItem objects within this menu group. |
| Methods inherited from Swat.SwatControl | |
|---|---|
| addMessage, getNote, printWidgetTree | |
| Methods inherited from Swat.SwatWidget | |
|---|---|
| addCompositeWidget, addMessage, confirmCompositeWidgets, copy, createCompositeWidgets, display, displayHtmlHeadEntries, getCSSClassNames, getCompositeWidget, getCompositeWidgets, getFocusableHtmlId, getHtmlHeadEntrySet, getMessages, hasMessage, init, isDisplayed, isInitialized, isProcessed, isSensitive, printWidgetTree, process, replaceWithContainer | |
| Methods inherited from Swat.SwatUIObject | |
|---|---|
| addComment, addJavaScript, addStyleSheet, addTangoAttribution, copy, getCSSClassNames, getCSSClassString, getFirstAncestor, getHtmlHeadEntrySet, getInlineJavaScript, getUniqueId, isVisible | |
protected array $items = array()
The set of SwatMenuItem objects contained in this group
public string $title
The user-visible title of this group
public void addChild(SwatMenuItem child)
Adds a child object
This method fulfills the SwatUIParent interface. It is used
by SwatUI when building a widget tree and should not need to be
called elsewhere. To add a menu item to a menu group, use
SwatMenuGroup::addItem().
child - the child object to add.public void addItem(SwatMenuItem item)
Adds a menu item to this group
item - the item to add.public SwatUIObject copy(string id_suffix)
Performs a deep copy of the UI tree starting with this UI object
id_suffix - optional. A suffix to append to copied UI objects in the UI tree.public void display(boolean first)
Displays this menu group
first - optional. Whether or not this group is the first group in a {@link SwatGroupedMenu}. Defaults to false.public array getDescendantStates()
Gets descendant states
Retrieves an array of states of all stateful UI-objects in the widget subtree below this menu group.
public array getDescendants(string class_name)
Gets descendant UI-objects
class_name - optional class name. If set, only UI-objects that are instances of $class_name are returned.public SwatUIObject getFirstDescendant(string class_name)
Gets the first descendant UI-object of a specific class
class_name - class name to look for.public void setDescendantStates(array states)
Sets descendant states
Sets states on all stateful UI-objects in the widget subtree below this menu group.
states - an array of UI-object states with UI-object identifiers as array keys.public void setMenuItemValues(string value)
Sets the value of all SwatMenuItem objects within this menu
group
This is usually easier than setting all the values manually if the values are dynamic.
A group of menu items
SwatMenuGroup objects are added to
SwatGroupedMenuobjects and are used to group together a set ofSwatMenuItemobjects.