qnx.fuse.ui.text.EditableText

EditableText

Properties | Methods | Events


Packageqnx.fuse.ui.text
Classpublic class EditableText
InheritanceEditableText Inheritance TextBase Inheritance UIComponent Inheritance flash.display.MovieClip
Implements flash.text.ime.IIMEClient

The EditableText class provides functionality to input text.

The following listing creates an EditableText instance:

    var myEditableText:EditableText = new EditableText();
    myEditableText.x = 150;
    myEditableText.y = 200;
    myEditableText.setActualSize(300, 200);
    myEditableText.text = "Lorem ipsum dolor sit amet, consectetur " +
        "adipiscing elit. In blandit, erat euismod sagittis semper," +
        " libero mi semper orci, vel suscipit purus lectus nec velit.";
    myEditableText.autoCapitalize = AutoCapitalize.SENTENCE;
    this.addChild(myEditableText);
    


Class information:
PlayBook Tablet OS Version:   1.0.6

See also

TextArea
TextInput



Public Properties

 PropertyDefined By
  autoCapitalize : String
Gets or sets a value that enables auto-capitalization when the user inputs text.
EditableText
  autoCorrect : Boolean
Gets or sets a value that enables auto-correct when text is entered by the user.
EditableText
  disableReturnKey : Boolean
Gets or sets a value that disables the return key on the soft keyboard.
EditableText
  displayAsPassword : Boolean
Gets or sets a value that determines whether text is masked (as in a password field).
EditableText
  editable : Boolean
Gets or sets a value that determines if text can be modified.
EditableText
  editing : Boolean
[read-only] Returns true when the user starts editing the text and false when the user stops editing.
EditableText
 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
 InheritedincludeInLayout : Boolean
Specifies whether or not the component should be included in its parent container's layout.
UIComponent
 InheritedlayoutData : Object
Returns the layout data for the object.
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 text.
TextBase
  maxChars : int
Gets or sets the maximum number of characters that can be entered in the field.
EditableText
 InheritedmaxLines : int
Gets or sets the maximum number of lines to be measured by a layout.
TextBase
 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
  restrict : String
Gets or sets the set of characters (as a String) that a user can enter into the text field.
EditableText
  returnKeyLabel : String
Gets or sets the label of the return key on the soft keyboard.
EditableText
 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
  softKeyboardType : String
Gets or sets the type of keyboard to be displayed when an editing session begins.
EditableText
  spellCheck : Boolean
Gets or sets a value that enables spell-check.
EditableText
  text : String
[override] Gets or sets the text of the component.
EditableText
 InheritedtextHeight : Number
[read-only] Gets the current height of the text.
TextBase
 InheritedtextWidth : Number
[read-only] Gets the current width of the text.
TextBase

Protected Properties

 PropertyDefined By
 InheritedenableEmoticons : Boolean
Gets or sets a value that enables or disables emoticons from being displayed.
TextBase

Public Methods

 MethodDefined By
  
Creates an EditableText instance.
EditableText
 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
  
deleteText(startIndex:int = 0, endIndex:int = -1):void
Deletes the text between a given start and end index.
EditableText
 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
 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
mouseFocusChange(event:FocusEvent):void
Checks to see if focus is about to be lost when interacting with an object in the control.
TextBase
 Inherited
registerEmoticons(emoticons:Vector.<Emoticon>):void
Registers a set of emoticons with the text component.
TextBase
  
replaceText(startIndex:int, endIndex:int, insert:String):void
Replaces the text between at a given start and end index.
EditableText
 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
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
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
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
flushCache():void
Invoked as part of parentLayoutChanged.
UIComponent
 Inherited
Gets the text alignment for laying out the text.
TextBase
 Inherited
Gets the text to be rendered by the component.
TextBase
  
insertText(insert:String, startIndex:int, endIndex:int):void
Replaces the specified text between a given start and end index.
EditableText
 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
position2cursor(position:int):Cursor
Return a Cursor object given the specified position in the text.
TextBase
 Inherited
positionLines(width:Number, height:Number, lines:Vector.<TextLine>):Point
Positions all of the created text lines given a specified width and height.
TextBase
 Inherited
Removes the current TextLine instances from the display list.
TextBase
 Inherited
