silverorange Code


Swat.SwatTileView
/Swat/SwatTileView.php at line 23

Class SwatTileView

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

public class SwatTileView
extends SwatView

A tile view widget for containing a SwatTile tile

Records in this tile-view's model may be selected by the user by adding a view-selector to this tile-view. See SwatView for details on how to use SwatViewSelector objects.

Copyright:
2007 silverorange
Lisence:
http://www.gnu.org/copyleft/lesser.html LGPL Lisence 2.1
See Also:
SwatTile
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1

Field Summary
string

$check_all_content_type

Optional content type for check-all widget title.

integer

$check_all_extended_count

Count for displaying an extended-all checkbox.

string

$check_all_title

Optional label title for the check-all widget.

mixed

$check_all_unit

Optional extended-all checkbox unit.

integer

$check_all_visible_count

Count for all visible items when displaying an extended-all checkbox.

protected array

$groups

Grouping objects for this tile-view.

protected array

$groups_by_id

The groups of this tile-view indexed by their unique identifier.

boolean

$show_check_all

Whether to show a "check all" widget.

Fields inherited from Swat.SwatView
checked_items, model, selections, selectors
Constructor Summary

SwatTileView(string id)

Creates a new tile view.

Method Summary
void

addChild(SwatTile|SwatTileViewGroup child)

Adds a child object.

void

appendGroup(SwatTileViewGroup group)

Appends a grouping object to this tile-view.

SwatUIObject

copy(string id_suffix)

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

protected void

createCompositeWidgets()

Creates the composite check-all widget used by this tile view.

void

display()

Displays this tile view.

protected array

getCSSClassNames()

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

protected SwatCheckboxCellRenderer

getCheckboxCellRenderer()

Gets the first checkbox cell renderer in this tile view's tile.

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.

SwatTileViewGroup

getGroup(string id)

Gets a group in this tile-view by the group's id.

array

getGroups()

Gets all groups of this tile-view as an array.

SwatHtmlHeadEntrySet

getHtmlHeadEntrySet()

Gets the SwatHtmlHeadEntry objects needed by this tile view.

protected string

getInlineJavaScript()

Gets the inline JavaScript required for this tile view.

array

getMessages()

Gathers all messages from this tile view.

SwatTile

getTile()

Gets a reference to a tile contained in the view.

boolean

hasGroup(string id)

Returns true if a group with the given id exists within this tile-view.

boolean

hasMessage()

Gets whether or not this tile view has any messages.

void

init()

Initializes this tile view.

boolean

isExtendedCheckAllSelected()

Whether or not the extended-check-all check-box was checked.

void

process()

Processes this tile view.

void

setDescendantStates(array states)

Sets descendant states.

void

setTile(SwatTile tile)

Sets a tile of this tile view.

protected boolean

showCheckAll()

Whether or not a check-all widget is to be displayed for the tiles of this tile view.

protected void

validateGroup(SwatTileViewGroup group)

Ensures a group added to this tile-view is valid for this tile-view.

Methods inherited from Swat.SwatView
addSelector, getSelection, init, setSelection
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/SwatTileView.php at line 53

check_all_content_type

public string $check_all_content_type = 'text/plain'

Optional content type for check-all widget title

Defaults to text/plain, use text/xml for XHTML fragments.


/Swat/SwatTileView.php at line 65

check_all_extended_count

public integer $check_all_extended_count

Count for displaying an extended-all checkbox

When the check-all checkbox has been checked, an additional checkbox will appear allowing the user to specify that they wish to select all possible items. This is useful in cases where pagination makes selecting all possible items impossible.


/Swat/SwatTileView.php at line 44

check_all_title

public string $check_all_title

Optional label title for the check-all widget

Defaults to "Check All".


/Swat/SwatTileView.php at line 79

check_all_unit

public mixed $check_all_unit

Optional extended-all checkbox unit.

Used for displaying a "check-all" message. Defaults to "items".


/Swat/SwatTileView.php at line 72

check_all_visible_count

public integer $check_all_visible_count

Count for all visible items when displaying an extended-all checkbox


/Swat/SwatTileView.php at line 104

groups

protected array $groups = array()

Grouping objects for this tile-view

See Also:
SwatTileView::addGroup()

/Swat/SwatTileView.php at line 95

groups_by_id

protected array $groups_by_id = array()

The groups of this tile-view indexed by their unique identifier

A unique identifier is not required so this array does not necessarily contain all groups in the view. It serves as an efficient data structure to lookup groups by their id.

The array is structured as id => group reference.


/Swat/SwatTileView.php at line 35

show_check_all

public boolean $show_check_all = true

Whether to show a "check all" widget

For this option to have an effect, this tile view's tile must contain a SwatCheckboxCellRenderer.


Constructor Detail

/Swat/SwatTileView.php at line 126

SwatTileView

public SwatTileView(string id)

Creates a new tile view

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

Method Detail

/Swat/SwatTileView.php at line 289

addChild

