CellRenderer
Properties | Methods | Events
Package | qnx.fuse.ui.listClasses |
Class | public class CellRenderer |
Inheritance | CellRenderer ![]() ![]() ![]() ![]() |
Subclasses | AlternatingCellRenderer, CrossCutActionRenderer, DropDownCellRenderer, PickerListCellRenderer, SectionHeaderRenderer, TileRenderer |
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: |
---|
BlackBerry 10 Version: 10.0.0 |
See also
Public Properties
Property | Defined By | ||
---|---|---|---|
![]() | column : int
Gets or sets the column of the cell. | CellRendererBase | |
![]() | contextActions : Vector.<ActionSet>
Gets or Sets a Vector of ActionSet objects. | UIComponent | |
![]() | contextMultiSelectText : String
Gets or Sets a String to be displayed when showing the Multi Select Context Menu. | UIComponent | |
![]() | currentTheme : String [read-only]
Returns the current theme this component is styled with. | UIComponent | |
![]() | data : Object
Gets or sets the data of the cell. | CellRendererBase | |
![]() | 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 | |
![]() | id : String
The id is a name for the component that can be used in CSS using the # selector. | 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. | CellRendererBase | |
![]() | isHeader : Boolean [read-only]
Gets a Boolean that determines whether or not a row is a header. | CellRendererBase | |
![]() | layoutData : Object
Gets or sets the layoutData. | UIComponent | |
![]() | listOwner : List
Gets or sets the list instance that the cell is associated with. | CellRendererBase | |
![]() | locale : String
Gets or sets the current locale of the component. | 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 | |
paddingBottom : int
Gets or sets the padding to the bottom of the text and the bottom of the skin. | CellRenderer | ||
paddingLeft : int
Gets or sets the padding to the left of the text and the left of the skin. | CellRenderer | ||
paddingRight : int
Gets or sets the padding to the right of the text and the right of the skin. | CellRenderer | ||
paddingTop : int
Gets or sets the padding to the top of the text and the top of the skin. | CellRenderer | ||
![]() | row : int
Gets or sets the row of the cell. | CellRendererBase | |
![]() | section : int
Gets or sets the section of the cell. | CellRendererBase | |
![]() | state : String
Gets or sets the state of the component. | SkinnableComponent | |
![]() | styleChildren : Boolean
Allows you to style the children of this component with CSS. | UIComponent |
Protected Properties
Property | Defined By | ||
---|---|---|---|
![]() | accessibilityImplimentationClass : Class | UIComponent | |
cssID : String [override] [read-only]
Returns the CSS ID of the component. | CellRenderer | ||
![]() | explicitLocale : Boolean
Set to true when the locale property has been set externally. | UIComponent | |
![]() | internalID : String
The Component's Id used for styling. | UIComponent | |
![]() | longPressEnabled : Boolean
Specifies whether the UIComponent can detect a long press. | UIComponent |
Public Methods
Method | Defined By | ||
---|---|---|---|
Creates a CellRenderer instance. | CellRenderer | ||
![]() | cancelLongPress():void
Cancels a long press from occuring on the component. | UIComponent | |
![]() | 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 | |
![]() | configureStyles(styles:Array):void [override]
The SkinnableComponent version styles the component with the base style first, and then styles it with the current state's style. | SkinnableComponent | |
![]() | destroy():void
Call this method when you want to have your object collected by the garbage collector. | UIComponent | |
![]() | getCSSSelector():String
Returns the CSS selector for the object, composing it from its position
in the display hierarchy and an optional ID selector. | UIComponent | |
![]() | getSizeOptions():int
Returns the size options for the given control. | UIComponent | |
getTextFormatForState(state: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, stateToModify:String):void
Sets the TextFormat object for the label of a given state. | CellRenderer | ||
![]() | updateDefaultLocale(updateChildren:Boolean = true):void
Updates the locale property to be the same as the locale of the device. | UIComponent | |
updateFontSettings():void [override]
Updates the internal Label component to reflect the latest font settings. | 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
cssID
cssID:String [read-only] |
Returns the CSS ID of the component. The CSS ID is used for identifying the type of component in CSS.
The default value is CellRenderer
.
Implementation
protected function get cssID():String |
paddingBottom
paddingBottom:int |
Gets or sets the padding to the bottom of the text and the bottom of the skin.
Implementation
public function get paddingBottom():int |
public function set paddingBottom(value:int):void |
paddingLeft
paddingLeft:int |
Gets or sets the padding to the left of the text and the left of the skin.
Implementation
public function get paddingLeft():int |
public function set paddingLeft(value:int):void |
paddingRight
paddingRight:int |
Gets or sets the padding to the right of the text and the right of the skin.
Implementation
public function get paddingRight():int |
public function set paddingRight(value:int):void |
paddingTop
paddingTop:int |
Gets or sets the padding to the top of the text and the top of the skin.
Implementation
public function get paddingTop():int |
public function set paddingTop(value:int):void |
Constructor Detail
CellRenderer()
public function CellRenderer() |
Creates a CellRenderer
instance.
Method Detail
getTextFormatForState()
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.
|
Returns
TextFormat — The TextFormat object for the specified state.
|
See also
setTextFormatForState()
public function setTextFormatForState(format:TextFormat, stateToModify:String):void |
Sets the TextFormat
object for the label of a given state.
Valid states are:
SkinStates.UP
SkinStates.DOWN
SkinStates.SELECTED
SkinStates.DISABLED
SkinStates.DISABLED_SELECTED
SkinStates.DOWN_SELECTED
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.color = 0xcc0000; format.align = TextFormatAlign.CENTER; var formatDown:TextFormat = new TextFormat(); formatDown.color = 0xFFFFFF; formatDown.align = TextFormatAlign.CENTER; var formatDisable:TextFormat = new TextFormat(); 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.
|
stateToModify:String — The button state for which to apply the TextFormat object.
|
See also
updateFontSettings()
override public function updateFontSettings():void |
Updates the internal Label component to reflect the latest font settings. This will potentially resize the component.
The updateFontsettings
method is not called on children of the CellRenderer
class automatically.
If you write a component that extends CellRenderer
and contains text based controls, you must extend this method and call
updateFontSettings
on these children to see the new font settings reflected in them.
Event.CHANGE
event from the FontSettings
class.
See also