flashx.textLayout.formats

# TabStopFormat - AS3

Package | flashx.textLayout.formats
Class | public class TabStopFormat
Inheritance | TabStopFormat Object
Implements | ITabStopFormat

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The TabStopFormat class represents the properties of a tab stop in a paragraph. You can set the `TextLayoutFormat.tabstops` property to an array of TabStopFormat objects.

View the examples

Related API Elements

flashx.textLayout.elements.TabElement
flashx.textLayout.formats.TextLayoutFormat.tabStops

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | alignment : * The tab alignment for this tab stop. | TabStopFormat
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | decimalAlignmentToken : * The alignment token to be used if the alignment is DECIMAL. | TabStopFormat
|  | defaultFormat : flashx.textLayout.formats:ITabStopFormat [static] [read-only] Returns a TabStopFormat object with default settings. | TabStopFormat
|  | position : * The position of the tab stop, in pixels, relative to the start edge of the column. | TabStopFormat

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | TabStopFormat(initialValues:flashx.textLayout.formats:ITabStopFormat = null) Creates a new TabStopFormat object. | TabStopFormat
|  | apply(incoming:flashx.textLayout.formats:ITabStopFormat):void Replaces property values in this TabStopFormat object with the values of properties that are set in the incoming ITabStopFormat instance. | TabStopFormat
|  | concat(incoming:flashx.textLayout.formats:ITabStopFormat):void Concatenates the values of properties in the incoming ITabStopFormat instance with the values of this TabStopFormat object. | TabStopFormat
|  | concatInheritOnly(incoming:flashx.textLayout.formats:ITabStopFormat):void Concatenates the values of properties in the incoming ITabStopFormat instance with the values of this TabStopFormat object. | TabStopFormat
|  | copy(values:flashx.textLayout.formats:ITabStopFormat):void Copies TabStopFormat settings from the values ITabStopFormat instance into this TabStopFormat object. | TabStopFormat
|  | getStyle(styleName:String):* Return the value of the style specified by the styleProp parameter which specifies the style name. | TabStopFormat
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isEqual(p1:flashx.textLayout.formats:ITabStopFormat, p2:flashx.textLayout.formats:ITabStopFormat):Boolean [static] Compares properties in ITabStopFormat instance p1 with properties in ITabStopFormat instance p2 and returns true if all properties match. | TabStopFormat
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | removeClashing(incoming:flashx.textLayout.formats:ITabStopFormat):void Sets properties in this TabStopFormat object to undefined if they do not match those in the incoming ITabStopFormat instance. | TabStopFormat
|  | removeMatching(incoming:flashx.textLayout.formats:ITabStopFormat):void Sets properties in this TabStopFormat object to undefined if they match those in the incoming ITabStopFormat instance. | TabStopFormat
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | setStyle(styleName:String, value:*):void Set the value of the style specified by the styleProp parameter which specifies the style name to value. | TabStopFormat
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Property Detail

### alignment

property

`alignment:*`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The tab alignment for this tab stop.

Legal values are TabAlignment.START, TabAlignment.CENTER, TabAlignment.END, TabAlignment.DECIMAL, FormatValue.INHERIT.

Default value is undefined indicating not set.

If undefined during the cascade this property will have a value of TabAlignment.START.

Implementation
`public function get alignment():*`
`public function set alignment(value:any):void`
Throws

| `RangeError` — when set value is not within range for this property

Related API Elements

FormatValue.INHERIT
flash.text.engine.TabAlignment

### decimalAlignmentToken

property

`decimalAlignmentToken:*`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The alignment token to be used if the alignment is DECIMAL.

Default value is undefined indicating not set.

If undefined during the cascade this property will have a value of null.

Implementation
`public function get decimalAlignmentToken():*`
`public function set decimalAlignmentToken(value:any):void`
Throws

| `RangeError` — when set value is not within range for this property

### defaultFormat

property

`defaultFormat:flashx.textLayout.formats:ITabStopFormat` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Returns a TabStopFormat object with default settings. This function always returns the same object.

Implementation
`public static function get defaultFormat():flashx.textLayout.formats:ITabStopFormat`

### position

property

`position:*`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The position of the tab stop, in pixels, relative to the start edge of the column.

Legal values are numbers from 0 to 10000 and FormatValue.INHERIT.

Default value is undefined indicating not set.

If undefined during the cascade this property will have a value of 0.

Implementation
`public function get position():*`
`public function set position(value:any):void`
Throws

| `RangeError` — when set value is not within range for this property

Related API Elements

FormatValue.INHERIT
Constructor Detail

### TabStopFormat

()
Constructor

`public function TabStopFormat(initialValues:flashx.textLayout.formats:ITabStopFormat = null)`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Creates a new TabStopFormat object. All settings are empty or, optionally, are initialized from the supplied `initialValues` object.

Parameters

| `initialValues:flashx.textLayout.formats:ITabStopFormat` (default = `null`)`` — optional instance from which to copy initial values.

Related API Elements

defaultFormat
Method Detail

### apply

()
method

`public function apply(incoming:flashx.textLayout.formats:ITabStopFormat):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Replaces property values in this TabStopFormat object with the values of properties that are set in the `incoming` ITabStopFormat instance. Properties that are `undefined` in the `incoming` ITabStopFormat instance are not changed in this object.

Parameters

| `incoming:flashx.textLayout.formats:ITabStopFormat` — instance whose property values are applied to this TabStopFormat object.

### concat

()
method

`public function concat(incoming:flashx.textLayout.formats:ITabStopFormat):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Concatenates the values of properties in the `incoming` ITabStopFormat instance with the values of this TabStopFormat object. In this (the receiving) TabStopFormat object, properties whose values are `FormatValue.INHERIT`, and inheriting properties whose values are `undefined` will get new values from the `incoming` object. Non-inheriting properties whose values are `undefined` will get their default values. All other property values will remain unmodified.

