silverorange Code


Swat.SwatMenu
/Swat/SwatMenu.php at line 20

Class SwatMenu

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatAbstractMenu
└─SwatMenu

public class SwatMenu
extends SwatAbstractMenu

A basic menu control

Copyright:
2007 silverorange
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
See Also:
SwatMenuItem

Field Summary
protected array

$items

The set of SwatMenuItem objects contained in this menu.

Fields inherited from Swat.SwatAbstractMenu
auto_sub_menu_display, click_to_hide
Method Summary
void

addChild(SwatMenuItem child)

Adds a child object.

void

addItem(SwatMenuItem item)

Adds a menu item to this menu.

SwatUIObject

copy(string id_suffix)

Performs a deep copy of the UI tree starting with this UI object.

void

display()

Displays this menu.

protected array

getCSSClassNames()

Gets the array of CSS classes that are applied to this menu.

array

getDescendantStates()

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.

protected string

getMenuItemCSSClassName()

Gets the CSS class name to use for menu items in this menu.

void

init()

Initializes this menu.

void

setDescendantStates(array states)

Sets descendant states.

Methods inherited from Swat.SwatAbstractMenu
getInlineJavaScript, getJavaScriptClass, setMenuItemValues
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

Field Detail

/Swat/SwatMenu.php at line 29

items

protected array $items = array()

The set of SwatMenuItem objects contained in this menu


Method Detail

/Swat/SwatMenu.php at line 62

addChild

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, use SwatMenu::addItem().

Parameters:
child - the child object to add.
Throws:
SwatInvalidClassException
See Also:
SwatUI, SwatMenu::addItem()

/Swat/SwatMenu.php at line 39

addItem

public void addItem(SwatMenuItem item)

Adds a menu item to this menu

Parameters:
item - the item to add.

/Swat/SwatMenu.php at line 269

copy

public SwatUIObject copy(string id_suffix)

Performs a deep copy of the UI tree starting with this UI object

Parameters:
id_suffix - optional. A suffix to append to copied UI objects in the UI tree.
Returns:
a deep copy of the UI tree starting with this UI object.
See Also:
SwatUIObject::copy()

/Swat/SwatMenu.php at line 91

display

public void display()

Displays this menu


/Swat/SwatMenu.php at line 303

getCSSClassNames

protected array getCSSClassNames()

Gets the array of CSS classes that are applied to this menu

Returns:
the array of CSS classes that are applied to this menu.
See Also:
SwatUIObject::getCSSClassString()

/Swat/SwatMenu.php at line 226

getDescendantStates

public array getDescendantStates()

Gets descendant states

Retrieves an array of states of all stateful UI-objects in the widget subtree below this menu.

Returns:
an array of UI-object states with UI-object identifiers as array keys.

/Swat/SwatMenu.php at line 155

getDescendants

public array getDescendants(string class_name)

Gets descendant UI-objects

Parameters:
class_name - optional class name. If set, only UI-objects that are instances of $class_name are returned.
Returns:
the descendant UI-objects of this menu. If descendant objects have identifiers, the identifier is used as the array key.
See Also:
SwatUIParent::getDescendants()

/Swat/SwatMenu.php at line 191

getFirstDescendant

public SwatUIObject getFirstDescendant(string class_name)

Gets the first descendant UI-object of a specific class

Parameters:
class_name - class name to look for.
Returns:
the first descendant UI-object or null if no matching descendant is found.
See Also:
SwatUIParent::getFirstDescendant()

/Swat/SwatMenu.php at line 290

getMenuItemCSSClassName

protected string getMenuItemCSSClassName()

Gets the CSS class name to use for menu items in this menu

Returns:
the CSS class name to use for menu items in this menu.

/Swat/SwatMenu.php at line 78

init

public void init()

Initializes this menu


/Swat/SwatMenu.php at line 248

setDescendantStates

public void setDescendantStates(array states)

Sets descendant states

Sets states on all stateful UI-objects in the widget subtree below this menu.

Parameters:
states - an array of UI-object states with UI-object identifiers as array keys.

silverorange Code