silverorange Code


Swat.SwatCellRenderer
/Swat/SwatCellRenderer.php at line 16

Class SwatCellRenderer

SwatObject
└─SwatUIObject
└─SwatCellRenderer

public abstract class SwatCellRenderer
extends SwatUIObject

Object for rendering a single cell

Subclasses add public class variable to store data they need for rendering.

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

Field Summary
string

$id

A non-visible unique id for this cell renderer, or null.

boolean

$sensitive

Sensitive.

Fields inherited from Swat.SwatUIObject
classes, html_head_entry_set, parent, visible
Method Summary
array

getBaseCSSClassNames()

Gets the base CSS class names for this cell renderer.

array

getDataSpecificCSSClassNames()

Gets the data specific CSS class names for this cell renderer.

SwatHtmlHeadEntrySet

getHtmlHeadEntrySet()

Gets the SwatHtmlHeadEntry objects needed by this cell renderer.

final array

getInheritanceCSSClassNames()

Gets the CSS class names of this cell renderer based on the inheritance tree for this cell renderer.

string

getInlineJavaScript()

Gets ths inline JavaScript required by this cell renderer.

array

getMessages()

Gathers all messages from this cell renderer.

string

getPropertyNameToMap(SwatUIObject object, string name)

Get a property name to use for mapping.

boolean

hasMessage()

Gets whether or not this cell renderer has messages.

void

init()

Called during the init phase.

boolean

isPropertyStatic(string property_name)

Checks if a public property is static (can not be data-mapped).

protected final void

makePropertyStatic(mixed property_name, $property_name string)

Make a public property static.

void

process()

Called during processing phase.

void

render()

Renders this cell.

Methods inherited from Swat.SwatUIObject
addComment, addJavaScript, addStyleSheet, addTangoAttribution, copy, getCSSClassNames, getCSSClassString, getFirstAncestor, getHtmlHeadEntrySet, getInlineJavaScript, getUniqueId, isVisible

Field Detail

/Swat/SwatCellRenderer.php at line 25

id

public string $id = null

A non-visible unique id for this cell renderer, or null


/Swat/SwatCellRenderer.php at line 37

sensitive

public boolean $sensitive = true

Sensitive

Whether this renderer is sensitive. If a renderer is sensitive it reacts to user input. Unsensitive renderers should display "grayed-out" to inform the user they are not sensitive. All renderers that react to user input should respect this property in their display() method.


Method Detail

/Swat/SwatCellRenderer.php at line 179

getBaseCSSClassNames

public array getBaseCSSClassNames()

Gets the base CSS class names for this cell renderer

This is the recommended place for cell-renderer subclasses to add extra hard-coded CSS classes.

Returns:
the array of base CSS class names for this cell renderer.

/Swat/SwatCellRenderer.php at line 196

getDataSpecificCSSClassNames

public array getDataSpecificCSSClassNames()

Gets the data specific CSS class names for this cell renderer

This is the recommended place for cell-renderer subclasses to add extra hard-coded CSS classes that depend on data-bound properties of this cell-renderer.

Returns:
the array of base CSS class names for this cell renderer.

/Swat/SwatCellRenderer.php at line 213

getHtmlHeadEntrySet

public SwatHtmlHeadEntrySet getHtmlHeadEntrySet()

Gets the SwatHtmlHeadEntry objects needed by this cell renderer

If this renderer has never been rendered, an empty set is returned to reduce the number of required HTTP requests.

Returns:
the SwatHtmlHeadEntry objects needed by this cell renderer.

/Swat/SwatCellRenderer.php at line 268

getInheritanceCSSClassNames

public final array getInheritanceCSSClassNames()

Gets the CSS class names of this cell renderer based on the inheritance tree for this cell renderer

For example, a class with the following ancestry:

SwatCellRenderer -> SwatTextCellRenderer -> SwatNullTextCellRenderer

will return the following array of class names:

<?php
array(
   
'swat-cell-renderer',
   
'swat-text-cell-renderer',
   
'swat-null-text-cell-renderer',
);
?>

Returns:
the array of CSS class names based on an inheritance tree for this cell renderer.

/Swat/SwatCellRenderer.php at line 163

getInlineJavaScript

public string getInlineJavaScript()

Gets ths inline JavaScript required by this cell renderer

Returns:
the inline JavaScript required by this cell renderer.

/Swat/SwatCellRenderer.php at line 107

getMessages

public array getMessages()

Gathers all messages from this cell renderer

By default, cell renderers do not have messages. Subclasses may override this method to return messages.

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

/Swat/SwatCellRenderer.php at line 150

getPropertyNameToMap

public string getPropertyNameToMap(SwatUIObject object, string name)

Get a property name to use for mapping

This method can be overridden by sub-classes that need to modify the name of a property mapping. This allows cell renderers which conatin multiple SwatUIObject object to mangle property names if necessary to avoid conflicts.

Parameters:
object - the object containing the property that is being mapped. Usually this is the cell renderer itself, but not necessarily. It could be a UIObject within the cell renderer.
name - the name of the property being mapped.
Returns:
the name of the property to actually map. This property should either exist as a public property of the cell renderer or be handled by a magic __set() method.

/Swat/SwatCellRenderer.php at line 124

hasMessage

public boolean hasMessage()

Gets whether or not this cell renderer has messages

By default, cell renderers do not have messages. Subclasses may override this method if they have messages.

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

/Swat/SwatCellRenderer.php at line 80

init

public void init()

Called during the init phase

Sub-classes can redefine this method to perform any necessary processing.


/Swat/SwatCellRenderer.php at line 239

isPropertyStatic

public boolean isPropertyStatic(string property_name)

Checks if a public property is static (can not be data-mapped)

This method takes a property name and returns a boolean representing weather or not the property has been made static.

Parameters:
property_name - the property name to check.
Returns:
true if the property is static and false if the property may be data-mapped.
See Also:
SwatCellRenderer::makePropertyStatic()

/Swat/SwatCellRenderer.php at line 308

makePropertyStatic

protected final void makePropertyStatic(mixed property_name, $property_name string)

Make a public property static

This method takes a property name and marks it as static, meaning that a user can not data-map this property.

Parameters:
string - the property name
See Also:
SwatCellRenderer::isPropertyStatic()
Throws:
if the specified $property_name is not a non-static public property of this class.

/Swat/SwatCellRenderer.php at line 92

process

public void process()

Called during processing phase

Sub-classes can redefine this method to perform any necessary processing.


/Swat/SwatCellRenderer.php at line 67

render

public void render()

Renders this cell

Renders this cell using the values currently stored in class variables.

Cell renderer subclasses should extend this method to do all output neccessary to display the cell.


silverorange Code