silverorange Code


Swat.SwatUIParent
/Swat/SwatUIParent.php at line 12

Interface SwatUIParent

SwatUIParent

public interface SwatUIParent

Interface for widgets that are parents for other widgets.

Copyright:
2005-2007 silverorange
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1

Method Summary
void

addChild(SwatObject child)

Adds a child object to this parent object.

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.

void

setDescendantStates(array states)

Sets descendant states.

Method Detail

/Swat/SwatUIParent.php at line 25

addChild

public void addChild(SwatObject child)

Adds a child object to this parent object

This method is used by SwatUI when building a widget tree and does not need to be called elsewhere. To add a field to a field view, use SwatFieldView::appendField().

Parameters:
child - the child object to add to this parent object.

/Swat/SwatUIParent.php at line 78

getDescendantStates

public array getDescendantStates()

Gets descendant states

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

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

/Swat/SwatUIParent.php at line 45

getDescendants

public array getDescendants(string class_name)

Gets descendant UI-objects

Retrieves an ordered array of all UI-objects in the widget subtree below this object. Widgets are ordered in the array as they are found in a breadth-first traversal of the subtree.

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 object. If descendant objects have identifiers, the identifier is used as the array key.

/Swat/SwatUIParent.php at line 64

getFirstDescendant

public SwatUIObject getFirstDescendant(string class_name)

Gets the first descendant UI-object of a specific class

Retrieves the first descendant UI-object in the subtree that is a descendant of the specified class name. This uses a depth-first traversal to search the tree.

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

/Swat/SwatUIParent.php at line 92

setDescendantStates

public void setDescendantStates(array states)

Sets descendant states

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

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

silverorange Code