SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatDetailsView
public class SwatDetailsView
extends SwatControl
| Field Summary | |
|---|---|
| object | 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 | Displays each field of this view. |
| protected array | Gets the array of CSS classes that are applied to this details view. |
| array | 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 | Gets the number of fields of this details-view. |
| array | Get the fields of this details-view. |
| SwatUIObject | getFirstDescendant(string class_name) Gets the first descendant UI-object of a specific class. |
| SwatHtmlHeadEntrySet | Gets the SwatHtmlHeadEntry objects needed by this details view. |
| protected string | 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 | |
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.
public SwatDetailsView(string id)
Creates a new details view
id - a non-visible unique id for this widget.public void addChild(SwatDetailsViewField child)
Adds a child object to this object
child - the child object to add to this object.public void appendField(SwatDetailViewField field)
Appends a field to this details view
The field is appended below existing fields.
field - the field to append.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()
Displays this details view
Displays details view as tabular XHTML.
private void displayContent()
Displays each field of this view
Displays each field of this view as an XHTML table row.
protected array getCSSClassNames()
Gets the array of CSS classes that are applied to this details view
public array getDescendantStates()
Gets descendant states
Retrieves an array of states of all stateful UI-objects in the widget subtree below this details view.
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 SwatDetailsViewField getField(string id)
Gets a field in this details view by the field's id
id - the id of the field in this details-view to get.public integer getFieldCount()
Gets the number of fields of this details-view
public array getFields()
Get the fields of this details-view
public SwatUIObject getFirstDescendant(string class_name)
Gets the first descendant UI-object of a specific class
class_name - class name to look for.public 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
public void init()
protected void insertField(SwatDetailsViewField field, SwatDetailsViewField reference_field, boolean after)
Helper method to insert fields into this details-view
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.public void insertFieldAfter(SwatDetailsViewField field, SwatDetailsViewField reference_field)
Inserts a field after an existing field in this details-view
field - the field to insert.reference_field - the field after which the field will be inserted.public void insertFieldBefore(SwatDetailsViewField field, SwatDetailsViewField reference_field)
Inserts a field before an existing field in this details-view
field - the field to insert.reference_field - the field before which the field will be inserted.public void process()
Processes this details-view
public void setDescendantStates(array states)
Sets descendant states
Sets states on all stateful UI-objects in the widget subtree below this details view.
states - an array of UI-object states with UI-object identifiers as array keys.protected void validateField(SwatDetailsViewField field)
Ensures a field added to this details-view is valid for this details-view
field - the field to check.
A widget to display field-value pairs