public void addChild(SwatTile|SwatTileViewGroup 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 SwatTile to use, use SwatTileView::setTile(). To add a SwatTileViewGroup use SwatTileView::appendGroup().

Parameters:
child - a reference to a child object to add.
Throws:
if the added object is not a tile.
if more than one tile is added to this tile view.
See Also:
SwatUIParent
SwatTileView::setTile()
SwatTileView::appendGroup()

/Swat/SwatTileView.php at line 697

appendGroup

public void appendGroup(SwatTileViewGroup group)

Appends a grouping object to this tile-view

A grouping object affects how the data in the model is displayed in this tile-view. With a grouping, a row splits tiles into groups with special group headers above each group.

Multiple groupings may be added to tile-views.

Parameters:
group - the tile-view grouping to append to this tile-view.
See Also:
SwatTileViewGroup
Throws:
if the group has the same id as a group already in this tile-view.

/Swat/SwatTileView.php at line 501

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/SwatTileView.php at line 634

createCompositeWidgets

protected void createCompositeWidgets()

Creates the composite check-all widget used by this tile view


/Swat/SwatTileView.php at line 207

display

public void display()

Displays this tile view


/Swat/SwatTileView.php at line 575

getCSSClassNames

protected array getCSSClassNames()

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

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

/Swat/SwatTileView.php at line 614

getCheckboxCellRenderer

protected SwatCheckboxCellRenderer getCheckboxCellRenderer()

Gets the first checkbox cell renderer in this tile view's tile

Returns:
the first checkbox cell renderer in this tile view's tile or null if no such cell renderer exists.

/Swat/SwatTileView.php at line 399

getDescendantStates

public array getDescendantStates()

Gets descendant states

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

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

/Swat/SwatTileView.php at line 322

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

/Swat/SwatTileView.php at line 371

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/SwatTileView.php at line 740

getGroup

public SwatTileViewGroup getGroup(string id)

Gets a group in this tile-view by the group's id

Parameters:
id - the id of the group to get.
Returns:
the requested group.
Throws:
if no group with the specified id exists in this tile-view.

/Swat/SwatTileView.php at line 757

getGroups

public array getGroups()

Gets all groups of this tile-view as an array

Returns:
the the groups of this tile-view.

/Swat/SwatTileView.php at line 474

getHtmlHeadEntrySet

public SwatHtmlHeadEntrySet getHtmlHeadEntrySet()

Gets the SwatHtmlHeadEntry objects needed by this tile view

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

/Swat/SwatTileView.php at line 537

getInlineJavaScript

protected string getInlineJavaScript()

Gets the inline JavaScript required for this tile view

Returns:
the inline JavaScript required for this tile view.
See Also:
SwatTile::getInlineJavaScript()

/Swat/SwatTileView.php at line 436

getMessages

public array getMessages()

Gathers all messages from this tile view

Returns:
an array of {@link SwatMessage} objects.

/Swat/SwatTileView.php at line 652

getTile

public SwatTile getTile()

Gets a reference to a tile contained in the view.

Returns:
the requested tile

/Swat/SwatTileView.php at line 722

hasGroup

public boolean hasGroup(string id)

Returns true if a group with the given id exists within this tile-view

Parameters:
id - the unique identifier of the group within this tile- view to check the existance of.
Returns:
true if the group exists in this tile-view and false if it does not.

/Swat/SwatTileView.php at line 454

hasMessage

public boolean hasMessage()

Gets whether or not this tile view has any messages

Returns:
true if this tile view has one or more messages and false if it does not.

/Swat/SwatTileView.php at line 147

init

public void init()

Initializes this tile view

This initializes the tile view and the tile contained in the view.

See Also:
SwatView::init()

/Swat/SwatTileView.php at line 195

isExtendedCheckAllSelected

public boolean isExtendedCheckAllSelected()

Whether or not the extended-check-all check-box was checked

Returns:
Whether or not the extended-checkbox was checked

/Swat/SwatTileView.php at line 173

process

public void process()

Processes this tile view

Process the tile contained by this tile view.

Unlike SwatWidget, composite widgets of this tile are not automatically processed. This allows tile-views to be created outside a SwatForm.


/Swat/SwatTileView.php at line 421

setDescendantStates

public void setDescendantStates(array states)

Sets descendant states

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

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

/Swat/SwatTileView.php at line 665

setTile

public void setTile(SwatTile tile)

Sets a tile of this tile view

Parameters:
tile - the tile to set

/Swat/SwatTileView.php at line 597

showCheckAll

protected boolean showCheckAll()

Whether or not a check-all widget is to be displayed for the tiles of this tile view

This depends on the SwatTileView::$show_check_all property as well as whether or not this tile view contains a SwatCheckboxCellRenderer and whether or not this tile view contains enough tiles to warrent having a check-all widget

Returns:
true if a check-all widget is to be displayed for this tile view and false if it is not.

/Swat/SwatTileView.php at line 773

validateGroup

protected void validateGroup(SwatTileViewGroup group)

Ensures a group added to this tile-view is valid for this tile-view

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

silverorange Code