CellRenderer
Package | qnx.fuse.ui.listClasses |
Class | public class CellRenderer |
Inheritance | CellRenderer ![]() ![]() ![]() |
Implements | ICellRenderer |
Subclasses | AlternatingCellRenderer, DropDownAboveCellRenderer, DropDownCellRenderer, PickerListCellRenderer, SectionHeaderRenderer |
The
CellRenderer
class provides the base functionality for cell renderers in any of the list classes, such as List
,
TileList
, SectionList
, and SectionTileList
.
The CellRenderer
class consists of a skin and a label.
Class information: |
---|
PlayBook Tablet OS Version: 1.0.6 |
See also
Public Properties
Property | Defined By | ||
---|---|---|---|
column : int
Gets or sets the column of the cell. | CellRenderer | ||
data : Object
Gets or sets the data object for the cell renderer. | CellRenderer | ||
![]() | explicitHeight : Number [read-only]
Returns the explicit height (actual height, in pixels) of the UI component. | UIComponent | |
![]() | explicitWidth : Number [read-only]
Returns the explicit width (actual width, in pixels) of the UI component. | UIComponent | |
![]() | includeInLayout : Boolean
Specifies whether or not the component should be included in its parent container's layout. | UIComponent | |
index : int
Gets or sets the index of the cell. | CellRenderer | ||
isHeader : Boolean [read-only]
Returns a Boolean indicating whether or not the cell is a header. | CellRenderer | ||
![]() | layoutData : Object
Returns the layout data for the object. | UIComponent | |
![]() | minHeight : Number
Gets or sets the minimum preferred height of the control. | UIComponent | |
![]() | minWidth : Number
Gets or sets the minimum preferred width of the control. | UIComponent | |
row : int
Gets or sets the row of the cell. | CellRenderer | ||
section : int
Gets or sets the section of the cell. | CellRenderer | ||
![]() | state : String
Gets or sets the state of the component. | SkinnableComponent |
Public Methods
Method | Defined By | ||
---|---|---|---|
Creates a CellRenderer instance. | CellRenderer | ||
![]() | childChanged(resizedChild:DisplayObject = null):Boolean
Notifies the UIComponent that one or more of its children has changed in a manner
that may affect this object's layout. | UIComponent | |
![]() | destroy():void
Call this method when you want to have your object collected by the garbage collector. | UIComponent | |
![]() | getSizeOptions():int
Returns the size options for the given control. | UIComponent | |
getTextFormatForState(textState:String):TextFormat
Returns the TextFormat object for a specified state. | CellRenderer | ||
![]() | invalidateDisplayList():void
Calling this method results in a call to the components validateDisplayList() method before the display list is rendered. | UIComponent | |
![]() | invalidateProperties():void
Calling this method results in a call to the components validateProperties() method before the display list is rendered. | UIComponent | |
![]() | measure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
This method calls doMeasure() in order to calculate the preferred size of the control. | UIComponent | |
![]() | setActualSize(w:Number, h:Number):void
Sets the width and height of the object without setting
the explicitWidth and explicitHeight. | UIComponent | |
![]() | setLayoutBounds(bounds:Rectangle):void
Sets the receiver's size and location to the rectangular area specified
by the arguments. | UIComponent | |
![]() | setPosition(x:Number, y:Number):void
Sets the x and y position of the component. | UIComponent | |
![]() | setSkin(newSkin:Object):void
Set the skin object on the component for it to render. | SkinnableComponent | |
setTextFormatForState(format:TextFormat, textState:String):void
Sets the TextFormat object for the label of a given state. | CellRenderer | ||
![]() | validateDisplayList():void
Validates the display list of the component by calling the updateDisplayList(). | UIComponent | |
![]() | validateNow():void
Validates the component immediately by calling validateProperties(), validateSizes(), and validateDisplayList() if necessary. | UIComponent | |
![]() | validateProperties():void
Validates the properties of the component by calling the commitProperties() method. | UIComponent |
Protected Methods
Property Detail
column
column:int |
Gets or sets the column of the cell.
Implementation
public function get column():int |
public function set column(value:int):void |
data
data:Object |
Gets or sets the data object for the cell renderer.
The set
method expects the data object to contain a non-null label
property. This property is
used to set an internal label
textfield.
Implementation
public function get data():Object |
public function set data(value:Object):void |
index
index:int |
Gets or sets the index of the cell.
Implementation
public function get index():int |
public function set index(value:int):void |
isHeader
isHeader:Boolean [read-only] |
Returns a Boolean indicating whether or not the cell is a header.
The default value is false
.
Implementation
public function get isHeader():Boolean |
row
row:int |
Gets or sets the row of the cell.
Implementation
public function get row():int |
public function set row(value:int):void |
section
section:int |
Gets or sets the section of the cell.
Implementation
public function get section():int |
public function set section(value:int):void |
Constructor Detail
CellRenderer()
public function CellRenderer() |
Creates a CellRenderer
instance.
Method Detail
getTextFormatForState()
public function getTextFormatForState(textState:String):TextFormat |
Returns the TextFormat
object for a specified state.
Parameters
textState:String — The state (as a String) for the TextFormat object to return.
|
Returns
TextFormat — The TextFormat object for the specified state.
|
See also
setTextFormatForState()
public function setTextFormatForState(format:TextFormat, textState:String):void |
Sets the TextFormat
object for the label of a given state.
Valid states are SkinStates.UP
, SkinStates.DOWN
,
SkinStates.SELECTED
, SkinStates.DISABLED
.
In the following example, TextFormat
objects are created and applied to each button state by calling the
setTextFormatForState
method. The TextFormat
objects are used to differentiate
the appearance of the label text for the various button states. In the following example, unique TextFormat
objects
are created for the disabled, up, and down states.
var format:TextFormat = new TextFormat(); format.font = "BBAlpha Sans"; format.size = 16; format.color = 0xcc0000; format.align = TextFormatAlign.CENTER; var formatDown:TextFormat = new TextFormat(); formatDown.font = "BBAlpha Sans"; formatDown.size = 16; formatDown.color = 0xFFFFFF; formatDown.align = TextFormatAlign.CENTER; var formatDisable:TextFormat = new TextFormat(); formatDisable.font = "BBAlpha Sans"; formatDisable.size = 16; formatDisable.color = 0xCCCCCC; formatDisable.align = TextFormatAlign.CENTER; var myButton:LabelButton = new LabelButton(); myButton.setTextFormatForState(formatDisable,SkinStates.DISABLED); myButton.setTextFormatForState(format,SkinStates.UP); myButton.setTextFormatForState(formatDown,SkinStates.DOWN); myButton.setTextFormatForState(format,SkinStates.SELECTED); myButton.setTextFormatForState(format,SkinStates.DISABLED_SELECTED); myButton.label = "OK"; myButton.x = myButton.y = 175;
Parameters
format:TextFormat — The TextFormat object to apply to the button state.
|
textState:String — The button state for which to apply the TextFormat object.
|
See also