silverorange Code


Swat.SwatActionItem
/Swat/SwatActionItem.php at line 18

Class SwatActionItem

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatActionItem

public class SwatActionItem
extends SwatControl

A single entry in a SwatActions widget

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

Field Summary
string

$id

A unique identifier for this action item.

string

$title

A human readable title displayed for this item.

SwatWidget

$widget

A SwatWidget associated with this action item.

Method Summary
void

addChild(SwatWidget child)

Adds a child object.

SwatUIObject

copy(string id_suffix)

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

void

display()

Displays this item.

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.

SwatHtmlHeadEntrySet

getHtmlHeadEntrySet()

Gets the SwatHtmlHeadEntry objects needed by this action item.

void

init()

Initializes this action item.

void

setDescendantStates(array states)

Sets descendant states.

void

setWidget(SwatWidget widget)

Sets the widget to use for this item.

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/SwatActionItem.php at line 27

id

public string $id

A unique identifier for this action item


/Swat/SwatActionItem.php at line 34

title

public string $title = ''

A human readable title displayed for this item


/Swat/SwatActionItem.php at line 41

widget

public SwatWidget $widget = null

A SwatWidget associated with this action item


Method Detail

/Swat/SwatActionItem.php at line 119

addChild

public void addChild(SwatWidget 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 set the a widget in an action item, use SwatActionItem::setWidget().

Parameters:
child - a reference to a child object to add.
Throws:
SwatInvalidClassException
See Also:
SwatUIParent
SwatActionItem::setWidget()

/Swat/SwatActionItem.php at line 274

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/SwatActionItem.php at line 68

display

public void display()

Displays this item

Calls this item's widget display method.


/Swat/SwatActionItem.php at line 231

getDescendantStates

public array getDescendantStates()

Gets descendant states

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

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

/Swat/SwatActionItem.php at line 166

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 action item. If descendant objects have identifiers, the identifier is used as the array key.
See Also:
SwatUIParent::getDescendants()

/Swat/SwatActionItem.php at line 203

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 widget or null if no matching descendant is found.
See Also:
SwatUIParent::getFirstDescendant()

/Swat/SwatActionItem.php at line 140

getHtmlHeadEntrySet

public SwatHtmlHeadEntrySet getHtmlHeadEntrySet()

Gets the SwatHtmlHeadEntry objects needed by this action item

Returns:
the SwatHtmlHeadEntry objects needed by this action item.
See Also:
SwatWidget::getHtmlHeadEntrySet()

/Swat/SwatActionItem.php at line 52

init

public void init()

Initializes this action item

This initializes the widget contained in this action item if there is one.


/Swat/SwatActionItem.php at line 253

setDescendantStates

public void setDescendantStates(array states)

Sets descendant states

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

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

/Swat/SwatActionItem.php at line 91

setWidget

public void setWidget(SwatWidget widget)

Sets the widget to use for this item

Each SwatActionItem can have one associated SwatWidget. This method sets the widget for this item.

Parameters:
widget - the widget associated with this action.
Throws:
SwatException

silverorange Code