silverorange Code


Swat.SwatDetailsView
/Swat/SwatDetailsView.php at line 20

Class SwatDetailsView

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatDetailsView

public class SwatDetailsView
extends SwatControl

A widget to display field-value pairs

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

Field Summary
object

$data

An object containing values to display.

Constructor Summary

SwatDetailsView(string id)

Creates a new details view.

Method Summary
void

addChild(SwatDetailsViewField child)

Adds a child object to this object.

void

appendField(SwatDetailViewField field)

Appends a field to this details view.

SwatUIObject

copy(string id_suffix)

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

void

display()

Displays this details view.

private void

displayContent()

Displays each field of this view.

protected array

getCSSClassNames()

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

array

getDescendantStates()

Gets descendant states.

array

getDescendants(string class_name)

Gets descendant UI-objects.

SwatDetailsViewField

getField(string id)

Gets a field in this details view by the field's id.

integer

getFieldCount()

Gets the number of fields of this details-view.

array

getFields()

Get the fields of this details-view.

SwatUIObject

getFirstDescendant(string class_name)

Gets the first descendant UI-object of a specific class.

SwatHtmlHeadEntrySet

getHtmlHeadEntrySet()

Gets the SwatHtmlHeadEntry objects needed by this details view.

protected string

getInlineJavaScript()

Gets the inline JavaScript needed by this details view as well as any inline JavaScript needed by fields.

void

init()

Initializes this details-view.

protected void

insertField(SwatDetailsViewField field, SwatDetailsViewField reference_field, boolean after)

Helper method to insert fields into this details-view.

void

insertFieldAfter(SwatDetailsViewField field, SwatDetailsViewField reference_field)

Inserts a field after an existing field in this details-view.

void

insertFieldBefore(SwatDetailsViewField field, SwatDetailsViewField reference_field)

Inserts a field before an existing field in this details-view.

void

process()

Processes this details-view.

void

setDescendantStates(array states)

Sets descendant states.

protected void

validateField(SwatDetailsViewField field)

Ensures a field added to this details-view is valid for this details-view.

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/SwatDetailsView.php at line 36

data

public object $data = null

An object containing values to display

A data object contains properties and values. The SwatDetailsViewField objects inside this SwatDetailsView contain mappings between their properties and the properties of this data object. This allows the to display specific values from this data object.

See Also:
SwatDetailsViewField

Constructor Detail

/Swat/SwatDetailsView.php at line 70

SwatDetailsView

public SwatDetailsView(string id)

Creates a new details view

Parameters:
id - a non-visible unique id for this widget.
See Also:
SwatWidget::__construct()

Method Detail

/Swat/SwatDetailsView.php at line 258

addChild

public void addChild(SwatDetailsViewField child)

Adds a child object to this object

Parameters:
child - the child object to add to this object.
Throws:
SwatInvalidClassException
See Also:
SwatUIParent::addChild()

/Swat/SwatDetailsView.php at line 149

appendField

public void appendField(SwatDetailViewField field)

Appends a field to this details view

The field is appended below existing fields.

Parameters:
field - the field to append.
Throws:
if the field has the same id as a field already in this details-view.

/Swat/SwatDetailsView.php at line 423

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/SwatDetailsView.php at line 118

display

public void display()

Displays this details view

Displays details view as tabular XHTML.


/Swat/SwatDetailsView.php at line 593

displayContent

private void displayContent()

Displays each field of this view

Displays each field of this view as an XHTML table row.


/Swat/SwatDetailsView.php at line 550

getCSSClassNames

protected array getCSSClassNames()

Gets the array of CSS classes that are applied to this details view

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

/Swat/SwatDetailsView.php at line 380

getDescendantStates

public array getDescendantStates()

Gets descendant states

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

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

/Swat/SwatDetailsView.php at line 309

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

/Swat/SwatDetailsView.php at line 236

getField

public SwatDetailsViewField getField(string id)

Gets a field in this details view by the field's id

Parameters:
id - the id of the field in this details-view to get.
Returns:
the field in this details-view with the specified id.
Throws:
if no field with the given id exists in this details view.

/Swat/SwatDetailsView.php at line 204

getFieldCount

public integer getFieldCount()

Gets the number of fields of this details-view

Returns:
the number of fields in this details-view.

/Swat/SwatDetailsView.php at line 217

getFields

public array getFields()

Get the fields of this details-view

Returns:
the fields of this details-view.

/Swat/SwatDetailsView.php at line 345

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/SwatDetailsView.php at line 283

getHtmlHeadEntrySet

public SwatHtmlHeadEntrySet getHtmlHeadEntrySet()

Gets the SwatHtmlHeadEntry objects needed by this details view

Returns:
the SwatHtmlHeadEntry objects needed by this details view.
See Also:
SwatUIObject::getHtmlHeadEntrySet()

/Swat/SwatDetailsView.php at line 566

getInlineJavaScript

protected string getInlineJavaScript()

Gets the inline JavaScript needed by this details view as well as any inline JavaScript needed by fields

Returns:
inline JavaScript needed by this details view.

/Swat/SwatDetailsView.php at line 88

init

public void init()

Initializes this details-view

This initializes all fields.

See Also:
SwatWidget::init()

/Swat/SwatDetailsView.php at line 502

insertField

protected void insertField(SwatDetailsViewField field, SwatDetailsViewField reference_field, boolean after)

Helper method to insert fields into this details-view

Parameters:
field - the field to insert.
reference_field - optional. An existing field within this details-view to which the inserted field is relatively positioned. If not specified, the field is inserted at the beginning or the end of this details-view's list of fields.
after - optional. If true and a reference field is specified, the field is inserted immediately before the reference field. If true and no reference field is specified, the field is inserted at the beginning of the field list. If false and a reference field is specified, the field is inserted immediately after the reference field. If false and no reference field is specified, the field is inserted at the end of the field list. Defaults to false.
Throws:
if the reference field does not exist in this details-view.
if the field to be inserted has the same id as a field already in this details-view.
See Also:
SwatDetailsView::appendField()
SwatDetailsView::insertFieldBefore()
SwatDetailsView::insertFieldAfter()

/Swat/SwatDetailsView.php at line 190

insertFieldAfter

public void insertFieldAfter(SwatDetailsViewField field, SwatDetailsViewField reference_field)

Inserts a field after an existing field in this details-view

Parameters:
field - the field to insert.
reference_field - the field after which the field will be inserted.
Throws:
if the reference field does not exist in this details-view.
if the field has the same id as a field already in this details-view.

/Swat/SwatDetailsView.php at line 169

insertFieldBefore

public void insertFieldBefore(SwatDetailsViewField field, SwatDetailsViewField reference_field)

Inserts a field before an existing field in this details-view

Parameters:
field - the field to insert.
reference_field - the field before which the field will be inserted.
Throws:
if the reference field does not exist in this details-view.
if the field has the same id as a field already in this details-view.

/Swat/SwatDetailsView.php at line 102

process

public void process()

Processes this details-view


/Swat/SwatDetailsView.php at line 402

setDescendantStates

public void setDescendantStates(array states)

Sets descendant states

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

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

/Swat/SwatDetailsView.php at line 452

validateField

protected void validateField(SwatDetailsViewField field)

Ensures a field added to this details-view is valid for this details-view

Parameters:
field - the field to check.
Throws:
if the field has the same id as a field already in this details-view.

silverorange Code