qnx.fuse.ui.text.Label

Label

Properties | Methods | Events


Packageqnx.fuse.ui.text
Classpublic class Label
InheritanceLabel Inheritance TextBase Inheritance UIComponent Inheritance flash.display.MovieClip
Implements ILayoutElement

The Label class displays formatted text.

Class information:
BlackBerry 10 Version:   10.0.0

See also

TextInput



Public Properties

 PropertyDefined By
 InheritedcontextActions : Vector.<ActionSet>
Gets or Sets a Vector of ActionSet objects.
UIComponent
 InheritedcontextMultiSelectText : String
Gets or Sets a String to be displayed when showing the Multi Select Context Menu.
UIComponent
 InheritedcurrentTheme : String
[read-only] Returns the current theme this component is styled with.
UIComponent
 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
 Inheritedformat : TextFormat
Gets or sets the format of the text.
TextBase
  htmlText : String
Gets or sets the HTML representation of the text content.
Label
 Inheritedid : String
The id is a name for the component that can be used in CSS using the # selector.
UIComponent
 InheritedincludeInLayout : Boolean
Specifies whether or not the component should be included in its parent container's layout.
UIComponent
 InheritedlayoutComplete : Boolean
[read-only] Returns true if all of the text has been renderered and laid out.
TextBase
 InheritedlayoutData : Object
Gets or sets the layoutData.
UIComponent
 Inheritedlength : int
[read-only] Returns the length of the text that is being rendered.
TextBase
 Inheritedlocale : String
Gets or sets the current locale of the component.
UIComponent
  maxLines : int
[override] Gets or sets the maximum number of lines to be measured by a layout.
Label
 InheritedminHeight : Number
Gets or sets the minimum preferred height of the control.
UIComponent
 InheritedminLines : int
Gets or sets the minimum number of lines to be measured by a layout.
TextBase
 InheritedminWidth : Number
Gets or sets the minimum preferred width of the control.
UIComponent
 Inheritedselectable : Boolean
Gets or sets a value that determines whether text can be selected.
TextBase
 Inheritedselected : Boolean
[read-only] Returns true if the component has a text selection and false if it does not.
TextBase
 InheritedselectionActiveIndex : int
[read-only] Returns the zero-based index of the first character in the selection.
TextBase
 InheritedselectionAnchorIndex : int
[read-only] Returns the zero-based index of the last character in the selection.
TextBase
 InheritedstyleChildren : Boolean
Allows you to style the children of this component with CSS.
UIComponent
 Inheritedtext : String
Gets or sets the text of the component.
TextBase
 InheritedtextHeight : Number
[read-only] Gets the current height of the text.
TextBase
 InheritedtextWidth : Number
[read-only] Gets the current width of the text.
TextBase
  truncationMode : String
Gets or sets a value that determines how text will be truncated on a label.
Label
 InheritedvirtualLayout : Boolean
Gets or sets the virtualLayout property.
TextBase

Protected Properties

 PropertyDefined By
 InheritedaccessibilityImplimentationClass : Class
UIComponent
  cssID : String
[override] [read-only] Returns the CSS ID of the component.
Label
 InheritedenableEmoticons : Boolean
Gets or sets a value that enables or disables emoticons from being displayed.
TextBase
 InheritedexplicitLocale : Boolean
Set to true when the locale property has been set externally.
UIComponent
 InheritedinternalID : String
The Component's Id used for styling.
UIComponent
 InheritedlongPressEnabled : Boolean
Specifies whether the UIComponent can detect a long press.
UIComponent
 InheriteduserSelection : Boolean
Returns true if the user initiated the selection.
TextBase

Public Methods

 MethodDefined By
  
Creates a new Label instance.
Label
 Inherited
Cancels a long press from occuring on the component.
UIComponent
 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 CSS selector for the object, composing it from its position in the display hierarchy and an optional ID selector.
UIComponent
 Inherited
Returns the size options for the given control.
UIComponent
 Inherited
getTextLineAt(index:int):TextLine
Gets a TextLine instance at a specific index.
TextBase
 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
registerEmoticons(emoticons:Vector.<Emoticon>):void
Registers a set of emoticons with the text component.
TextBase
 Inherited
scrollInView(position:int, immediate:Boolean = false):void
Scrolls the position into view.
TextBase
 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
setSelection(anchorIndex:int, activeIndex:int):void
Sets the range of selected text.
TextBase
 Inherited
updateDefaultLocale(updateChildren:Boolean = true):void
Updates the locale property to be the same as the locale of the device.
UIComponent
 Inherited
Lets a component that contains text know that it should update its font formats as the font settings have changed.
UIComponent
 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
addTextLine(line:TextLine):Boolean
Adds a created text line to the display list and the textLines property.
TextBase
 Inherited
allowShowContextMenu(target:IEventDispatcher):Boolean
When the user presses on the component this method is called with the object that dispatched the event.
UIComponent
 Inherited
Process properties of the component.
UIComponent
 Inherited
Process the state of the component.
UIComponent
 Inherited
Style the component after the style has changed.
UIComponent
 Inherited
composeLines(width:Number, height:Number):Boolean
Creates all TextLine instances given the specified width and height.
TextBase
 Inherited
createTextLines(width:Number, height:Number):void
Renders the text at the specified width and height.
TextBase
 Inherited
cursor2linePos(cursor:Cursor, consumer:Function):void
Given a specified cursor, this method calls the consumer parameter with TextLine and the x position of the cursor.
TextBase
 Inherited
