qnx.fuse.ui.text.TextInputBase

TextInputBase

Properties | Methods | Events


Packageqnx.fuse.ui.text
Classpublic class TextInputBase
InheritanceTextInputBase Inheritance SkinnableComponent Inheritance UIComponent Inheritance flash.display.MovieClip
Subclasses TextArea, TextInput

Provides base functionality for input text components.

This is the base class for the TextInput and TextArea classes.



Class information:
BlackBerry 10 Version:   10.0.0

See also

TextArea
TextInput



Public Properties

 PropertyDefined By
  autoCapitalize : String
Gets or sets a value that enables auto-capitalization when the user inputs text.
TextInputBase
  autoCorrect : Boolean
Gets or sets a value that enables auto-correct when text is entered by the user.
TextInputBase
  clearIconMode : int
Gets or sets a value that determines how the clear button appears in the text field.
TextInputBase
 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
  cursorColor : uint
Gets or sets the color of the cursor when editing.
TextInputBase
  disableReturnKey : Boolean
Gets or sets a value that disables the return key on the soft keyboard.
TextInputBase
  displayAsPassword : Boolean
Gets or sets a value that determines whether the control is a password field.
TextInputBase
  editable : Boolean
Gets or sets a value that determines if text can be modified.
TextInputBase
  error : Boolean
Gets or sets the error state of the component.
TextInputBase
 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
  forceLatinKeyboard : Boolean
When set to true, forces the keyboard to show the latin key layout.
TextInputBase
  format : TextFormat
Gets or sets the format of the text.
TextInputBase
 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
 InheritedlayoutData : Object
Gets or sets the layoutData.
UIComponent
  length : int
[read-only] Returns the length of the text that is being rendered.
TextInputBase
 Inheritedlocale : String
Gets or sets the current locale of the component.
UIComponent
  maskPassword : Boolean
Gets or sets a value that determines whether to mask the text of a password field.
TextInputBase
  maxChars : int
Gets or sets the maximum number of characters that can be entered in the field.
TextInputBase
 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
  paddingLeft : int
Gets or sets the padding to the left of the text and the left of the skin.
TextInputBase
  paddingRight : int
Gets or sets the padding to the right of the text and the right of the skin.
TextInputBase
  prompt : String
Gets or sets the prompt.
TextInputBase
  promptFont : String
Gets or sets the font used for the prompt text.
TextInputBase
  promptFontColor : uint
Gets or sets the font color of the prompt text.
TextInputBase
  restrict : String
Gets or sets the set of characters (as a String) that a user can enter into the text field.
TextInputBase
  returnKeyLabel : String
Gets or sets the label of the return key on the soft keyboard.
TextInputBase
  selectable : Boolean
Gets or sets a value that determines whether text can be selected.
TextInputBase
  selectionActiveIndex : int
[read-only] Returns the zero-based index of the first character in the selection.
TextInputBase
  selectionAnchorIndex : int
[read-only] Returns the zero-based index of the last character in the selection.
TextInputBase
  softKeyboardType : String
Gets or sets the type of keyboard to be displayed when an editing session begins.
TextInputBase
  spellCheck : Boolean
Gets or sets a value that enables spell-check.
TextInputBase
 Inheritedstate : String
Gets or sets the state of the component.
SkinnableComponent
 InheritedstyleChildren : Boolean
Allows you to style the children of this component with CSS.
UIComponent
  text : String
Gets or sets the text of the component.
TextInputBase

Protected Properties

 PropertyDefined By
 InheritedaccessibilityImplimentationClass : Class
UIComponent
 InheritedcssID : String
[override] [read-only] Returns the CSS ID of the component.
SkinnableComponent
 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

Public Methods

 MethodDefined By
  
Do not instantiate this class.
TextInputBase
 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
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
 Inherited
destroy():void
Call this method when you want to have your object collected by the garbage collector.
UIComponent
  
getClearIconRect():Rectangle
Gets the position and size of the clear icon.
TextInputBase
 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
  
hasFocus():Boolean
Returns true if the field has focus.
TextInputBase
 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
  
TextInputBase
  
registerEmoticons(emoticons:Vector.<Emoticon>):void
Registers a set of emoticons with the TextInputBase.
TextInputBase
  
replaceText(startIndex:int, endIndex:int, insert:String):void
Replaces the text between at a given start and end index.
TextInputBase
 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
  
setSelection(anchorIndex:int, activeIndex:int):void
Sets the range of selected text.
TextInputBase
 Inherited
setSkin(newSkin:Object):void
Set the skin object on the component for it to render.
SkinnableComponent
 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
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
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
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
getStyleForState(state:String):IStyleable
A utility method to get the styling information for a given state.
SkinnableComponent
 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
Calling this function will refresh the ContextMenu with whatever actions were set by contextActions.
UIComponent
 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
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's dimensions.
SkinnableComponent

Events

 Event Summary Defined By
 InheritedDispatched when an action in the Context Menu is selected.UIComponent
  Dispatched when the user changes the content of the textfield by adding or removing text.TextInputBase
 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
  Dispacthed when the user begins to edit the text.TextInputBase
  Dispatched when the user has finished editing the text.TextInputBase
 InheritedDispatched when the CrossCut multiselect has been canceled.UIComponent
  Dispatched when there has been a change in the selection of the text.TextInputBase

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).

