SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatView
└─SwatTileView
public class SwatTileView
extends SwatView
| Field Summary | |
|---|---|
| string | Optional content type for check-all widget title. |
| integer | Count for displaying an extended-all checkbox. |
| string | Optional label title for the check-all widget. |
| mixed | Optional extended-all checkbox unit. |
| integer | Count for all visible items when displaying an extended-all checkbox. |
| protected array | Grouping objects for this tile-view. |
| protected array | The groups of this tile-view indexed by their unique identifier. |
| boolean | 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 | Creates the composite check-all widget used by this tile view. |
| void | display() Displays this tile view. |
| protected array | Gets the array of CSS classes that are applied to this tile view. |
| protected SwatCheckboxCellRenderer | Gets the first checkbox cell renderer in this tile view's tile. |
| array | 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 | Gets all groups of this tile-view as an array. |
| SwatHtmlHeadEntrySet | Gets the SwatHtmlHeadEntry objects needed by this tile view. |
| protected string | Gets the inline JavaScript required for this tile view. |
| array | 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 | Gets whether or not this tile view has any messages. |
| void | init() Initializes this tile view. |
| boolean | 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 | Sets a tile of this tile view. |
| protected boolean | 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 | |
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.
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.
public string $check_all_title
Optional label title for the check-all widget
Defaults to "Check All".
public mixed $check_all_unit
Optional extended-all checkbox unit.
Used for displaying a "check-all" message. Defaults to "items".
public integer $check_all_visible_count
Count for all visible items when displaying an extended-all checkbox
protected array $groups = array()
Grouping objects for this tile-view
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.
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.
public SwatTileView(string id)
Creates a new tile view
id - a non-visable unique id for this widget.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().
child - a reference to a child object to add.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.
group - the tile-view grouping to append to this tile-view.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.protected void createCompositeWidgets()
Creates the composite check-all widget used by this tile view
public 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
public array getDescendantStates()
Gets descendant states
Retrieves an array of states of all stateful UI-objects in the widget subtree below this tile 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 SwatUIObject getFirstDescendant(string class_name)
Gets the first descendant UI-object of a specific class
class_name - class name to look for.public SwatTileViewGroup getGroup(string id)
Gets a group in this tile-view by the group's id
id - the id of the group to get.public array getGroups()
Gets all groups of this tile-view as an array
public SwatHtmlHeadEntrySet getHtmlHeadEntrySet()
Gets the SwatHtmlHeadEntry objects needed by this tile view
protected string getInlineJavaScript()
Gets the inline JavaScript required for this tile view
public array getMessages()
Gathers all messages from this tile view
public SwatTile getTile()
Gets a reference to a tile contained in the view.
public boolean hasGroup(string id)
Returns true if a group with the given id exists within this tile-view
id - the unique identifier of the group within this tile- view to check the existance of.public boolean hasMessage()
Gets whether or not this tile view has any messages
public void init()
Initializes this tile view
This initializes the tile view and the tile contained in the view.
public boolean isExtendedCheckAllSelected()
Whether or not the extended-check-all check-box was checked
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.
public void setDescendantStates(array states)
Sets descendant states
Sets states on all stateful UI-objects in the widget subtree below this tile view.
states - an array of UI-object states with UI-object identifiers as array keys.public void setTile(SwatTile tile)
Sets a tile of this tile view
tile - the tile to setprotected 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
protected void validateGroup(SwatTileViewGroup group)
Ensures a group added to this tile-view is valid for this tile-view
group - the group to check.
A tile view widget for containing a
SwatTiletileRecords in this tile-view's model may be selected by the user by adding a view-selector to this tile-view. See
SwatViewfor details on how to useSwatViewSelectorobjects.