cursor2word(cursor:Cursor, consumer:Function):void
Based on a cursor, call the consumer with the logical start and end of the word in the text.
TextBase
 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
event2cursor(stageX:Number, stageY:Number, rail:TextLine):Cursor
Gets a cursor given x and y cordinates of the component, expressed in the stage corrdinate system.
TextBase
 Inherited
event2word(stageX:Number, stageY:Number, consumer:Function):void
Based on x and y positions in the stage corrdinate system, call the consumer with the logical start and end of the word in the text.
TextBase
 Inherited
excemptFromCSSStyling(target:*, property:String = null):void
Exempts a property on an object from being styled by CSS.
UIComponent
 Inherited
flushCache():void
Invoked as part of parentLayoutChanged.
UIComponent
 Inherited
getStyleApplier():Function
A style applier is a method that gets called every time a property from the stylesheet should be applied to the component.
UIComponent
 Inherited
Gets the text alignment for laying out the text.
TextBase
 Inherited
Gets the text to be rendered by the component.
TextBase
 Inherited
onAdded():void
Called when the instance is added to the stage.
UIComponent
 Inherited
Is called when a user is no longer long pressing on the component.
UIComponent
 Inherited
Is called when a user long presses on the component.
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
position2cursor(position:int):Cursor
Return a Cursor object given the specified position in the text.
TextBase
 Inherited
positionLine(line:TextLine, atIndex:int = -1):void
Positions an single line.
TextBase
 Inherited
positionLines(width:Number, height:Number, lines:Vector.<TextLine>):Point
Positions the specified lines.
TextBase
 Inherited
recycleLine(line:TextLine):void
Recycles the specified line and adds it to the cache to be re-used.
TextBase
 Inherited
Calling this function will refresh the ContextMenu with whatever actions were set by contextActions.
UIComponent
 Inherited
Removes the current TextLine instances from the display list.
TextBase
 Inherited
Called when the text is moving during a scroll.
TextBase
 Inherited
Shows the context menu if there are contextActions associated with the control.
UIComponent
 Inherited
styleState():void
Style the component after state has changed.
UIComponent
 Inherited
Called when text lines have been created and positioned.
TextBase
 Inherited
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Sets the size and position of the children of the component.
UIComponent

Events

 Event Summary Defined By
 InheritedDispatched when an action in the Context Menu is selected.UIComponent
 InheritedDispatched when the Context Menu has closed to the DISMISSED state.UIComponent
 InheritedDispatched when the ContextMenu is closing to the DISMISSED state.UIComponent
 InheritedDispatched when the Context Menu has opened to the PEEK or EXPANDED state.UIComponent
 InheritedDispatched when the ContextMenu is opening from the DISMISSED state.UIComponent
 InheritedDispatched when the textWidth or textHeight properties change.TextBase
 InheritedDispatched when the CrossCut multiselect has been canceled.UIComponent
 InheritedDispatched when there has been a change in the selection of the text.TextBase
 InheritedDispatched when a user has clicked on a link in the text.TextBase

Property Detail

cssID


cssID:String  [read-only]
[override]

Returns the CSS ID of the component. The CSS ID is used for identifying the type of component in CSS.

The default value is Label.


Implementation

protected function get cssID():String

htmlText


htmlText:String

Gets or sets the HTML representation of the text content. The following are a list of valid HTML tags.

Tag Description
Anchor tag The <a> tag creates a hypertext link and supports the following attributes:
  • href: Specifies a URL. When a user selects a link a TextEvent.LINK event will be dispatched. It is up to the application to handle user interaction with links in the application.
Bold tag The <b> tag renders text as bold. A bold typeface must be available for the font used.
Font tag The <font> tag specifies a font or list of fonts to display the text. The font tag supports the following attributes:
  • color: Only hexadecimal color (#FFFFFF) values are supported.
  • face: Specifies the name of the font to use. As shown in the following example, you can specify a list of comma-delimited font names, in which case Flash Player selects the first available font. If the specified font is not installed on the local computer system or isn't embedded in the SWF file, a substitute font is selected by the runtime.
Italic tag The <i> tag displays the tagged text in italics. An italic typeface must be available for the font used.
Underline tag The <u> tag underlines the tagged text.
Striketrough tag The <s> tag adds a line through the center of the text.


Implementation

public function get htmlText():String
public function set htmlText(value:String):void

See also

qnx.fuse.ui.events.TextEvent.LINK

maxLines


maxLines:int
[override]

Gets or sets the maximum number of lines to be measured by a layout.

The text component will render additional lines, if necessary, and will be clipped from view. Setting this value to 0 causes all lines to be measured.

The default value is 1.


Implementation

public function get maxLines():int
public function set maxLines(value:int):void

truncationMode


truncationMode:String

Gets or sets a value that determines how text will be truncated on a label.

Valid values can be found in the TextTruncationMode class.

Truncating text will only occur when setting the text property of the label. Truncation will not occur on the htmlText property.

The default value is TextTruncationMode.TRUNCATE_TAIL.


Implementation

public function get truncationMode():String
public function set truncationMode(value:String):void

See also

TextTruncationMode

Constructor Detail

Label()


public function Label()

Creates a new Label instance. The default width for a Label is 100 pixels. The default height for a Label is the required height to display one line of text, based on the default text format.





comments powered by Disqus