Called when the text is moving during a scroll.
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
   This event is fired when an editing session starts on the text component.EditableText
   This event is fired when an editing session stops on the text component.EditableText
 Inherited This event is fired when the dimensions of the text have changed.TextBase
 Inherited This event is fired when a selection change on the component occurs.TextBase

Property Detail

autoCapitalize


autoCapitalize:String

Gets or sets a value that enables auto-capitalization when the user inputs text. Possible values are:

  • AutoCapitalize.NONE - no capitalization.
  • AutoCapitalize.SENTENCE - Sentence case capitalization (first word only).


Implementation

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

See also

AutoCapitalize

autoCorrect


autoCorrect:Boolean

Gets or sets a value that enables auto-correct when text is entered by the user.

The default value is true.


Implementation

public function get autoCorrect():Boolean
public function set autoCorrect(value:Boolean):void

disableReturnKey


disableReturnKey:Boolean

Gets or sets a value that disables the return key on the soft keyboard.


Implementation

public function get disableReturnKey():Boolean
public function set disableReturnKey(value:Boolean):void

displayAsPassword


displayAsPassword:Boolean

Gets or sets a value that determines whether text is masked (as in a password field).


Implementation

public function get displayAsPassword():Boolean
public function set displayAsPassword(value:Boolean):void

editable


editable:Boolean

Gets or sets a value that determines if text can be modified. Set to true to make the text editable. Setting this value to false disables editing, however the text can still be selected.

The default value is true.


Implementation

public function get editable():Boolean
public function set editable(value:Boolean):void

editing


editing:Boolean  [read-only]

Returns true when the user starts editing the text and false when the user stops editing.


Implementation

public function get editing():Boolean

See also

editStart
editStop

maxChars


maxChars:int

Gets or sets the maximum number of characters that can be entered in the field.

A script can insert more text than maxChars allows; the maxChars property indicates only how much text a user can enter. If the value of this property is 0, a user can enter an unlimited amount of text.

The default value is The default value is 0..


Implementation

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

restrict


restrict:String

Gets or sets the set of characters (as a String) that a user can enter into the text field.


Implementation

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

returnKeyLabel


returnKeyLabel:String

Gets or sets the label of the return key on the soft keyboard.


Implementation

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

See also

ReturnKeyType

softKeyboardType


softKeyboardType:String

Gets or sets the type of keyboard to be displayed when an editing session begins.


Implementation

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

See also

KeyboardType

spellCheck


spellCheck:Boolean

Gets or sets a value that enables spell-check. When spellcheck is enabled, red edit marks will be displayed below misspelled words when the user inserts text.


Implementation

public function get spellCheck():Boolean
public function set spellCheck(value:Boolean):void

text


text:String
[override]

Gets or sets the text of the component.


Implementation

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

Constructor Detail

EditableText()


public function EditableText()

Creates an EditableText instance.

Method Detail

deleteText()


public function deleteText(startIndex:int = 0, endIndex:int = -1):void

Deletes the text between a given start and end index.

Parameters

startIndex:int (default = 0) — The start index of the text to delete. Default is 0.
endIndex:int (default = -1) — The end index of the text to delete. Default is -1.

insertText()


protected final function insertText(insert:String, startIndex:int, endIndex:int):void

Replaces the specified text between a given start and end index.

The current text between the start and end index is replaced by the new text. Passing an empty string as the insert parameter will delete the text between the start and end indices.

Parameters

insert:String — The text to be inserted.
startIndex:int — The start index to place the text.
endIndex:int — The end index where to place the text.

replaceText()


public function replaceText(startIndex:int, endIndex:int, insert:String):void

Replaces the text between at a given start and end index.

Parameters

startIndex:int — The start index of the text to replace.
endIndex:int — The end index of the text to replace.
insert:String — The text to insert.

Event Detail

editStart


Event Object Type: qnx.fuse.ui.events.TextEvent
TextEvent.type property = qnx.fuse.ui.events.TextEvent.EDIT_START

This event is fired when an editing session starts on the text component.

editStop


Event Object Type: qnx.fuse.ui.events.TextEvent
TextEvent.type property = qnx.fuse.ui.events.TextEvent.EDIT_STOP

This event is fired when an editing session stops on the text component.