The default value is AutoCapitalize#NONE.


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

clearIconMode


clearIconMode:int

Gets or sets a value that determines how the clear button appears in the text field.


Implementation

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

See also

TextInputIconMode

cursorColor


cursorColor:uint

Gets or sets the color of the cursor when editing.

The default value is 0x00A8DF.


Implementation

public function get cursorColor():uint
public function set cursorColor(value:uint):void

disableReturnKey


disableReturnKey:Boolean

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

The default value is false.


Implementation

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

displayAsPassword


displayAsPassword:Boolean

Gets or sets a value that determines whether the control is a password field.

To keep the field a password field and un-mask the text, set the maskPassword property to false.

The default value is false.


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

error


error:Boolean

Gets or sets the error state of the component. The error state should be shown when the contents of the text input dont match the expected input format.

The default value is false.


Implementation

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

forceLatinKeyboard


forceLatinKeyboard:Boolean

When set to true, forces the keyboard to show the latin key layout.

Users may only have non-latin keyboards set on their device. In some cases, such as passwords, users must use a latin keyboard. Setting this property to true will force the latin keyboard to appear, regardless of user preference.


Implementation

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

format


format:TextFormat

Gets or sets the format of the text.


Implementation

public function get format():TextFormat
public function set format(value:TextFormat):void

See also

TextFormat

length


length:int  [read-only]

Returns the length of the text that is being rendered.

This may be different than calling text.length(); Emoticons in the text count as 1 character.


Implementation

public function get length():int

maskPassword


maskPassword:Boolean

Gets or sets a value that determines whether to mask the text of a password field.

This property has no effect unless displayAsPassword is set to true.


Implementation

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

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.


Implementation

public function get maxChars():int
public function set maxChars(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

prompt


prompt:String

Gets or sets the prompt. The prompt is shown if the component does not contain any text.


Implementation

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

promptFont


promptFont:String

Gets or sets the font used for the prompt text.

The prompt text is formatted similar to the format property, with the exception of the font and the color.

The default value is Slate Pro Light.


Implementation

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

See also

promptFontColor

promptFontColor


promptFontColor:uint

Gets or sets the font color of the prompt text.

The prompt text is formatted similar to the format property, with the exception of the font and the color.

The default value is 0x555555.


Implementation

public function get promptFontColor():uint
public function set promptFontColor(value:uint):void

See also

promptFontColor

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

selectable


selectable:Boolean

Gets or sets a value that determines whether text can be selected.

The default value is true.


Implementation

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

selectionActiveIndex


selectionActiveIndex:int  [read-only]

Returns the zero-based index of the first character in the selection.


Implementation

public function get selectionActiveIndex():int

selectionAnchorIndex


selectionAnchorIndex:int  [read-only]

Returns the zero-based index of the last character in the selection.


Implementation

public function get selectionAnchorIndex():int

softKeyboardType


softKeyboardType:String

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

The default value is KeyboardType#DEFAULT.


Implementation

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

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.

If the user has disabled spell check in Settings, this will always return false and setting spellCheck will do nothing.

The default value is true.


Implementation

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

text


text:String

Gets or sets the text of the component.


Implementation

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

Constructor Detail

TextInputBase()


public function TextInputBase()

Do not instantiate this class.

Instead, use the TextInput or TextArea classes.

Method Detail

getClearIconRect()


public function getClearIconRect():Rectangle

Gets the position and size of the clear icon.

Returns

Rectangle — Returns the rectangle in which the clear icon occupies.

hasFocus()


public function hasFocus():Boolean

Returns true if the field has focus.

Returns

Boolean — True if the field has focus.

recalculateAreaOfInterest()


public function recalculateAreaOfInterest():void

registerEmoticons()


public function registerEmoticons(emoticons:Vector.<Emoticon>):void

Registers a set of emoticons with the TextInputBase.

Parameters

emoticons:Vector.<Emoticon> — A vector of emoticons to register.

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.

setSelection()


public function setSelection(anchorIndex:int, activeIndex:int):void

Sets the range of selected text.

You must set the selectable and enabled to true in order to create a selection.

Parameters

anchorIndex:int — The first character position of the selection.
activeIndex:int — The last character position of the seletion.

Event Detail

change


Event Object Type: flash.events.Event
Event.type property = flash.events.Event.CHANGE

Dispatched when the user changes the content of the textfield by adding or removing text.

editStart


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

Dispacthed when the user begins to edit the text.

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

The TextEvent.EDIT_START constant defines the value of the type property of the event object for an editStart event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
typeTextEvent.EDIT_START

editStop


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

Dispatched when the user has finished editing the text.

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

The TextEvent.EDIT_STOP constant defines the value of the type property of the event object for an editStop event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
typeTextEvent.EDIT_STOP

selectionChanged


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

Dispatched when there has been a change in the selection of the text. If the selected property is true there is a selection.

This event is fired when a selection is changed or cleared.

The TextEvent.SELECTION_CHANGED constant defines the value of the type property of the event object for an selectionChanged event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe object that is actively processing the Event object with an event listener.
typeTextEvent.SELECTION_CHANGED

See also

selected





comments powered by Disqus