silverorange Code


Swat.SwatView
/Swat/SwatView.php at line 19

Class SwatView

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatView

public abstract class SwatView
extends SwatControl

An abstract class from which to derive recordset views

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

Field Summary
array

$checked_items

The values of the checked checkboxes.

SwatTableModel

$model

A data structure that holds the data to display in this view.

protected array

$selections

The selections of this view.

protected array

$selectors

The selectors of this view.

Constructor Summary

SwatView(string id)

Creates a new recordset view.

Method Summary
protected final void

addSelector(mixed selector)

This method should be called internally by the {@link SwatView::init() method on all descendant UI-objects that are SwatViewSelector objects.

SwatViewSelection

getSelection(SwatViewSelector|string selector)

Gets a selection of this view.

void

init()

Initializes this view.

void

setSelection(SwatViewSelection selection, SwatViewSelector|string selector)

Sets a selection of this 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/SwatView.php at line 43

checked_items

public array $checked_items = array()

The values of the checked checkboxes

This array is set in the SwatTableView::process() method. For this to be set, this table-view must contain a SwatCellRendererCheckbox with an id of "checkbox".

Deprecated:
use {@link SwatView::getSelection()} instead.

/Swat/SwatView.php at line 30

model

public SwatTableModel $model = null

A data structure that holds the data to display in this view

The data structure used is some form of SwatTableModel.


/Swat/SwatView.php at line 56

selections

protected array $selections = array()

The selections of this view

This is an array of SwatViewSelection objects indexed by selector id.


/Swat/SwatView.php at line 66

selectors

protected array $selectors = array()

The selectors of this view

This is an array of SwatViewSelector objects indexed by selector id.


Constructor Detail

/Swat/SwatView.php at line 78

SwatView

public SwatView(string id)

Creates a new recordset view

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

Method Detail

/Swat/SwatView.php at line 234

addSelector

protected final void addSelector(mixed selector)

This method should be called internally by the {@link SwatView::init() method on all descendant UI-objects that are SwatViewSelector objects.


/Swat/SwatView.php at line 139

getSelection

public SwatViewSelection getSelection(SwatViewSelector|string selector)

Gets a selection of this view

Selections are an iterable, countable set of row identifiers for rows processed in this view that were selected (in some way) by the user.

Parameters:
selector - optional. The view selector object or the view selector identifier for which to get the selection. Use this parameter if this view has multiple selectors. By default, the first selector in the view is used.
Returns:
the selection of this view for the specified selector.
Throws:
if the $selector parameter is specified as a string and this view does not contain a selector with the given identifier.
if the $selector parameter is specified as an object that is not a {@link SwatViewSelector}.
if the $selector parameter is specified as a SwatViewSelector but the selector does not belong to this view.
if the $selector parameter is specified and this view has no selectors.

/Swat/SwatView.php at line 94

init

public void init()

Initializes this view


/Swat/SwatView.php at line 200

setSelection

public void setSelection(SwatViewSelection selection, SwatViewSelector|string selector)

Sets a selection of this view

Use by SwatViewSelector objects during the processing phase to set the selection of this view for a particular selector.

This method may also be used to override the selection provided by a selector.

Parameters:
selection - the selection object to set.
selector - optional. The view selector object or the view selector identifier for which to get the selection. Use this parameter if this view has multiple selectors. By default, the first selector in the view is used.
Throws:
if the $selector parameter is specified as a string and this view does not contain a selector with the given identifier.
if the $selector parameter is specified as an object that is not a {@link SwatViewSelector}.
if the $selector parameter is specified as a SwatViewSelector but the selector does not belong to this view.
if the $selector parameter is specified and this view has no selectors.

silverorange Code