Parameters

| `incoming:flashx.textLayout.formats:ITabStopFormat` — instance from which values are concatenated.

Related API Elements

flashx.textLayout.formats.FormatValue.INHERIT

### concatInheritOnly

()
method

`public function concatInheritOnly(incoming:flashx.textLayout.formats:ITabStopFormat):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Concatenates the values of properties in the `incoming` ITabStopFormat instance with the values of this TabStopFormat object. In this (the receiving) TabStopFormat object, properties whose values are `FormatValue.INHERIT`, and inheriting properties whose values are `undefined` will get new values from the `incoming` object. All other property values will remain unmodified.

Parameters

| `incoming:flashx.textLayout.formats:ITabStopFormat` — instance from which values are concatenated.

Related API Elements

flashx.textLayout.formats.FormatValue.INHERIT

### copy

()
method

`public function copy(values:flashx.textLayout.formats:ITabStopFormat):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Copies TabStopFormat settings from the `values` ITabStopFormat instance into this TabStopFormat object. If `values` is `null`, this TabStopFormat object is initialized with undefined values for all properties.

Parameters

| `values:flashx.textLayout.formats:ITabStopFormat` — optional instance from which to copy values.

### getStyle

()
method

`public function getStyle(styleName:String):*`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Return the value of the style specified by the `styleProp` parameter which specifies the style name.

Parameters

| `styleName:String` — The name of the style whose value is to be retrieved.

Returns

| `*` — The value of the specified style. The type varies depending on the type of the style being accessed. Returns `undefined` if the style is not set.

### isEqual

()
method

`public static function isEqual(p1:flashx.textLayout.formats:ITabStopFormat, p2:flashx.textLayout.formats:ITabStopFormat):Boolean`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Compares properties in ITabStopFormat instance `p1` with properties in ITabStopFormat instance `p2` and returns `true` if all properties match.

Parameters

| `p1:flashx.textLayout.formats:ITabStopFormat` — instance to compare to `p2`.
| `p2:flashx.textLayout.formats:ITabStopFormat` — instance to compare to `p1`.

Returns

| `Boolean` — true if all properties match, false otherwise.

### removeClashing

()
method

`public function removeClashing(incoming:flashx.textLayout.formats:ITabStopFormat):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Sets properties in this TabStopFormat object to `undefined` if they do not match those in the `incoming` ITabStopFormat instance.

Parameters

| `incoming:flashx.textLayout.formats:ITabStopFormat` — instance against which to compare this TabStopFormat object's property values.

### removeMatching

()
method

`public function removeMatching(incoming:flashx.textLayout.formats:ITabStopFormat):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Sets properties in this TabStopFormat object to `undefined` if they match those in the `incoming` ITabStopFormat instance.

Parameters

| `incoming:flashx.textLayout.formats:ITabStopFormat` — instance against which to compare this TabStopFormat object's property values.

### setStyle

()
method

`public function setStyle(styleName:String, value:*):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Set the value of the style specified by the `styleProp` parameter which specifies the style name to `value`.

Parameters

| `styleName:String` — The name of the style whose value is to be set.
| `value:*` — The value to set.

Examples How to use this example
TabStopFormat_example.as
This example creates a paragraph that uses an array of three tab stops: a left-aligned tab at 50 pixels, a center-aligned tab at 150 pixels, and a right-aligned tab at 250 pixels.
Copy

    package flashx.textLayout.formats.examples {
        import flash.display.Sprite;
        import flash.text.engine.TabAlignment;
        import flashx.textLayout.container.ContainerController;
        import flashx.textLayout.compose.StandardFlowComposer;
        import flashx.textLayout.elements.ParagraphElement;
        import flashx.textLayout.elements.SpanElement;
        import flashx.textLayout.elements.TextFlow;
        import flashx.textLayout.formats.TabStopFormat;
        import flashx.textLayout.formats.TextLayoutFormat;

        public class TabStopFormat_example extends Sprite
        {
            public function TabStopFormat_example()
            {
                var firstContainer:Sprite = new Sprite();
                this.stage.addChild( firstContainer );
                var textFlow:TextFlow = new TextFlow();
                var format:TextLayoutFormat = new TextLayoutFormat();
                var tabStop1:TabStopFormat = new TabStopFormat();
                var tabStop2:TabStopFormat = new TabStopFormat();
                var tabStop3:TabStopFormat = new TabStopFormat();
                tabStop1.alignment = flash.text.engine.TabAlignment.START;
                tabStop1.position = 50;
                tabStop2.alignment = flash.text.engine.TabAlignment.CENTER;
                tabStop2.position = 150;
                tabStop3.alignment = flash.text.engine.TabAlignment.END;
                tabStop3.position = 250;
                format.tabStops = new Array(tabStop1,tabStop2,tabStop3);
                textFlow.hostFormat = format;
                var p:ParagraphElement = new ParagraphElement();
                var span:SpanElement = new SpanElement();
                span.text = "1\txxx\txxx\txxx\n2\tyyyyyy\tyyyyyy<\tyyyyyy\n3\tzz\tzz\tzz";
                p.addChild(span);
                textFlow.addChild(p);
                textFlow.flowComposer = new StandardFlowComposer();
                var firstController:ContainerController = new ContainerController(firstContainer, 300, 100 );
                textFlow.flowComposer.addController(firstController);
                textFlow.flowComposer.updateAllControllers();
            }
        }
    }

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00