| Package | qnx.ui.listClasses |
| Class | public class CellRenderer |
| Inheritance | CellRenderer SkinnableComponent UIComponent flash.display.MovieClip |
| Implements | ICellRenderer |
| Subclasses | AlternatingCellRenderer, DropDownCellRenderer, PickerListCellRenderer, SectionHeaderRenderer |
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.
See also
| Property | Defined By | ||
|---|---|---|---|
| column : int
Gets or sets the column of the cell. | CellRenderer | ||
![]() | containment : String
Gets or sets a property that determines how a component is contained within a parent container. | UIComponent | |
| data : Object
Gets or sets the data object for the cell renderer. | CellRenderer | ||
| 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 | ||
| row : int
Gets or sets the row of the cell. | CellRenderer | ||
| section : int
Gets or sets the section of the cell. | CellRenderer | ||
![]() | size : Number
Gets or sets the size for this component (as a percentage of the
container's size, or in pixels). | UIComponent | |
![]() | sizeMode : String
Gets or sets the size mode for this component. | UIComponent | |
![]() | sizeUnit : String
Gets or sets the unit of measure for the size property. | UIComponent | |
| state : String
Gets or sets the state of the cell. | CellRenderer | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a CellRenderer instance. | CellRenderer | ||
![]() | destroy():void
Call this method when you want to have your object collected by the garbage collector. | UIComponent | |
![]() | drawNow():void
Calls the draw() method. | UIComponent | |
getTextFormatForState(state:String):TextFormat
Returns the TextFormat object for a specified state. | CellRenderer | ||
![]() | invalidate(property:String, invalidateNow:Boolean = false):void
Marks the property as invalid and the draw() method is called on the next frame or the next render, whichever comes first. | UIComponent | |
![]() | setPosition(x:Number, y:Number):void
Sets the x and y position of the component. | UIComponent | |
setSize(w:Number, h:Number):void [override]
Sets the width and height of the component. | CellRenderer | ||
![]() | setSkin(cellSkin:Object):void
Set the skin object on the component for it to render. | SkinnableComponent | |
setTextFormatForState(format:TextFormat, state:String):void
Sets the TextFormat object for the label of a given state. | CellRenderer | ||
| column | property |
column:intGets or sets the column of the cell.
public function get column():int public function set column(value:int):void| data | property |
data:ObjectGets 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.
public function get data():Object public function set data(value:Object):void| index | property |
index:intGets or sets the index of the cell.
public function get index():int public function set index(value:int):void| isHeader | property |
isHeader:Boolean [read-only] Returns a Boolean indicating whether or not the cell is a header.
public function get isHeader():Boolean| row | property |
row:intGets or sets the row of the cell.
public function get row():int public function set row(value:int):void| section | property |
section:intGets or sets the section of the cell.
public function get section():int public function set section(value:int):void| state | property |
state:StringGets or sets the state of the cell.
public function get state():String public function set state(value:String):void| CellRenderer | () | Constructor |
public function CellRenderer()
Creates a CellRenderer instance.
| getTextFormatForState | () | method |
public function getTextFormatForState(state:String):TextFormat
Returns the TextFormat object for a specified state.
Parameters
state:String — The state (as a String) for the TextFormat object to return.
|
TextFormat — The TextFormat object for the specified state.
|
See also
| setSize | () | method |
override public function setSize(w:Number, h:Number):voidSets the width and height of the component.
Parameters
w:Number — The new height of the component (in pixels).
| |
h:Number — The new width of the component (in pixels).
|
| setTextFormatForState | () | method |
public function setTextFormatForState(format:TextFormat, state: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.
| |
state:String — The button state for which to apply the TextFormat object.
|
See also