qnx.fuse.ui.listClasses.CellRenderer

CellRenderer

Properties | Methods


Packageqnx.fuse.ui.listClasses
Classpublic class CellRenderer
InheritanceCellRenderer Inheritance SkinnableComponent Inheritance UIComponent Inheritance flash.display.MovieClip
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

AlternatingCellRenderer



Public Properties

 PropertyDefined 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
 InheritedexplicitHeight : Number
[read-only] Returns the explicit height (actual height, in pixels) of the UI component.
UIComponent
 InheritedexplicitWidth : Number
[read-only] Returns the explicit width (actual width, in pixels) of the UI component.
UIComponent
 InheritedincludeInLayout : 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
 InheritedlayoutData : Object
Returns the layout data for the object.
UIComponent
 InheritedminHeight : Number
Gets or sets the minimum preferred height of the control.
UIComponent
 InheritedminWidth : 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
 Inheritedstate : String
Gets or sets the state of the component.
SkinnableComponent

Public Methods

 MethodDefined By
  
Creates a CellRenderer instance.
CellRenderer
 Inherited
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
 Inherited
destroy():void
Call this method when you want to have your object collected by the garbage collector.
UIComponent
 Inherited
Returns the size options for the given control.
UIComponent
  
getTextFormatForState(textState:String):TextFormat
Returns the TextFormat object for a specified state.
CellRenderer
 Inherited
Calling this method results in a call to the components validateDisplayList() method before the display list is rendered.
UIComponent
 Inherited
Calling this method results in a call to the components validateProperties() method before the display list is rendered.
UIComponent
 Inherited
measure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
This method calls doMeasure() in order to calculate the preferred size of the control.
UIComponent
 Inherited
setActualSize(w:Number, h:Number):void
Sets the width and height of the object without setting the explicitWidth and explicitHeight.
UIComponent
 Inherited
setLayoutBounds(bounds:Rectangle):void
Sets the receiver's size and location to the rectangular area specified by the arguments.
UIComponent
 Inherited
setPosition(x:Number, y:Number):void
Sets the x and y position of the component.
UIComponent
 Inherited
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
 Inherited
Validates the display list of the component by calling the updateDisplayList().
UIComponent
 Inherited
Validates the component immediately by calling validateProperties(), validateSizes(), and validateDisplayList() if necessary.
UIComponent
 Inherited
Validates the properties of the component by calling the commitProperties() method.
UIComponent

Protected Methods

 MethodDefined By
 Inherited
Process properties of the component.
UIComponent
 Inherited
Process the state of the component.
UIComponent
 Inherited
doMeasure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
Performs a measurement on the control, and returns a LayoutMeasurement instance containing the available width and height within the layout.
UIComponent
 Inherited
flushCache():void
Invoked as part of parentLayoutChanged.
UIComponent
 Inherited
onAdded():void
Called when the instance is added to the stage.
UIComponent
 Inherited
onRemoved():void
Called when the instance is removed from the stage.
UIComponent
 Inherited
Invalidates the parent's size and display list if includeInLayout property is set to true.
UIComponent
 Inherited
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Sets the size and position of the children of the component.
UIComponent
 Inherited
updateSkin(unscaledWidth:Number, unscaledHeight:Number):void
Updates the skin.
SkinnableComponent

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()
SkinStates

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

getTextFormatForState()
SkinStates